Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If a node doesn't respond because authentication failed, I should get a more specific error message in the UI #338

Open
3 tasks
surchs opened this issue Oct 31, 2024 · 0 comments

Comments

@surchs
Copy link
Contributor

surchs commented Oct 31, 2024

Right now, if I do the following:

  • log in via query tool to my f-API successfully
  • launch a query that includes a n-API with auth enabled

If then the n-API does not like my identity token (or does not receive one from the f-API due to obscure bugs like neurobagel/federation-api#131), the n-API will respond to the f-API with a failure code.

From the perspective of the query tool, the response from the f-API will look like os:

Case of a single node-API that fails because of auth

{
    "errors": [
        {
            "node_name": "Local graph 1",
            "error": "Forbidden: {\"detail\":\"Not authenticated\"}"
        }
    ],
    "responses": [],
    "nodes_response_status": "fail"
}

Case of a multi-node query where one node fails because of auth

{
    "errors": [
        {
            "node_name": "Local graph 1",
            "error": "Forbidden: {\"detail\":\"Not authenticated\"}"
        }
    ],
    "responses": [
        {
            "node_name": "Quebec Parkinson Network",
            "dataset_uuid": "http://neurobagel.org/vocab/b9d3674d-432e-4f17-bcdc-e562df166aae",
            "dataset_name": "Quebec Parkinson Network",
            "dataset_portal_uri": "https://rpq-qpn.ca/en/home/",
            "dataset_total_subjects": 303,
            "records_protected": true,
            "num_matching_subjects": 303,
            "subject_data": "protected",
            "image_modals": [
                "http://purl.org/nidash/nidm#T1Weighted",
                "http://purl.org/nidash/nidm#DiffusionWeighted",
                "http://purl.org/nidash/nidm#FlowWeighted"
            ],
            "available_pipelines": {}
        }
    ],
    "nodes_response_status": "partial success"
}

In such a case I want that

  • the query tool tells me something like "node XYZ rejected authentication"
  • the query tool tells me that with some error-colored notistack popup that includes the node name(s)
  • If I get no results back at all (i.e. all nodes fail because they refuse to authenticate), my results area also says "all nodes refused authentication" or similar, rather than the more generic "all nodes failed to respond"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant