Repository navigation
fix(lk): --dev under --user-auth is an error - #1089
Open
Topherhindman wants to merge 2 commits into
Open
Topherhindman wants to merge 2 commits into
Topherhindman wants to merge 2 commits into
Conversation
No user-auth path reads --dev. Commands that load a session project asked the Public API for a token for the user's project, and agent runs took their key from the agent's env files, so `lk --user-auth --dev room list` acted on a cloud project instead of the local dev server, without a word about --dev. --dev asks for the dev server's API key, which is API-key auth, so the combination is now an error, checked once in the root Before so every command gets it: "--dev can't be combined with --user-auth; remove --user-auth or drop --dev". It follows --dev with an API key or secret, which is also an error. --dev alone and --user-auth alone are unchanged.
--dev under --user-auth is now an error for every command, so the property requires lk to fail without naming a project, as it does for --user-auth with --legacy-auth.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes DEVX-902
Under
--user-auth, lk ignored--dev. No user-auth path reads it.lk --user-auth --dev room listasked the Public API for a token for the signed-in user's project and listed that project's rooms, not the local dev server's.lk --user-auth agent start --devran the agent with the cloud key from its.env.local. Nothing said--devwas dropped.--devasks for the dev server's API key, which is API-key auth. So the combination is now an error for every command, in the same way #1084 did for--devwith an API key or secret:Before this change, the same command printed
Using user [[email protected]]and went to the user's cloud project.The check runs once, in the root
Before, so it doesn't matter where on the command line either flag goes.--devalone and--user-authalone are unchanged.Tests:
TestDevUnderUserAuthGate: both spellings of--user-authwith--devfail with the message, and each flag alone doesn't.dev-with-user-auth.txtar):room listandproject listfail with no request to the session's project or the Public API, and--devalone still uses the dev credentials with a user signed in. It fails on main.--devunder--user-authto fail without naming a project. It passes with 1000 checks.go build ./...,go vet ./...andgo test ./...pass.