1.4 KiB
1.4 KiB
ADR 0004: Device Auth Persistence Port Ownership
Status
Accepted
Context
Device authentication persists long-lived key material and runtime JWT/backoff state. The bytes are meaningful only to the authentication policy, but the storage location also needs legacy migration names and must stay off the generic platform key/value API at upper layers.
Decision
platformowns only opaque blob key/value primitives and NVS mechanics.domainowns the narrow auth persistence port: the public auth record slot enum, mapping to storage namespaces/keys, legacy migration target names, and atomic load/save adapter.control_planeowns the serialized auth key/state schemas, challenge/response policy, JWT refresh policy, retry/backoff state transitions, and factory rotation behavior.- Upper layers must not call generic storage adapters for auth records. They
must use
domain_runtime_auth_store_load_record()anddomain_runtime_auth_store_save_record().
Consequences
- Auth persistence has one facade declaration without exposing platform storage
types to
control_plane. - Changing the serialized record layout remains a
control_planemigration concern. - Changing NVS namespace/key migration names remains a
domainadapter concern. - A future secure-element or encrypted-storage backend can replace the platform blob primitive without changing auth policy contracts.