refactor(core): describe secret storage as a SecretStore interface (P1.2)

This commit is contained in:
shumeiko.it
2026-10-24 12:07:42 +02:00
parent 815c667374
commit cb51ed0d28
3 changed files with 37 additions and 7 deletions

View File

@@ -12,6 +12,7 @@ import * as fs from 'node:fs';
import * as path from 'node:path';
import { execFileSync } from 'node:child_process';
import { createCoreLogger } from './logger.js';
import type { SecretEntry, SecretStore } from './secret-store.js';
const log = createCoreLogger('vault');
const ALGORITHM = 'aes-256-gcm';
@@ -25,12 +26,7 @@ const IV_LENGTH = 16;
*/
const windowsKeyAclChecked = new Set<string>();
export interface VaultEntry {
name: string;
value: string;
metadata?: Record<string, unknown>;
updatedAt: string;
}
export type VaultEntry = SecretEntry;
interface VaultRecord {
encrypted: string;
@@ -46,7 +42,8 @@ interface ConnectorCredentialInput {
scopes?: string[];
}
export class VaultStore {
/** The file-backed SecretStore. */
export class VaultStore implements SecretStore {
private dataDir: string;
private vaultPath: string;
private keyPath: string;