-
Notifications
You must be signed in to change notification settings - Fork 173
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
base: main
Are you sure you want to change the base?
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.45% 65.57% +0.11%
==========================================
Files 404 405 +1
Lines 39498 39669 +171
==========================================
+ Hits 25852 26011 +159
- Misses 11649 11655 +6
- Partials 1997 2003 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
d02114e to
a15d25b
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
Implements single component with tests. Tests are 2/3rds of the added lines.