LaunchBoxContributors
On this page

IPluginSecretStore14.1

Interface in Unbroken.LaunchBox.Plugins.Services.Storage

C#
public interface IPluginSecretStore
Provides protected persistent storage scoped to the requesting plugin and current machine.

Remarks

Protected values may become unreadable after an operating-system or machine migration. Plugins should store only reacquirable secrets here and treat an unavailable value as requiring reconnection.

Methods

GetValueAsync

C#
Task<byte[]?> GetValueAsync(
    PluginSecretStoreGetRequest request,
    CancellationToken cancellationToken
)
Gets the requested protected value, or null when no value exists.
request
The plugin-local key identifying the protected value.
cancellationToken
A token requesting cancellation of the operation.

Returns

The unprotected bytes, or null when the key has no value.
Exception: InvalidDataException
The saved payload is invalid or cannot be unprotected on this machine. The stored bytes are retained.

RemoveValueAsync

C#
Task RemoveValueAsync(
    PluginSecretStoreRemoveRequest request,
    CancellationToken cancellationToken
)
Removes the requested protected value.
request
The plugin-local key identifying the protected value to remove.
cancellationToken
A token requesting cancellation of the operation.

Returns

A task representing the removal operation.

SetValueAsync

C#
Task SetValueAsync(
    PluginSecretStoreSetRequest request,
    CancellationToken cancellationToken
)
Protects and stores the requested value.
request
The plugin-local key and unprotected bytes to protect and persist.
cancellationToken
A token requesting cancellation of the operation.

Returns

A task representing the storage operation.