Skip to content
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

add config for additional oauth scopes #116

Merged
merged 3 commits into from
Mar 19, 2025
Merged

add config for additional oauth scopes #116

merged 3 commits into from
Mar 19, 2025

Conversation

tronghn
Copy link
Contributor

@tronghn tronghn commented Mar 19, 2025

  • chore(deps): go mod 1.24.0, remove toolchain directive
  • add config for additional oauth scopes
  • make prompt parameter for login optional

@tronghn tronghn requested a review from a team as a code owner March 19, 2025 14:35
@tronghn tronghn force-pushed the auth-scopes-prompt branch from b283b00 to 0158bb4 Compare March 19, 2025 14:40
@tronghn tronghn force-pushed the auth-scopes-prompt branch from 0158bb4 to 01cd247 Compare March 19, 2025 14:41
@tronghn tronghn requested a review from Copilot March 19, 2025 14:48

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 configuration changes to support additional OAuth scopes, updates the Go toolchain version, and makes the prompt parameter for login optional. Key modifications include updating the OAuth login handler to conditionally use a provided prompt, adding a new configuration field for additional OAuth scopes in charts and application config files, and updating the OIDC constructor and API handler to pass along the new scope configuration.

Reviewed Changes

Copilot reviewed 8 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/auth/authn/handler.go Updates the Login function to conditionally include the prompt parameter in the OAuth URL.
charts/values.yaml Adds an additionalScopes field to configure extra OAuth scopes.
charts/templates/deployment.yaml Passes the additionalScopes config value to the deployment via an environment variable.
mise.toml Updates the go tool version from 1.24.0 to 1.24.1.
charts/Feature.yaml Adds UI metadata for the additional OAuth scopes configuration.
internal/cmd/api/config.go Introduces AdditionalScopes field in the OAuth config struct.
internal/auth/authn/oidc.go Updates the NewOIDC function to accept and incorporate additional scopes.
internal/cmd/api/api.go Adjusts the NewOIDC call to pass the new AdditionalScopes configuration.
Files not reviewed (2)
  • go.mod: Language not supported
  • pkg/apiclient/go.mod: Language not supported
Comments suppressed due to low confidence (2)

internal/auth/authn/handler.go:81

  • [nitpick] Consider adding tests for the conditional handling of the 'prompt' parameter in the Login function to verify that various values (including an empty value) result in the expected OAuth URL.
if prompt := r.URL.Query().Get("prompt"); prompt != "" {

charts/templates/deployment.yaml:75

  • [nitpick] Consider adding tests for the deployment template to ensure that joining additionalScopes produces a valid comma-separated string, particularly when the array is empty or contains special characters.
- name: OAUTH_ADDITIONAL_SCOPES
@tronghn tronghn merged commit 05c9d14 into main Mar 19, 2025
2 checks passed
@tronghn tronghn deleted the auth-scopes-prompt branch March 19, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant