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

Handle auth and data errors #4

Merged
merged 9 commits into from
Nov 21, 2023
Merged

Handle auth and data errors #4

merged 9 commits into from
Nov 21, 2023

Conversation

chandra-tacc
Copy link
Contributor

@chandra-tacc chandra-tacc commented Nov 17, 2023

Overview

  1. When authentication fails or user is not authenticated, provide a message to user to authenticate in the portal
  2. When data is invalid, try again by bypassing cache.

Related

Corresponding change: datastore PR 8

Testing

Try it out at: https://dev.a2cps.tacc.utexas.edu/reports/imaging-overview-latest/
delete coresessionid cookie in dev tools to simulate session issue.

  1. Test with expired or invalid session id
    Screenshot 2023-11-17 at 3 13 18 PM

Logs:

[2023-11-17 20:48:56 +0000] [10] [INFO] serving layout using datastore: http://a2cps-datastore-latest:8050/api/
[2023-11-17 20:48:56 +0000] [10] [INFO] Requesting data from api http://a2cps-datastore-latest:8050/api/imaging
[2023-11-17 20:48:56 +0000] [10] [INFO] Error response from datastore: {'error': 'Missing session id', 'error_code': 'MISSING_SESSION_ID'}
[2023-11-17 20:48:56 +0000] [10] [WARNING] Auth error from datastore, asking user to authenticate
  1. Test with invalid data (forced a situation in datastore to make this happen), See that it sends a request to ignore cache on bad data:

Logs:

[2023-11-17 21:45:23 +0000] [9] [INFO] serving layout using datastore: http://a2cps-datastore-latest:8050/api/
[2023-11-17 21:45:23 +0000] [9] [INFO] Requesting data from api http://a2cps-datastore-latest:8050/api/imaging
[2023-11-17 21:45:23 +0000] [9] [INFO] Error response from datastore: {'error': 'Missing session id', 'error_code': 'MISSING_SESSION_ID'}
[2023-11-17 21:45:23 +0000] [9] [WARNING] Auth error from datastore, asking user to authenticate
[2023-11-17 21:45:52 +0000] [9] [INFO] serving layout using datastore: http://a2cps-datastore-latest:8050/api/
[2023-11-17 21:45:52 +0000] [9] [INFO] Requesting data from api http://a2cps-datastore-latest:8050/api/imaging
[2023-11-17 21:46:04 +0000] [9] [INFO] serving layout using datastore: http://a2cps-datastore-latest:8050/api/
[2023-11-17 21:46:04 +0000] [9] [INFO] Requesting data from api http://a2cps-datastore-latest:8050/api/imaging
[2023-11-17 21:46:04 +0000] [9] [INFO] Error response from datastore: {'error': "local variable 'api_date' referenced before assignment", 'error_code': 'DATA_ERROR'}
[2023-11-17 21:46:04 +0000] [9] [INFO] Requesting data from api http://a2cps-datastore-latest:8050/api/imaging to ignore cache.

@chandra-tacc chandra-tacc merged commit f35a17b into main Nov 21, 2023
1 check failed
@mepearson mepearson mentioned this pull request Jul 1, 2024
8 tasks
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

Successfully merging this pull request may close these issues.

2 participants