refactor(core): describe secret storage as a SecretStore interface (P1.2)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user