Conversation
- add token-based auth for sensitive UI routes and browser handoff - wire the UI client to persist and send the auth token on protected requests - add `--protect-ui` so auth and sensitive var redaction are opt-in and the default UI behavior stays unchanged - expose the UI protection mode in server discovery and reuse only matching local UI servers - cover protected and unprotected server behavior with tests Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>
Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh> # Conflicts: # docs/yarn.lock
✅ Deploy Preview for devspace-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Adversarial Review — PR #3233 (DSP-173 / UI protection) All tests pass, the build is clean, and the overall design (opt-in flag, 32-byte random token, MEDIUM — RawConfig returned unredacted when --protect-ui is active File: pkg/devspace/server/server.go:278-279 retConfig.RawConfig = h.ctx.Config().Raw() Only Vars are redacted. RawConfig is the verbatim parsed devspace.yaml, which can contain hardcoded MEDIUM — /api/logs-multiple referenced in UI, never registered on server File: ui/src/components/views/Logs/TerminalCache/TerminalCache.tsx:62 withAuthQuery is applied to a /api/logs-multiple WebSocket URL: url: withAuthQuery( This route is not registered anywhere in registerRoutes() — not in this PR, and not on main either. That LOW — Auth token persisted before server begins listening File: pkg/devspace/server/server.go:94-100 NewServer writes the token to disk and then returns the *Server to the caller, who then calls LOW — Token file survives SIGKILL File: pkg/devspace/server/server.go:106-108 server.Server.RegisterOnShutdown(func() { RegisterOnShutdown callbacks only fire during graceful http.Server.Shutdown(). A process killed with LOW — Silent skip when protection level mismatches File: cmd/ui.go:124 if serverVersion.DevSpace && serverVersion.Protected == cmd.ProtectUI { When devspace dev --protect-ui is running and the user invokes devspace ui (without --protect-ui), the RegisterOnShutdown callbacks only fire during graceful http.Server.Shutdown(). A process killed with LOW — Silent skip when protection level mismatches File: cmd/ui.go:124 if serverVersion.DevSpace && serverVersion.Protected == cmd.ProtectUI { When devspace dev --protect-ui is running and the user invokes devspace ui (without --protect-ui), the LOW — isSensitiveVariableName pluralisation stripping is fragile File: pkg/devspace/server/server.go:339-342 upper := tokenUpper This handles CREDENTIALS→CREDENTIAL correctly but also strips the trailing S from words like INFO — PR template not filled in The PR body still has placeholder text: "resolves #", "Fixed an issue where DevSpace ...". No Linear issue INFO — Docs only show devspace dev and devspace ui File: docs/pages/getting-started/development.mdx --protect-ui is a global flag that also applies to devspace run-pipeline (and any other pipeline command |
What issue type does this pull request address? (keep at least one, remove the others)
/kind bugfix
/kind enhancement
/kind feature
/kind documentation
/kind test
What does this pull request do? Which issues does it resolve? (use
resolves #<issue_number>if possible)resolves #
Please provide a short message that should be published in the DevSpace release notes
Fixed an issue where DevSpace ...
What else do we need to know?