OZInMemoryStorageAdapter class

In-memory storage adapter for credentials and sessions.

Stores all data in a Dart-isolate-local map and does not persist across application restarts. Concurrent calls are serialised through an internal Future-based lock so that interleaved reads and writes never observe a partially-applied update.

All OZInMemoryStorageAdapter instances compare equal because two freshly-created instances are functionally identical (both empty); this makes the adapter usable as a default value of an enclosing data class without breaking that data class's structural equality.

Security: this adapter is not secure and stores credential public-key bytes and session metadata in plain process memory. Suitable only for testing and development. Production apps must supply a platform-backed secure storage adapter (for example a Keychain-backed implementation on Apple platforms or an EncryptedSharedPreferences-backed implementation on Android) via OZSmartAccountConfig.storage.

Implemented types

Constructors

OZInMemoryStorageAdapter()

Properties

hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() Future<void>
Throws SmartAccountStorageWriteFailed if clearing fails.
override
clearSession() Future<void>
Throws SmartAccountStorageWriteFailed if clearing fails.
override
delete(String credentialId) Future<void>
Silently no-ops if no credential with credentialId exists.
override
get(String credentialId) Future<OZStoredCredential?>
Returns null if not found. Throws SmartAccountStorageReadFailed if reading fails.
override
getAll() Future<List<OZStoredCredential>>
Throws SmartAccountStorageReadFailed if reading fails.
override
getByContract(String contractId) Future<List<OZStoredCredential>>
Returns an empty list when no credentials match.
override
getSession() Future<OZStoredSession?>
Returns null when no session exists or when the saved session has already expired; an expired session is auto-cleared so callers always observe "valid session or none". Throws SmartAccountStorageReadFailed if reading fails.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save(OZStoredCredential credential) Future<void>
Throws SmartAccountStorageWriteFailed if persistence fails.
override
saveSession(OZStoredSession session) Future<void>
Throws SmartAccountStorageWriteFailed if saving fails.
override
toString() String
A string representation of this object.
inherited
update(String credentialId, OZStoredCredentialUpdate updates) Future<void>
Throws SmartAccountCredentialNotFound if no credential with credentialId exists. Throws SmartAccountStorageWriteFailed if persistence fails.
override

Operators

operator ==(Object other) bool
The equality operator.
override