@secret-kernel/core
v0.1.0-alpha.7
Published
Shared Secret Kernel implementation: name resolution, parsing, caching and the reader-backed client.
Downloads
81
Maintainers
Readme
@secret-kernel/core
Shared implementation for Secret Kernel: name resolution, parsing, option normalization, the in-memory cache and the reader-backed client every provider extends.
Install this package when you write a provider, or when a provider you install declares it. Applications normally get it transitively.
npm install @secret-kernel/coreUsage
Most consumers never import it directly. Provider authors do:
import { ReaderBackedSecretClient, resolveSecretFullName } from '@secret-kernel/core';
import type {
SecretProviderReader,
SecretProviderValue,
SecretClientOptions,
} from '@secret-kernel/contracts';
class MyReader implements SecretProviderReader {
async readSecret(fullName: string, secretName: string): Promise<SecretProviderValue> {
return { value: await myBackend.get(fullName) };
}
async close(): Promise<void> {}
}
export class MySecretsClient extends ReaderBackedSecretClient {
static readonly providerName = 'my-backend';
constructor(commonOptions: SecretClientOptions, providerOptions?: MyOptions) {
super(new MyReader(providerOptions), commonOptions);
}
}The reader answers with a decrypted string. Caching, parsing, name resolution and observability are kernel behavior and stay in this package, so every provider inherits them unchanged.
Documentation
The normative public surface is in
docs/secret-kernel-api-reference.md.
