IPluginSecretStore14.1
Interface in Unbroken.LaunchBox.Plugins.Services.Storage
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
GetValueAsyncGets the requested protected value, or null when no value exists.RemoveValueAsyncRemoves the requested protected value.SetValueAsyncProtects and stores the requested value.
GetValueAsync
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, ornull 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
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
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.