Introduce proxy auth support#8751
Conversation
Signed-off-by: Aylei <rayingecho@gmail.com>
Summary of ChangesHello @aylei, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly extends the authentication capabilities of the SkyPilot API server by integrating support for external authentication proxies. This feature allows deployments to leverage existing identity providers and proxy solutions (like AWS ALB with Cognito or Azure Front Door) by trusting user identity information passed through specific HTTP headers. The changes encompass new Helm chart configurations for easy deployment, robust server-side logic to parse and validate user identities from these headers (including JWT tokens), and crucial validation rules to ensure compatibility and prevent conflicts with other authentication methods. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for external proxy authentication, which is a great addition for flexible deployment scenarios. The changes are well-implemented across the Helm charts and the server-side Python code. I appreciate the attention to backward compatibility and the comprehensive unit tests. I have a couple of suggestions to improve performance by caching the configuration loading.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Aylei <rayingecho@gmail.com>
|
/smoke-test |
| # on the ingress). So: | ||
| # - If any of the built-in auth schemes is enabled, disable it since | ||
| # built-in auth is exclusive with auth on the ingress | ||
| # - Otherwise we enable it since user should have at least one ingress |
There was a problem hiding this comment.
How does this work with the basic auth on ingress and oauth on ingress cases?
There was a problem hiding this comment.
Oh, the external proxy should take the role of the nginx ingress in previous deployments.
|
The failed smoke test cases are not introduced by this PR. |
Previously, the API server only supported nginx + oauth2-proxy for SSO authentication on the ingress. Users deploying behind other authentication proxies had limited options.
This PR extends the authentication system to trust any external proxy that sets a user identity header, supporting two kinds of header format:
plaintext: the trusted header will be used as the identityjwt: the trusted header is a JWT token, in this case an optionaljwt_identity_claimcan be specified (default tosub) as the user identity as the requestWhen
oauth.externalProxyis enabled, all the requests are assumed to have been authenticated by the proxy in front of the skypilot API server, it is the user's duty to ensure the authentication scheme on the proxy is secure and no requests can be sent to API server bypassing the proxy.Usage: refer to the
docs/source/reference/api-server/helm-values-spec.rstTested (run the relevant ones):
auth.oauth.enabled==trueon existing deployment, does not break existing OAuth2bash format.sh/smoke-test(CI) orpytest tests/test_smoke.py(local)/smoke-test -k test_name(CI) orpytest tests/test_smoke.py::test_name(local)/quicktest-core(CI) orpytest tests/smoke_tests/test_backward_compat.py(local)