Closed overheadhunter closed 4 weeks ago
The recent changes introduce a UserData
class in the frontend, centralizing user data management and key handling. This class provides methods for fetching user information, creating browser keys, and decrypting user keys. The frontend components have been refactored to utilize this new class instead of directly interacting with the backend. Additionally, the backend has been updated to use more specific cryptographic key names, enhancing clarity and security.
Files/Paths | Change Summaries |
---|---|
frontend/src/common/userdata.ts |
Introduced UserData class for managing user data and keys, added several methods for key operations. |
frontend/src/components/VaultDetails.vue |
Refactored to use UserData for fetching user data and decrypting user keys. |
frontend/src/components/CreateVault.vue |
Updated to retrieve user's ECDH public key from UserData instead of directly from the backend. |
frontend/src/components/RecoverVaultDialog.vue |
Changed to use UserData for accessing the ECDH public key during vault recovery. |
backend/src/main/java/.../UsersResource.java |
Renamed cryptographic key variables and updated method calls accordingly. Added updateDevices method. |
In code's vast realm, a rabbit hops with glee,
Refactoring keys with utmost clarity.
FromUserData
springs a new dawn,
Where vaults are safe and secrets drawn.
Backend whispers, "ECDH, ECDSA,"
While frontend dances, simplifying the way.
Together they weave a secure, bright day. π
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
This PR has changes in three areas:
user.privatekeys
anddevice.user_privatekeys
; just renamed those).userdata.ts
, it adds a new facade object to the frontend. The purpose of this object is to channel all requests to/api/me
as well as access to user keys and browser keys through a single place. This not only deduplicates some code and allows us to memoize seldom changing objects, it also makes sure we have a single entry point to inspect and interact with the user's key material.One of the sequence diagrams generated by coderabbit was actually quite good. I fetched it from its edit history: