feat(auth)!: build token implementation#765
Merged
Conversation
plyr4
reviewed
Feb 21, 2023
wass3r
previously approved these changes
Feb 21, 2023
waiting for go-vela/types changes to merge in
Codecov Report
@@ Coverage Diff @@
## main #765 +/- ##
==========================================
+ Coverage 54.39% 54.70% +0.31%
==========================================
Files 225 232 +7
Lines 16188 16392 +204
==========================================
+ Hits 8806 8968 +162
- Misses 6989 7024 +35
- Partials 393 400 +7
|
wass3r
previously approved these changes
Feb 23, 2023
plyr4
requested changes
Feb 23, 2023
Co-authored-by: dave vader <48764154+plyr4@users.noreply.github.com>
wass3r
previously approved these changes
Feb 23, 2023
Contributor
Author
|
wass3r
approved these changes
Feb 23, 2023
plyr4
approved these changes
Feb 23, 2023
timhuynh94
approved these changes
Feb 23, 2023
plyr4
added a commit
that referenced
this pull request
Feb 24, 2023
plyr4
added a commit
that referenced
this pull request
Feb 24, 2023
cognifloyd
approved these changes
Feb 27, 2023
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
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.
Server PR for Epic 1: Build Tokens.
Changes:
router/middleware/tokenpackage torouter/middleware/auth, which will now only retrieve auth headers from http requests, rather than generate/parse tokensinternal/tokenpackage, which features amanagerthat is set up in the context using various new flags added tomain.go. In brief, it's a one-stop-shop for token minting and validating and offers configurability to a degree.Claimsstruct, including information about the token type as well as relevant fields for that token (build tokens have build ids and repo).MustWorker()permissions check, which validates the symmetric token shared between server and workerMustBuildAccess()permissions check, which validates the build token, which is provided as a unique auth scope for each build.MustSecretAdminwhich will scope requests with build token auth based on the repo within the tokendepends on: go-vela/types#276