OathConfiguration
public final class OathConfiguration : @unchecked Sendable
Configuration class specific for OATH MFA functionality. Extends the base configuration with OATH-specific settings.
Example usage:
let config = OathConfiguration.build { config in
config.storage = OathKeychainStorage()
config.enableCredentialCache = false
config.logger = customLogger
}
-
The storage implementation to use for OATH credentials. If nil, a default OathKeychainStorage will be used.
Declaration
Swift
public var storage: (any OathStorage)? -
The policy evaluator to use for credential policy validation. If nil, default policies will be used.
Declaration
Swift
public var policyEvaluator: MfaPolicyEvaluator? -
Whether data encryption is enabled for storage. Defaults to true for enhanced security.
Declaration
Swift
public var encryptionEnabled: Bool -
The timeout for network operations in seconds. Defaults to 15.0 seconds.
Declaration
Swift
public var timeoutMs: TimeInterval -
Whether to enable in-memory caching of credentials. By default, this is disabled for security reasons, as an attacker could potentially access cached credentials from memory dumps.
Declaration
Swift
public var enableCredentialCache: Bool -
The logger instance used for logging messages. If nil, no logging will be performed.
Declaration
Swift
public var logger: Logger
-
Creates a new OATH configuration with default values.
Declaration
Swift
public init()
-
Creates a new instance of OathConfiguration with the provided configuration block.
Example usage:
let config = OathConfiguration.build { config in config.storage = MyOathStorage() config.enableCredentialCache = false }Declaration
Swift
public static func build(_ configure: (OathConfiguration) -> Void) -> OathConfigurationParameters
configureA closure that configures the OathConfiguration instance.
Return Value
A configured OathConfiguration instance.
View on GitHub