Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/security / / MemorySecretsStore

Class: MemorySecretsStore

Defined in: packages/security/src/secrets/stores/memory.ts:22

In-memory SecretsStore for tests. Refuses to start in production mode unless explicitly opted in.

Stable

Implements

Constructors

Constructor

ts
new MemorySecretsStore(opts?): MemorySecretsStore;

Defined in: packages/security/src/secrets/stores/memory.ts:27

Parameters

ParameterType
opts{ forceProduction?: boolean; }
opts.forceProduction?boolean

Returns

MemorySecretsStore

Properties

PropertyModifierTypeDescriptionDefined in
kindreadonly"memory"Stable identifier — surfaced in getSecretsStoreStatus().packages/security/src/secrets/stores/memory.ts:24

Accessors

size

Get Signature

ts
get size(): number;

Defined in: packages/security/src/secrets/stores/memory.ts:34

Whether this store has any keys at all.

Returns

number

Methods

delete()

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

Defined in: packages/security/src/secrets/stores/memory.ts:82

Parameters

ParameterType
keystring
scope?SessionScope

Returns

Promise&lt;void&gt;

Implementation of

SecretsStore.delete


get()

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

Defined in: packages/security/src/secrets/stores/memory.ts:38

Returns the secret if it exists, null otherwise.

Parameters

ParameterType
keystring
scope?SessionScope

Returns

Promise&lt;SecretValue | null&gt;

Implementation of

SecretsStore.get


list()

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

Defined in: packages/security/src/secrets/stores/memory.ts:88

Returns metadata about every key — never the values themselves.

Parameters

ParameterType
scope?SessionScope

Returns

Promise&lt;readonly SecretMetadata[]&gt;

Implementation of

SecretsStore.list


require()

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

Defined in: packages/security/src/secrets/stores/memory.ts:50

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;

Implementation of

SecretsStore.require


set()

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

Defined in: packages/security/src/secrets/stores/memory.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
optsSecretsSetOptions

Returns

Promise&lt;void&gt;

Implementation of

SecretsStore.set