Skip to content

feat(plugin-onepassword): Support multiple named 1Password vault configurations per owner (#1791) - #1836

Closed
Adityakk9031 wants to merge 1 commit into
UsefulSoftwareCo:mainfrom
Adityakk9031:feat/multiple-1password-vault-configurations
Closed

feat(plugin-onepassword): Support multiple named 1Password vault configurations per owner (#1791)#1836
Adityakk9031 wants to merge 1 commit into
UsefulSoftwareCo:mainfrom
Adityakk9031:feat/multiple-1password-vault-configurations

Conversation

@Adityakk9031

Copy link
Copy Markdown
Contributor

Resolves #1791

Problem

The 1Password credential provider previously supported only a single owner-scoped configuration containing one vaultId (or multi-vault list in a single connection). Configuring another vault or account replaced the existing configuration, preventing users from separating Personal vs Work accounts or targeting distinct service accounts without overwriting siblings.

Solution

This PR introduces support for multiple named 1Password vault configurations per owner:

  1. Named Configuration Model & Persistence:

    • OnePasswordConfig represents an individual named configuration containing { id, name, auth, vaultId, vaultName? }.
    • StoredOnePasswordConfig persists owner configurations under { configs: OnePasswordConfig[] }.
    • Backward-compatible normalization seamlessly upgrades existing legacy single-vault and multi-vault blobs assigning id: "default".
  2. Ref & URI Resolution (resolveConfiguredRef):

    • Named configuration addressing: op://<configId>/<itemId>, op://<configId>/<vaultId>/<itemId>, op://<configId>/<itemId>/<field>.
    • Legacy vault addressing: op://<vaultId>/<itemId> and op://<vaultName>/<itemId>.
    • Strict vault isolation: references outside configured vaults fail with outside-vaults.
    • Ambiguity detection: bare item references matching multiple configured vaults report all matching configs and vaults.
  3. API & Static Tools Surface:

    • Added listConfigs endpoint (GET /onepassword/configs) and static tool.
    • Updated getConfig, removeConfig, and status to accept an optional id parameter.
    • Full service-account token redaction across all external/UI-facing endpoints.
  4. React Settings UI (OnePasswordSettings):

    • Displays all configured 1Password vault connections in the settings card stack.
    • Independent Edit and Disconnect buttons per vault configuration.
    • Added "+ Add 1Password vault" action with single-vault selection dialog.
  5. Testing:

    • Exhaustive test suite covering multi-config management, independent creation/updates/deletions, token redaction, legacy normalization, and URI resolution/ambiguity detection.

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.

Support multiple named 1Password vault configurations per owner

2 participants