Skip to content

make console relative paths - #214

Merged
aojea merged 2 commits into
google:mainfrom
aojea:substrate
Jul 17, 2026
Merged

aojea merged 2 commits into
google:mainfrom
aojea:substrate

Conversation

@aojea

@aojea aojea commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request configures the console to be served under the /console/ subpath by adding ingress routing rules, updating the Dex configuration with new redirect URIs, and modifying the frontend to use relative paths. However, a critical issue was identified where the backend's OIDC redirect URI generation does not account for the /console subpath, which will cause authentication requests to be rejected by Dex.

Comment thread .github/k8s/dex-config.yaml
@aojea

aojea commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for a configurable base path (--base-path) in the console server, allowing it to be hosted under a subpath like /console. It updates Kubernetes templates, Dex configurations, cookie paths, and OIDC redirect URIs to respect this base path, while updating frontend API calls to use relative paths. Feedback suggests sanitizing the BasePath configuration to prevent potential double slashes in cookie paths and redirect URIs, which could cause OIDC authentication failures.

Comment on lines +125 to 126
s.mux.HandleFunc("/info", s.HandleInfo)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Sanitize the BasePath configuration to ensure it starts with a leading slash and does not contain any trailing slashes. If a user configures --base-path with a trailing slash (e.g., /console/), it can result in double slashes in cookie paths (e.g., /console//) and redirect URIs (e.g., /console//auth/callback), which will cause OIDC authentication to fail due to redirect URI mismatch in Dex.

Suggested change
s.mux.HandleFunc("/info", s.HandleInfo)
s.mux.HandleFunc("/info", s.HandleInfo)
if s.cfg.BasePath != "" {
if s.cfg.BasePath[0] != '/' {
s.cfg.BasePath = "/" + s.cfg.BasePath
}
for len(s.cfg.BasePath) > 0 && s.cfg.BasePath[len(s.cfg.BasePath)-1] == '/' {
s.cfg.BasePath = s.cfg.BasePath[:len(s.cfg.BasePath)-1]
}
}

@aojea
aojea merged commit c1c7e9d into google:main Jul 17, 2026
15 checks passed
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