JSON Response updates and small fixes #2642

Closed
opened 2026-04-06 03:51:55 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @BlackDex on 1/25/2021

Updated several json response models.
Also fixed a few small bugs.

ciphers.rs:

  • post_ciphers_create:
    • Prevent cipher creation to organization without a collection.
  • update_cipher_from_data:
    • Fixed removal of user_uuid which prevent user-owned shared-cipher to be not editable anymore when set to read-only.
    • Cleanup the json_data by removing the Response key/values from several objects.
  • delete_all:
    • Do not delete all Collections during the Purge of an Organization (same as upstream).

cipher.rs:

  • Cipher::to_json:
    • Updated json response to match upstream.
    • Return empty json object if there is no type_data instead of values which should not be set for the type_data.

organizations.rs:

  • Added two new endpoints to prevent Javascript errors regarding tax

organization.rs:

  • Organization::to_json:
    • Updated response model to match upstream
  • UserOrganization::to_json:
    • Updated response model to match upstream

collection.rs:

  • Collection::{to_json, to_json_details}:
    • Updated the json response model, and added a detailed version used during the sync
  • hide_passwords_for_user:
    • Added this function to return if the passwords should be hidden or not for the user at the specific collection (used by to_json_details)

Update 1: Some small changes after comments from @jjlin.
Update 2: Fixed vault purge by user to make sure the cipher is not part of an organization.

Resolves #971
Closes #990, Closes #991

*Originally created by @BlackDex on 1/25/2021* Updated several json response models. Also fixed a few small bugs. ciphers.rs: - post_ciphers_create: * Prevent cipher creation to organization without a collection. - update_cipher_from_data: * ~~Fixed removal of user_uuid which prevent user-owned shared-cipher to be not editable anymore when set to read-only.~~ * Cleanup the json_data by removing the `Response` key/values from several objects. - delete_all: * Do not delete all Collections during the Purge of an Organization (same as upstream). cipher.rs: - Cipher::to_json: * Updated json response to match upstream. * Return empty json object if there is no type_data instead of values which should not be set for the type_data. organizations.rs: * Added two new endpoints to prevent Javascript errors regarding tax organization.rs: - Organization::to_json: * Updated response model to match upstream - UserOrganization::to_json: * Updated response model to match upstream collection.rs: - Collection::{to_json, to_json_details}: * Updated the json response model, and added a detailed version used during the sync - hide_passwords_for_user: * Added this function to return if the passwords should be hidden or not for the user at the specific collection (used by `to_json_details`) Update 1: Some small changes after comments from @jjlin. Update 2: Fixed vault purge by user to make sure the cipher is not part of an organization. Resolves #971 Closes #990, Closes #991
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/vaultwarden#2642