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

Check user is whitelisted after authentication #275

Merged
merged 13 commits into from
May 16, 2024

Conversation

jacquelynsmale
Copy link
Contributor

No description provided.

@jacquelynsmale jacquelynsmale marked this pull request as draft May 13, 2024 23:53
@jacquelynsmale jacquelynsmale requested a review from a team as a code owner May 13, 2024 23:53
@jacquelynsmale jacquelynsmale changed the title first commit Check user is whitelisted after authentication May 13, 2024
@jacquelynsmale jacquelynsmale added the patch Bump the patch version number of this project label May 15, 2024
@jacquelynsmale jacquelynsmale marked this pull request as ready for review May 15, 2024 19:38
info = self.my_info()
if info['application_status'] != 'APPROVED':
warnings.warn(f'User {info["user_id"]} has not yet applied for a monthly credit allotment.'
' Please visit https://hyp3.asf.alaska.edu/request_access to submit your application.')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will https://hyp3.asf.alaska.edu/request_access be the correct link?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

The warning message(s) can match the error message(s) we implemented in HyP3 at https://github.com/ASFHyP3/hyp3/blob/develop/lib/dynamo/dynamo/exceptions.py#L19 for not started/pending/rejected

Copy link
Contributor

Choose a reason for hiding this comment

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

@asjohnston-asf so would you suggest different warning messages for no submitted application, pending application, and rejected?

Copy link
Member

Choose a reason for hiding this comment

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

If you like. I documented them as stretch goals in the comments for TOOL-2740, but I'm not going to insist if you don't think it's worth the effort.

src/hyp3_sdk/hyp3.py Outdated Show resolved Hide resolved
@forrestfwilliams forrestfwilliams merged commit 33fb8f0 into develop May 16, 2024
8 checks passed
@forrestfwilliams forrestfwilliams deleted the check-whitelist branch May 16, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Bump the patch version number of this project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants