@confluentinc/schemaregistry
Version:
Node.js client for Confluent Schema Registry
40 lines (39 loc) • 1.1 kB
TypeScript
/**
* Key management service (KMS) driver.
*/
export interface KmsDriver {
getKeyUrlPrefix(): string;
newKmsClient(config: Map<string, string>, keyUrl: string): KmsClient;
}
/**
* Key management service (KMS) client.
*/
export interface KmsClient {
supported(keyUri: string): boolean;
encrypt(plaintext: Buffer): Promise<Buffer>;
decrypt(ciphertext: Buffer): Promise<Buffer>;
}
/**
* Register a KMS driver.
* @param kmsDriver - the KMS driver to register
*/
export declare function registerKmsDriver(kmsDriver: KmsDriver): void;
/**
* Get the KMS driver for the given key URL.
* @param keyUrl - the key URL
*/
export declare function getKmsDriver(keyUrl: string): KmsDriver;
/**
* Register a KMS client.
* @param kmsClient - the KMS client to register
*/
export declare function registerKmsClient(kmsClient: KmsClient): void;
/**
* Get the KMS client for the given key URL.
* @param keyUrl - the key URL
*/
export declare function getKmsClient(keyUrl: string): KmsClient | null;
/**
* Clear the KMS clients.
*/
export declare function clearKmsClients(): void;