OZInMemoryStorageAdapter

public final actor OZInMemoryStorageAdapter : OZStorageAdapter
extension OZInMemoryStorageAdapter: Equatable
extension OZInMemoryStorageAdapter: Hashable

In-memory storage adapter for credentials and sessions.

Stores all data in memory and does not persist across application restarts. Thread-safe via Swift Concurrency actor isolation.

Use OZKeychainStorageAdapter for persistent encrypted storage on Apple platforms (Keychain Services), or OZUserDefaultsStorageAdapter for non-sensitive metadata.

All OZInMemoryStorageAdapter instances are considered equal because two freshly-created instances are functionally identical (both empty), so they are interchangeable as default values in configuration data structures.

Example:

let storage = OZInMemoryStorageAdapter()
let credential = OZStoredCredential(...)
try await storage.save(credential: credential)

Important

Not persistent and not secure. Data is held in process memory only, is lost on application termination, and is not encrypted at rest. Suitable for tests and ephemeral demos. Production applications must supply a persistent, encrypted storage adapter (for example a Keychain-backed implementation on Apple platforms).