Conversation
Collaborator
Author
|
Docs and tests in the same PR bloated this a bit in changes in the diff |
This branch has not been deployed
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.
Logging into a second environment currently overwrites the provider-wide session, and environment checks only inspect API keys. Keep named environments' login sessions with their configuration and show login state, token availability, remaining access/refresh time, refresh expiry, and storage location in
env show.Behavior and storage
XDG_CONFIG_HOMEoverrides the config root. Named environment JSON files store sessions in private_loginsmetadata alongside the existing configuration. Each file indexes sessions by CDA API root, so changing or overriding a URL cannot reuse another URL's token. Separate environment names retain independent sessions even when their API roots match. Named environments do not fall back to the default session file.env showdisplays local login/token status, access lifetime, refresh time remaining and expiry, and token-file location. It also lists default logins, without network calls.env checkandenv show --checkadditionally check named environments' connectivity and credentials using the protected/rolesendpoint. A usable saved token takes precedence over the environment's API key. HTTP failures and redirects are not reported as authenticated.login --statusinspects the current environment's session;login --token-locationprints its path. Neither opens a browser or refreshes tokens.--api-rootand explicit custom--token-fileare supported; inspection flags cannot be combined with--refresh.env setuppreserves login metadata;env deleteremoves that environment and its sessions together. Tokens are omitted from status output, every export format, and activated-shell variables.Validation
.devcontainer, including DSS tests. The full suite used an identical source copy at/tmp/cwms-clibecause an existing update test requires that directory suffix:devcontainer exec --workspace-folder . env PYTHONPATH=/tmp/cwms-cli poetry run pytest -q /tmp/cwms-cli/tests.git diff --checkpassed.Console demonstration
Captured from real Click commands in the dev container, with an isolated config directory, a fixed clock, fixture OIDC tokens, and a local HTTP server. The HTTP checks are real local requests and each endpoint accepts only its own token; browser/OIDC login is stubbed. This is local validation, not a live CWBI login test. The harness loads actual
env exportoutput between commands. Routine stderr logging is omitted; excerpts below omit repeated environment rows where indicated.