credentialVault.ts 1.5 KB

123456789101112131415161718192021222324252627
  1. /** Public metadata only. Passwords, private keys and unlock material never belong here. */
  2. export const CREDENTIAL_VAULT_PROTOCOL = 1
  3. export type CredentialTarget =
  4. | { kind: 'website'; origin: string }
  5. | { kind: 'ssh'; host: string; port: number; hostKey: string }
  6. export type CredentialOperation = 'website.login' | 'ssh.exec' | 'sftp.read' | 'sftp.write'
  7. export type CredentialUseSummary =
  8. | { kind:'website.form';loginPath:string;submitPath:string;successPath:string;logoutPath?:string;formId:string;usernameName:string;passwordName:string;successSelector:string }
  9. | { kind:'ssh.exec';command:string }
  10. | { kind:'sftp.read';remotePath:string;maxBytes:number }
  11. | { kind:'sftp.write';remotePath:string;bytes:number }
  12. export interface CredentialSummary {
  13. id: string; name: string; username: string; target: CredentialTarget
  14. revision: number; updatedAt: number
  15. usage?: CredentialUseSummary
  16. }
  17. export interface CredentialLeaseSummary {
  18. id: string; credentialRef: string; agentId: string; workId: string
  19. runnerId: string; operation: CredentialOperation; expiresAt: number
  20. }
  21. export interface CredentialVaultStatus {
  22. protocol: 1; online: boolean; initialized: boolean; unlocked: boolean
  23. unlockExpiresAt?: number
  24. storageMode?: 'local'
  25. execution: 'disabled' | 'dummy-fixture' | 'protected-adapters'; reason: 'executor_not_enabled' | 'vault_offline' | 'dummy_fixture_only' | 'operator_approved' | 'isolation_required'
  26. entries: CredentialSummary[]; leases: CredentialLeaseSummary[]
  27. }