Skip to content

Support organizations and collections in list, add and generate - #390

Closed
lkarlslund wants to merge 1 commit into
doy:mainfrom
lkarlslund:org-collection-fields
Closed

lkarlslund wants to merge 1 commit into
doy:mainfrom
lkarlslund:org-collection-fields

Conversation

@lkarlslund

Copy link
Copy Markdown

Addresses #102.

What

  • rbw sync now also stores organization names, the vault's collections (names stay encrypted with the organization key) and each entry's collection ids.
  • rbw list --fields org,collections shows which organization and collection(s) an entry belongs to. Both are also included in --raw output.
  • rbw add and rbw generate accept --org NAME and --collection NAME (repeatable). The entry is encrypted with the organization key and created via POST /ciphers/create together with its collection ids. Organization and collection names match case-insensitively, and ids are accepted too. If the organization is given without a collection, or a name is unknown, the error lists the available choices.

Compatibility

  • The new options are optional. Without them add/generate behave as before: same personal-key encryption, same POST /ciphers, and an identical request body (organizationId is skipped when unset).
  • The new db fields use #[serde(default)], so existing caches load unchanged, and older versions can still read caches written by this one.
  • The only visible change to existing output is two extra keys (org, collections) in rbw list --raw.

Testing

  • cargo test and cargo clippy pass.
  • Tested against a Vaultwarden server with one organization: list --fields name,org,collections shows org and collection names, and a --org/--collection add created an entry in the right collection, which decrypted correctly and was removed again.

- sync stores organization names, collections and each entry's collection ids
- rbw list --fields org,collections shows where entries live
- rbw add/generate --org NAME --collection NAME create entries inside an
  organization collection (encrypted with the organization key, created via
  POST /ciphers/create)
@lkarlslund

Copy link
Copy Markdown
Author

Closing in favour of #379, which covers the same org/collection support (and more: filters on get/edit/remove, --set-collection, tests). Sorry for the noise.

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.

1 participant