feat: share credentials with users and roles, inherit data on account deletion (#1342)

* feat: share credentials with users and roles, inherit data on account deletion

Credentials can be shared at "use" or "manage" level. Recipients get
a copy re-encrypted under their own data key (shared_credential_secrets),
kept in step with the owner's row through the same lifecycle hooks as
shared host secrets. One gate, findUsableCredential(), replaces the
private-namespace lookups so a shared credential works wherever a
private one does. Deleting a user now hands their hosts and credentials
to a successor (the deleting admin by default) instead of revoking
everything they shared.

* fix: harden credential ownership transfer
This commit is contained in:
ZacharyZcR
2026-08-25 04:12:47 +08:00
committed by GitHub
parent 5f55289e00
commit 82143946c7
41 changed files with 30051 additions and 59 deletions
+30
View File
@@ -114,6 +114,32 @@
"cloneCredentialAction": "Clone credential",
"clonedCredential": "Cloned {{name}}",
"clonedCredentialName": "{{name}} (copy)",
"shareCredentialAction": "Share credential",
"sharedBadge": "shared",
"sharedBy": "Shared by {{owner}}",
"share": {
"title": "Share \"{{name}}\"",
"description": "Recipients get their own encrypted copy of the secrets. It is refreshed whenever the credential changes and removed when the share is revoked.",
"users": "Users",
"roles": "Roles",
"searchPlaceholder": "Search...",
"permission": "Permission",
"levelUse": "Use",
"levelManage": "Manage",
"levelUseDesc": "Use: attach the credential to hosts and connect. The secret itself stays hidden.",
"levelManageDesc": "Manage: also edit the credential and share it with others.",
"expires": "Expires",
"expiry": {
"never": "Never",
"oneDay": "1 day",
"sevenDays": "7 days",
"thirtyDays": "30 days"
},
"currentAccess": "Shared with",
"revoke": "Revoke",
"shared": "Credential shared",
"shareButton": "Share"
},
"deleteCredentialAction": "Delete credential",
"editCredentialAction": "Edit credential",
"failedToCloneCredential": "Failed to clone credential",
@@ -3653,6 +3679,10 @@
"snippetDeletedSuccess": "Snippet deleted",
"snippetDeleteFailed": "Failed to delete snippet",
"noSessionsForUser": "No active sessions",
"deleteSuccessorLabel": "Hand over hosts and credentials to",
"deleteSuccessorMe": "Me (the deleting admin)",
"deleteSuccessorNone": "Nobody — delete them",
"deleteSuccessorDesc": "Everything this user shared keeps working under the new owner; choosing nobody removes their hosts, credentials and shares.",
"deleteUserDangerDesc": "Permanently delete {{username}} and all of their data (hosts, credentials, snippets, history). This cannot be undone.",
"deleteUserConfirm": "Permanently delete {{username}} and all of their data?",
"deleteUserAdminBlocked": "Remove admin status before deleting this user.",