Class MockCredentialStore

Credential-store mock with deterministic forced-status hooks.

class MockCredentialStore
  : CredentialStore;

Normal operations delegate to MemoryCredentialStore. Tests can force one operation class to return statuses such as locked, unavailable, or backendFailure without invoking the corresponding plaintext callback.

Constructors

NameDescription
this (credentialNamespace)

Fields

NameTypeDescription
forcedRemoveStatus CredentialStatus
forcedSaveStatus CredentialStatus
forcedUpdateStatus CredentialStatus
forcedWithSecretStatus CredentialStatus

Properties

NameTypeDescription
capabilities[get] StoreCapabilitiesDescribe how this store behaves.
credentialNamespace[get] CredentialNamespaceApplication namespace this store belongs to.

Methods

NameDescription
clearAll () Promptly wipe all records retained by the underlying memory backend.
remove (handle) Remove a saved credential.
save (secret, handle) Save a new credential.
update (handle, replacement) Replace the value of an existing credential.
withSecret (handle, callback) Use a saved credential.