[PR #12] [MERGED] Decoupling user from cipher #3923

Closed
opened 2025-10-09 18:32:41 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/12
Author: @mprasil
Created: 4/27/2018
Status: Merged
Merged: 5/4/2018
Merged by: @dani-garcia

Base: masterHead: user_decoupling


📝 Commits (4)

  • 514a372 Add per-user folder-cipher mapping
  • c3be1b4 Fix FolderCipher creation, handle some errors
  • a0796ac Implement suggested improvements
  • c4360ee Save extra query when checking write access

📊 Changes

9 files changed (+215 additions, -47 deletions)

View changed files

migrations/2018-04-27-155151_create_users_ciphers/up.sql (+32 -0)
📝 src/api/core/ciphers.rs (+27 -24)
📝 src/api/core/organizations.rs (+4 -3)
📝 src/db/models/cipher.rs (+86 -11)
📝 src/db/models/collection.rs (+10 -2)
📝 src/db/models/folder.rs (+43 -2)
📝 src/db/models/mod.rs (+1 -1)
📝 src/db/models/organization.rs (+1 -1)
📝 src/db/schema.rs (+11 -3)

📄 Description

This is very much work in progress, definitely not ready to be pulled yet - does not even compile at the moment. I'm just putting it out there to see your thoughts about this.

I took your migration script from #10 and made an attempt at decoupling the users from the ciphers. I went a bit further and removed user_uuid from cipher completely - we can manage that ownership in the users_ciphers table. That also means that the folder_uuid in that table might be null in case the cipher is not in any folder.


🔄 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/12 **Author:** [@mprasil](https://github.com/mprasil) **Created:** 4/27/2018 **Status:** ✅ Merged **Merged:** 5/4/2018 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `master` ← **Head:** `user_decoupling` --- ### 📝 Commits (4) - [`514a372`](https://github.com/dani-garcia/vaultwarden/commit/514a372bc85fd495d331f240e35377a8ebdfb3c4) Add per-user folder-cipher mapping - [`c3be1b4`](https://github.com/dani-garcia/vaultwarden/commit/c3be1b4298206c084e397b4c0a3e2e840baf6d8e) Fix FolderCipher creation, handle some errors - [`a0796ac`](https://github.com/dani-garcia/vaultwarden/commit/a0796acbc73e8e7b9bcd94bab334cc82aa922835) Implement suggested improvements - [`c4360ee`](https://github.com/dani-garcia/vaultwarden/commit/c4360ee6976bdbb5223cab3da09d8d53d6dfefba) Save extra query when checking write access ### 📊 Changes **9 files changed** (+215 additions, -47 deletions) <details> <summary>View changed files</summary> ➕ `migrations/2018-04-27-155151_create_users_ciphers/up.sql` (+32 -0) 📝 `src/api/core/ciphers.rs` (+27 -24) 📝 `src/api/core/organizations.rs` (+4 -3) 📝 `src/db/models/cipher.rs` (+86 -11) 📝 `src/db/models/collection.rs` (+10 -2) 📝 `src/db/models/folder.rs` (+43 -2) 📝 `src/db/models/mod.rs` (+1 -1) 📝 `src/db/models/organization.rs` (+1 -1) 📝 `src/db/schema.rs` (+11 -3) </details> ### 📄 Description This is very much work in progress, definitely not ready to be pulled yet - does not even compile at the moment. I'm just putting it out there to see your thoughts about this. I took your migration script from #10 and made an attempt at decoupling the users from the ciphers. I went a bit further and removed user_uuid from cipher completely - we can manage that ownership in the `users_ciphers` table. That also means that the folder_uuid in that table might be `null` in case the cipher is not in any folder. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2025-10-09 18:32:41 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#3923