cryptomator / hub

Cryptomator Hub helps you manage vaults in large teams
GNU Affero General Public License v3.0
36 stars 8 forks source link

Audit Logging #192

Closed overheadhunter closed 1 year ago

overheadhunter commented 1 year ago

Proposed events to be added:

export type AuditEventDto = {
  id: number;
  timestamp: Date;
  type: 'CREATE_VAULT' | 'UNLOCK_VAULT' | 'UPDATE_VAULT_MEMBERSHIP';
}

export type CreateVaultEventDto = AuditEventDto & {
  userId: string;
  vaultId: string;
}

export type UnlockVaultEventDto = AuditEventDto & {
  userId: string;
  vaultId: string;
  deviceId: string;
  result: 'SUCCESS' | 'UNAUTHORIZED';
}

export type UpdateVaultMembershipEventDto = AuditEventDto & {
  userId: string;
  vaultId: string;
  authorityId: string;
  operation: 'ADD' | 'REMOVE';
}

Frontend should resolve IDs separately to avoid a single large query. This requires new backend APIs for resolving multiple IDs per resource type at once.