n8n
Version:
n8n Workflow Automation Tool
28 lines (27 loc) • 1.09 kB
TypeScript
import type { ListEncryptionKeysQueryDto } from '@n8n/api-types';
import { DeploymentKeyRepository, type DeploymentKey } from '@n8n/db';
import { Cipher, type CipherAlgorithm } from 'n8n-core';
type KeyInfo = {
id: string;
value: string;
algorithm: string;
};
export declare class KeyManagerService {
private readonly deploymentKeyRepository;
private readonly cipher;
constructor(deploymentKeyRepository: DeploymentKeyRepository, cipher: Cipher);
getActiveKey(): Promise<KeyInfo>;
getKeyById(id: string): Promise<KeyInfo | null>;
getLegacyKey(): Promise<KeyInfo>;
bootstrapLegacyCbcKey(instanceEncryptionKey: string): Promise<void>;
bootstrapGcmKey(): Promise<void>;
listKeys(query: ListEncryptionKeysQueryDto): Promise<{
items: DeploymentKey[];
count: number;
}>;
rotateKey(): Promise<DeploymentKey>;
addKey(plaintextValue: string, algorithm: CipherAlgorithm, setAsActive?: boolean): Promise<DeploymentKey>;
setActiveKey(id: string): Promise<void>;
markInactive(id: string): Promise<void>;
}
export {};