[PR #1329] [MERGED] JSON Response updates and small fixes #2947

Closed
opened 2026-03-03 09:09:04 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/1329
Author: @BlackDex
Created: 1/25/2021
Status: Merged
Merged: 2/3/2021
Merged by: @dani-garcia

Base: masterHead: misc-updates


📝 Commits (2)

  • 7dff8c0 JSON Response updates and small fixes
  • ecb46f5 Merge branch 'master' into misc-updates

📊 Changes

5 files changed (+167 additions, -44 deletions)

View changed files

📝 src/api/core/ciphers.rs (+42 -14)
📝 src/api/core/organizations.rs (+19 -0)
📝 src/db/models/cipher.rs (+43 -24)
📝 src/db/models/collection.rs (+31 -1)
📝 src/db/models/organization.rs (+32 -5)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/1329 **Author:** [@BlackDex](https://github.com/BlackDex) **Created:** 1/25/2021 **Status:** ✅ Merged **Merged:** 2/3/2021 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `master` ← **Head:** `misc-updates` --- ### 📝 Commits (2) - [`7dff8c0`](https://github.com/dani-garcia/vaultwarden/commit/7dff8c01dd86f69761f4822b8b0c41709f03f271) JSON Response updates and small fixes - [`ecb46f5`](https://github.com/dani-garcia/vaultwarden/commit/ecb46f591cb4c37609696f25d64e0f4a4e235b45) Merge branch 'master' into misc-updates ### 📊 Changes **5 files changed** (+167 additions, -44 deletions) <details> <summary>View changed files</summary> 📝 `src/api/core/ciphers.rs` (+42 -14) 📝 `src/api/core/organizations.rs` (+19 -0) 📝 `src/db/models/cipher.rs` (+43 -24) 📝 `src/db/models/collection.rs` (+31 -1) 📝 `src/db/models/organization.rs` (+32 -5) </details> ### 📄 Description 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 09:09:04 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#2947
No description provided.