Read the API token from LARAVEL_CLOUD_TOKEN and make auth:token scriptable - #197
Merged
Conversation
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.
There was no way to give the CLI a token without a TTY.
cloud authneeds a browser andauth:token --addalways prompted, so the only option in CI was hand-writing~/.config/cloud/config.jsonat a path that changes withCLOUD_BASE_URL.The CLI now reads
LARAVEL_CLOUD_TOKENfrom the environment. It takes precedence over saved tokens and writes nothing to disk. An empty value counts as unset, so you can bypass it for a single command.auth:token --addand--removeaccept--token=or the token piped to stdin, and report the result as JSON when run non-interactively.The environment holds one token, so it picks its own organization. Naming a different one with
--organizationnow fails rather than quietly using the token's.authandauth:token --addwarn when a token you just saved is being overridden by the environment, andauth:token --listnames where each token came from.This also clears up a few non-interactive dead ends that returned a bare "Required.": adding with no token, removing a token that isn't saved, and running
auth:tokenwith no action flag.