-
Notifications
You must be signed in to change notification settings - Fork 108
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
Generation of API key on pbench-server #3368
Merged
dbutenhof
merged 14 commits into
distributed-system-analysis:main
from
siddardh-ra:PBENCH-1067
Apr 14, 2023
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e6bf449
Rework api_key model and implement _key functionality .
7b45b07
Remove unused fixtures and comment fixes and code cleanups
d3f29ca
Remove auth_tokens.py and updated alembic file
e4e1bf2
Fix black check - remove unused imports
e2a9217
Rebased and fix merge conflicts
5b5ef6f
Fix alembic error of circular imports
797081b
Addressed review comments and removed audience tag from payload
3306278
Updated alembic file
798d22e
Updated the duplicate key check & did assert of audit
5c64bcd
Fix black error and simplified return statement
71a12e0
Review comments and generalize decode_integrity_error
02bab01
Modified status code to OK for the DuplicateApiKey and review comments
7d3de88
Minor code refactoring
831ad0b
Updated type of on_null and on_duplicate as Callable
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a little "heavy" (or not DRY enough). I think it would be better to use a local variable to capture the response status, which you would set to
OK
here and toCREATED
either inside thetry
block after line 67 or in anelse
clause on thetry
block, and then have a common exit path where you create theresponse
, set thestatus_code
, andreturn
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also skipping the audit
attributes
setting ...Although ... this makes me realize that there isn't really a clear way to record the "duplicate, alternate success" status, and I'm not sure what to do about that. Probably nothing, in the context of this PR. 😦
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another excellent reason for a common return point!
Yes, not in this PR.... 😏