-
Notifications
You must be signed in to change notification settings - Fork 30
refactor(api): move auth logic to separate package #853
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
Merged
Conversation
This file contains hidden or 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
Codecov Report
@@ Coverage Diff @@
## main #853 +/- ##
==========================================
+ Coverage 62.03% 63.10% +1.07%
==========================================
Files 289 285 -4
Lines 15202 14944 -258
==========================================
Hits 9430 9430
+ Misses 5326 5068 -258
Partials 446 446 |
ecrupper
requested changes
May 19, 2023
Contributor
ecrupper
left a comment
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.
Awesome — I like it. One thing I did notice that was from an old commit that would be nice to change with this refactor
Co-authored-by: Easton Crupper <[email protected]>
ecrupper
approved these changes
May 19, 2023
plyr4
approved these changes
May 22, 2023
This was referenced May 22, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Based off of #615 #754 #809 #828 #829 #847 #848 #849 and #851
This change continues the refactor efforts initially introduced in the above PRs.
This adds a new
authpackage to thegithub.amrom.workers.dev/go-vela/server/apipackage.This contains all the same handlers that existed previously but with each of them within their own file.
There are several top-level auth-related handlers, so I combined them into the same package, and I renamed some of the handlers.
Here is a summary of handler moves and renames:
GET /authenticateapi/authenticate.goAuthenticateapi/auth/get_token.goGetAuthTokenGET /authenticate/:type[/:port]api/authenticate.goAuthenticateTypeapi/auth/redirect.goGetAuthRedirectPOST /authenticateapi/authenticate.goAuthenticateTokenapi/auth/post_token.goPostAuthTokenGET /loginapi/login.goLoginapi/auth/login.goLoginGET /logoutapi/logout.goLogoutapi/auth/logout.goLogoutGET /token-refreshapi/token.goRefreshAccessTokenapi/auth/refresh.goRefreshAccessTokenGET /validate-tokenapi/token.goValidateServerTokenapi/auth/validate.goValidateServerTokenNB: The commits are arranged to preserve git history (git blame) for all files. I suspect that the squash commit will erase that, but oh well - the history is at least preserved in this branch.