Skip to content

feat: require user-chosen connection names on login#448

Open
rishabhraj36 wants to merge 1 commit into
mainfrom
441-feat-always-require-a-named-connection-on-login
Open

feat: require user-chosen connection names on login#448
rishabhraj36 wants to merge 1 commit into
mainfrom
441-feat-always-require-a-named-connection-on-login

Conversation

@rishabhraj36

Copy link
Copy Markdown
Collaborator

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".

  • default is reserved for new writes; it remains a read-time alias for legacy vaults.
  • First saved connection automatically becomes the provider default.
  • CLI: --connection is optional in TTY mode (prompts for a name); required in non-interactive contexts (--quiet, scripts, CI).
  • UI: Connect/Add always opens the name dialog; hidden connection=default forms removed; client-side validation blocks "default".
  • Server: shared validate_login_connection_name() enforces naming in API and UI routes; resolve_connection_name() resolves omitted/default through metadata.
  • Docs: updated multiple-connections guide for named-first flow and connections 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 pytest
  • uv run ruff check src/ tests/
  • uv run ty check src/
  • Manual — CLI
    • authsome login github --connection work creates a named connection and sets it as default
    • authsome login github without --connection prompts in TTY; fails with usage error in non-TTY
    • authsome login github --connection default is rejected
    • authsome provider list --json shows connection names and is_default
    • authsome provider inspect github --json lists all connections for a provider
    • authsome connections set-default github work switches the default pointer
  • Manual — UI
    • Rebuilt static UI (scripts/build-ui.sh)
    • Dashboard Connect opens name dialog on first and subsequent connections
    • Submitting "default" is blocked in the dialog
    • OAuth connect flow succeeds with a real name (e.g. work)
  • Backward compatibility
    • Existing vaults with literal "default" connections still resolve on read
    • Lone named connection (no "default" record) routes as default in proxy

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Breaking: Scripts that run authsome login <provider> without --connection, or with --connection default, must be updated. Read paths (provider list, omitted --connection on get/export) remain compatible via metadata resolution.

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • All new and existing tests passed.

@rishabhraj36 rishabhraj36 linked an issue Jun 22, 2026 that may be closed by this pull request
6 tasks
@mintlify

mintlify Bot commented Jun 22, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
agentr 🟢 Ready View Preview Jun 22, 2026, 10:02 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: always require a named connection on login

1 participant