-
Notifications
You must be signed in to change notification settings - Fork 175
Embedded Auth Server Runner Integration #3540
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
Conversation
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.
Large PR Detected
This PR exceeds 1000 lines of changes and requires justification before it can be reviewed.
How to unblock this PR:
Add a section to your PR description with the following format:
## Large PR Justification
[Explain why this PR must be large, such as:]
- Generated code that cannot be split
- Large refactoring that must be atomic
- Multiple related changes that would break if separated
- Migration or data transformationAlternative:
Consider splitting this PR into smaller, focused changes (< 1000 lines each) for easier review and reduced risk.
See our Contributing Guidelines for more details.
This review will be automatically dismissed once you add the justification section.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3540 +/- ##
==========================================
+ Coverage 65.44% 65.54% +0.10%
==========================================
Files 404 405 +1
Lines 39508 39678 +170
==========================================
+ Hits 25856 26008 +152
- Misses 11657 11669 +12
- Partials 1995 2001 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d02114e to
a15d25b
Compare
jhrozek
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.
one inline comment that can be fixed later, otherwise lgtm
|
✅ Large PR justification has been provided. The size review has been dismissed and this PR can now proceed with normal review. |
Large PR justification has been provided. Thank you!
a52cc19 to
f7f655d
Compare
Introduce EmbeddedAuthServer wrapper in pkg/authserver/runner that integrates the authorization server with the proxy runner. The wrapper: - Transforms authserver.RunConfig to authserver.Config at runtime - Loads signing keys from files (EC/RSA PEM) with fallback support - Reads HMAC secrets from files with rotation support - Resolves upstream client secrets from files or environment variables - Performs OIDC discovery to populate authorization/token endpoints - Supports both OIDC and pure OAuth2 upstream provider types - Provides HTTP handler for OAuth/OIDC endpoints Includes comprehensive unit tests covering key provider creation, HMAC secret loading, token lifespan parsing, secret resolution, config conversions, and OIDC discovery with mock servers.
f7f655d to
8f5eccb
Compare
This PR introduces the
EmbeddedAuthServerwrapper inpkg/authserver/runner/that bridges serializable configuration with the authorization server runtime. The wrapper:authserver.RunConfig(file paths, env var names) toauthserver.Config(resolved values) at runtimeWhy
This is the final step of the Embedded Authorization Server feature (stacklok-epics#230). It enables MCP servers running in Kubernetes to:
Run an embedded OAuth2/OIDC authorization server that authenticates users via upstream identity providers (Okta, Auth0, GitHub, etc.)
Handle secrets securely by keeping them out of serialized configuration - the
RunConfigcontains only file paths and environment variable names that are resolved at runtime from mounted Kubernetes SecretsSupport the complete MCP authentication flow where the embedded server issues tokens that downstream MCP clients use to access the MCP server's resources
Related
pkg/authserver/changes for: stacklok-epics#230Large PR Justification