Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/core / / SecretsStore

Interface: SecretsStore

Defined in: packages/core/src/contracts/secrets-store.ts:43

Pluggable secret-managing storage. Concrete implementations live in @graphorin/security (KeyringSecretsStore, EncryptedFileSecretsStore, EnvSecretsStore, MemorySecretsStore).

The interface is intentionally narrow: every method either returns a SecretValue or a piece of metadata that is safe to log. The raw value is never returned as a string from this surface.

Stable

Methods

delete()

ts
delete(key, scope?): Promise<void>;

Defined in: packages/core/src/contracts/secrets-store.ts:60

Parameters

ParameterType
keystring
scope?SessionScope

Returns

Promise&lt;void&gt;


get()

ts
get(key, scope?): Promise<SecretValue | null>;

Defined in: packages/core/src/contracts/secrets-store.ts:45

Returns the secret if it exists, null otherwise.

Parameters

ParameterType
keystring
scope?SessionScope

Returns

Promise&lt;SecretValue | null&gt;


list()

ts
list(scope?): Promise<readonly SecretMetadata[]>;

Defined in: packages/core/src/contracts/secrets-store.ts:63

Returns metadata about every key — never the values themselves.

Parameters

ParameterType
scope?SessionScope

Returns

Promise&lt;readonly SecretMetadata[]&gt;


require()

ts
require(key, scope?): Promise<SecretValue>;

Defined in: packages/core/src/contracts/secrets-store.ts:52

Returns the secret or throws. Implementations enforce the per-tool secretsAllowed ACL: if the current tool context disallows key, throw SecretAccessDeniedError.

Parameters

ParameterType
keystring
scope?SessionScope

Returns

Promise&lt;SecretValue&gt;


set()

ts
set(
   key, 
   value, 
opts?): Promise<void>;

Defined in: packages/core/src/contracts/secrets-store.ts:58

Persist a secret. Implementations auto-wrap a plain string into a SecretValue so callers don't have to.

Parameters

ParameterType
keystring
value| string | SecretValue
opts?SecretsSetOptions

Returns

Promise&lt;void&gt;