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

CRAYSAT-1392: Graceful handle of user token expiry #252

Merged

Conversation

shivaprasad-metimath
Copy link
Contributor

@shivaprasad-metimath shivaprasad-metimath commented Aug 7, 2024

Summary and Scope

During the sat status execution if the user token is expired, there is a traceback which comes as the output. Hence graceful handling of the token expiry is added to inform the user.

Issues and Related PRs

List and characterize relationship to Jira/Github issues and other pull requests. Be sure to list dependencies.

Testing

List the environments in which these changes were tested.

Tested on:

  • rocket

Test description:

Manually the expiry date was updated in ~/.config/sat/tokens/api_gw_service_nmn_local.vers.json to replicate the issue.
And then the sat commands such as sat status, hwinv, hwmatch were executed to validate the changes

Risks and Mitigations

Low risk

Pull Request Checklist

  • Version number(s) incremented, if applicable
  • Copyrights updated
  • License file intact
  • Target branch correct
  • CHANGELOG.md updated
  • Testing is appropriate and complete, if applicable
  • HPC Product Announcement prepared, if applicable

@shivaprasad-metimath
Copy link
Contributor Author

Manually the expire date was changed in the ~/.config/sat/tokens/api_gw_service_nmn_local.vers.json to recreate the issue and then validated.
testing output on rocket:
https://gist.github.com/shivaprasad-metimath/d0f9a8d0df9458bc117e02fab7571166

sat/cli/status/main.py Outdated Show resolved Hide resolved
@shivaprasad-metimath shivaprasad-metimath force-pushed the CRAYSAT-1392-token-expiry-graceful-handle branch 5 times, most recently from ea8e201 to 7adec2a Compare August 13, 2024 08:28
@shivaprasad-metimath
Copy link
Contributor Author

Testing output on rocket:

(d950e16dc37a) sat-container:/ # sat status
ERROR: Invalid grant error: The token is not active or is invalid.Please re-authenticate using 'sat auth' to obtain a new token
(d950e16dc37a) sat-container:/ # sat hwinv
ERROR: Invalid grant error: The token is not active or is invalid.Please re-authenticate using 'sat auth' to obtain a new token
(d950e16dc37a) sat-container:/ # sat hwmatch
ERROR: Invalid grant error: The token is not active or is invalid.Please re-authenticate using 'sat auth' to obtain a new token
(d950e16dc37a) sat-container:/ # sat firmware
ERROR: Invalid grant error: The token is not active or is invalid.Please re-authenticate using 'sat auth' to obtain a new token
(d950e16dc37a) sat-container:/ #

CHANGELOG.md Outdated Show resolved Hide resolved
@shivaprasad-metimath shivaprasad-metimath force-pushed the CRAYSAT-1392-token-expiry-graceful-handle branch from 7adec2a to 003163b Compare August 13, 2024 11:31
Copy link
Contributor

@haasken-hpe haasken-hpe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall approach looks good. Needs minor improvements.

CHANGELOG.md Outdated Show resolved Hide resolved
sat/main.py Outdated Show resolved Hide resolved
sat/main.py Outdated Show resolved Hide resolved
@shivaprasad-metimath shivaprasad-metimath force-pushed the CRAYSAT-1392-token-expiry-graceful-handle branch from 003163b to 20f6c74 Compare August 14, 2024 05:36
During the sat status execution if the user token is expired, there is a traceback which comes as the output. Hence graceful handling of the token expiry is added to inform the user.
@shivaprasad-metimath shivaprasad-metimath force-pushed the CRAYSAT-1392-token-expiry-graceful-handle branch from 20f6c74 to 93c43d4 Compare August 14, 2024 05:46
@shivaprasad-metimath shivaprasad-metimath merged commit fe8ea55 into main Aug 14, 2024
3 checks passed
@shivaprasad-metimath shivaprasad-metimath deleted the CRAYSAT-1392-token-expiry-graceful-handle branch August 14, 2024 05:59
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.

3 participants