DesktopSecretStoreOptions record

Namespace Runic.Platform in Runic.Platform 0.23.0

public sealed record DesktopSecretStoreOptions : IEquatable<DesktopSecretStoreOptions>

Inherits or implements IEquatable.

Store-wide choices for an IDesktopSecretStore.

Remarks

A store keeps no native resources between requests, so an application creates one store per set of options. Every option keeps today's behaviour at its default.

Constructors

DesktopSecretStoreOptions

public DesktopSecretStoreOptions()

No documentation.

Properties

AllowUserInteraction

public bool AllowUserInteraction { get; init; }

Whether a request may wait while the store asks the user to unlock it or to allow access. Defaults to true.

Remarks

With false, a request that would need such a prompt fails with PlatformFailureCode.Locked instead, as a background refresh wants. On Linux the Secret Service prompt is dismissed unshown; the Secret portal has no such flag and may still ask once to unlock the login keyring. On macOS the keychain query does not allow authentication UI. Windows Credential Manager never prompts.

RequireEncryption

public bool RequireEncryption { get; init; }

Whether a secret must cross process boundaries encrypted.

Remarks

On Linux the Secret Service session must be dh-ietf1024-sha256-aes128-cbc-pkcs7: a service without it fails requests with PlatformFailureCode.Other and the secret-service-encryption-required diagnostic instead of using a plain session, which only processes of the same user can observe. Set it when the application knows its users' providers support the algorithm, as GNOME Keyring and KeePassXC do. No effect on Windows and macOS, whose stores transfer nothing in the clear.

UseDataProtectionKeychain

public bool UseDataProtectionKeychain { get; init; }

Whether macOS stores the secrets in the data-protection keychain instead of the file-based login keychain.

Remarks

A shipped application signs its bundle with a team ID and the keychain-access-groups entitlement for the data-protection keychain. Without it macOS may answer a read with nothing stored, and refuses a write with PlatformFailureCode.PermissionDenied and an OSStatus -34018 diagnostic that names the entitlement. Items of the file-based keychain are not migrated: read them with a store without this option and write them with one that has it. No effect on Linux and Windows.