feat: require user-chosen connection names on login#448
Open
rishabhraj36 wants to merge 1 commit into
Open
Conversation
6 tasks
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
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.
Description
Require user-chosen connection names on every login. The provider default is now a metadata pointer (
default_connection) to one of those named connections, not a connection literally stored as"default".defaultis reserved for new writes; it remains a read-time alias for legacy vaults.--connectionis optional in TTY mode (prompts for a name); required in non-interactive contexts (--quiet, scripts, CI).connection=defaultforms removed; client-side validation blocks"default".validate_login_connection_name()enforces naming in API and UI routes;resolve_connection_name()resolves omitted/defaultthrough metadata.multiple-connectionsguide for named-first flow andconnections set-default.Motivation and Context
Fixes #441.
Previously, the first connection was implicitly named
"default", which conflated the storage key with the concept of “default connection.” That made multiple-connection UX confusing (UI had special-case paths for first vs subsequent logins) and made"default"feel like a real connection name rather than a pointer.This change makes naming explicit from the first login while preserving backward compatibility for existing vaults that still have a literal
"default"record.How Has This Been Tested?
uv run pytestuv run ruff check src/ tests/uv run ty check src/authsome login github --connection workcreates a named connection and sets it as defaultauthsome login githubwithout--connectionprompts in TTY; fails with usage error in non-TTYauthsome login github --connection defaultis rejectedauthsome provider list --jsonshows connection names andis_defaultauthsome provider inspect github --jsonlists all connections for a providerauthsome connections set-default github workswitches the default pointerscripts/build-ui.sh)"default"is blocked in the dialogwork)"default"connections still resolve on read"default"record) routes as default in proxyTypes of changes
Breaking: Scripts that run
authsome login <provider>without--connection, or with--connection default, must be updated. Read paths (provider list, omitted--connectionon get/export) remain compatible via metadata resolution.Checklist: