GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||
GeezerVison is showing github.com — feat: OAuth browser login with automatic token lifecycle (0.3.1) by Episkey-G · Pull Request #93 · ucloud/ucloud-cli Conversation
Collaborator
SummaryAdds browser-based OAuth login to ucloud-cli, so interactive users no longer need to handle AK/SK keys:
Credential model
Token lifecycle (fully automatic)
Robustness / security
Testing
Notes for reviewers
🤖 Generated with Claude Code
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsAdd 'ucloud auth login' / 'ucloud auth logout' implementing OAuth 2.0 authorization-code flow with RFC 8252 loopback auto-capture of the callback (--no-browser prints the URL and falls back to manual paste). auth_mode on the profile picks exactly one credential mechanism per request: oauth profiles send Authorization: Bearer only (stored AK/SK stay inert for logout restore), AK/SK and CloudShell signing paths are byte-identical to before. Token lifecycle is fully automatic: proactive refresh before expiry (5-minute clock-skew margin), reactive refresh-and-replay-once when the gateway rejects a token mid-command (RetCode 174), refresh rotation serialized across processes with a file lock plus reread-after-lock, and credential/config files written atomically (temp+fsync+rename). Token values are redacted across all log sinks and the panic path. Also fixes: config update --base-url validated against the old gateway (chicken-and-egg), login kept a stale project_id from another account, init on an oauth profile did not persist the switch back to AK/SK, /dev/null was misdetected as an interactive terminal, and AggConfigManager held process-lifetime file handles that break os.Rename on Windows. Co-Authored-By: Claude Opus 4.8 <[email protected]> Co-Authored-By: Claude Opus 4.8 <[email protected]> …arning; redact oauth error desc Co-Authored-By: Claude Opus 4.8 <[email protected]> Co-Authored-By: Claude Opus 4.8 <[email protected]>
Collaborator
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. … base/endpoints.go Move the API gateway base URL, OAuth base URL, client credentials, scope, /authorize and /token endpoint paths, and the loopback callback constants into one file grouped by service domain. The callback path is now a single exported constant (base.OAuthRedirectPath) shared by the redirect_uri builder and the callback server's mux, removing a cross-file duplicate that had to be kept in sync by hand. No behavior change. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Collaborator
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. …r defaults DefaultBaseURL belongs with the other profile-default constants; a dedicated file separated it from its peers. Keep the overridable default URLs together (api gateway + oauth) and group the OAuth protocol/loopback constants in config.go. No behavior change. Co-Authored-By: Claude Opus 4.8 <[email protected]> …bal flag Mirror --base-url: add --oauth-base-url to config add/update, a global --oauth-base-url override, and the GlobalFlag/mergeConfigIns plumbing so oauth_base_url can be configured without hand-editing config.json — needed for environments whose OAuth domain differs from the default. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Collaborator
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. …-domain login A new user targeting a non-default OAuth environment was stuck: the global --oauth-base-url is not accepted on the auth command group, config update needs an existing profile, and config add requires AK/SK. auth login now takes its own --oauth-base-url, usable with no prior config and persisted to the profile so later refreshes reuse it. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Collaborator
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. … auth login only The config add/update flags and the global --oauth-base-url override added in dd60cef were over-built: config add targets AK/SK profiles where an oauth domain is meaningless, and the global flag only affects the rare refresh path. auth login --oauth-base-url is the one entry point that solves the real case (first-time / custom-domain login) and is kept. Co-Authored-By: Claude Opus 4.8 <[email protected]> …s stay omitempty On login, an oauth profile persists its effective OAuth base URL (the --oauth-base-url value, or the built-in default) so it is visible in the profile and reused by later refreshes. AK/SK profiles are untouched and keep oauth_base_url omitted (omitempty); GetOAuthBaseURL's runtime default still applies to old or hand-edited profiles. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Collaborator
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Ali1213
reviewed
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well done
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. | |||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |