-
Notifications
You must be signed in to change notification settings - Fork 0
feat: basic jwt auth #8
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
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
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
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.
Pull Request Overview
This PR introduces basic JWT authentication support alongside the existing SPIFFE flow.
- Adds
github.com/golang-jwt/jwt/v4andgithub.com/MicahParks/keyfuncdependencies. - Refactors
cmd/main.goto use a pluggableAuthenticatorinterface for SPIFFE and JWT. - Implements
JwtAuthenticatorwith comprehensive unit tests and removes the deprecatedRefreshmethod from the interface and SPIFFE implementation.
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Added JWT and keyfunc dependencies; moved otel/sdk to indirect. |
| config.yaml.sample | Added commented JWT authentication example next to SPIFFE. |
| cmd/main.go | Refactored auth initialization to select and initialize providers dynamically. |
| auth/spiffe.go | Removed the unused Refresh method from SPIFFE authenticator. |
| auth/spiffe_test.go | Removed the Refresh test for SPIFFE authenticator. |
| auth/manager_test.go | Removed Refresh stub from MockAuthenticator. |
| auth/jwt.go | Added JwtAuthenticator implementation. |
| auth/jwt_test.go | Added extensive tests for JwtAuthenticator. |
| auth/authenticator.go | Dropped Refresh from the Authenticator interface. |
| auth/authenticator_test.go | Updated interface compliance tests to exclude Refresh. |
Comments suppressed due to low confidence (1)
auth/jwt.go:14
- Field
JwksUrluses mixed-case acronym. Go naming conventions recommend uppercase acronyms (e.g.,JWKSURL), so consider renaming toJWKSURLfor consistency.
JwksUrl string `yaml:"jwks-url"`
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
brendan-myers
commented
Jul 11, 2025
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.
No description provided.