flutter_mfa_platform_interface
The platform interface behind the flutter_mfa secure vault. App developers should depend on flutter_mfa. Implement this interface only to add a new vault backend.
Status: v0.2.0, the first public release. Until 1.0, a minor version may change the API; the CHANGELOG says what changed.
Built and maintained by BreaktroughF1 LLP in collaboration with ARDC, CHRIST (Deemed to be University). MIT licensed.
Security model and design: see the project docs.
Implementing a vault
Extend MfaPlatform and register your instance with MfaPlatform.instance = …. The contract is in 03_API_SPEC.md §2. In short:
- A byte vault, nothing more. Store and return opaque bytes per key; no OTP logic, JSON or validation (that lives in
flutter_mfa_core). - Fail closed. Unknown platform state throws a typed
VaultException. Never store at a weakerProtectionLevelthan requested: throwVaultHardwareUnavailableinstead. - Buffers belong to the caller.
readreturns a new, modifiable buffer, which the caller overwrites after use. - No logging of keys, values or platform error messages, which may echo inputs.
package:flutter_mfa_platform_interface/testing.dartprovidesInMemoryMfaPlatformwith failure injection for tests.
Libraries
- flutter_mfa_platform_interface
- Platform interface for the flutter_mfa secure vault.
- testing
- Test helpers for flutter_mfa: an in-memory, insecure MfaPlatform with configurable capabilities and injectable failures.