Repository navigation
[M8.2a] CLI: login, init, status and secrets - #192
Merged
Merged
Conversation
Signed-off-by: review <[email protected]>
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.
What changed
The first real CLI commands, replacing the M0.1 skeleton:
loginandlogout: save or forget a control plane address and an API token.init: write a validatedshipkeep.yml.status: applications, latest deployment and replicas.secrets list,secrets set NAME,secrets unset NAME.Commands reach an environment with
--org,--projectand--env, orSHIPKEEP_ORG,SHIPKEEP_PROJECTandSHIPKEEP_ENV.SHIPKEEP_URLandSHIPKEEP_TOKENreplace the saved login for automation.Why
PLAN M8.2, split into four in the PLAN. Which commands exist is decided by which routes accept a token today: the project and environment catalogs are session-only, so targets are IDs, not slugs.
Assumption
The login file is plain JSON, mode 0600, under the user's config directory, as
ghanddockerdo by default. An OS keychain would be stronger but needs a platform dependency per OS. This is reversible. A file other users can read is refused, and the message says the token must be considered exposed.How it was tested
go test -racewith a local HTTP server, including malicious input:file://,localhost.evil.example.initrefuses YAML injection through--nameand--image, and keeps an existing file.--tokenand--valuedo not exist.Not run against the real API yet. That comes with M8.2b.
Security considerations
secret.String.golang.org/x/term(BSD-3-Clause), allowed by the license policy.Checklist