Skip to content

[Task][Web] Add automatic LOCK timeout setting #141

Description

@miso-develop

Parent spec

#137

Decision dependency

Owner

  • ACTIVE_ROLE: implementation
  • DOMAIN: web

State

INTEGRATED

Objective

Add the Web-side configuration surface for the automatic LOCK policy defined by #138 and implement the Web-canonical Vault Format 1 -> Format 2 migration/synchronization contract required for that setting.

Final functional contract from #138

  • Feature is optional.
  • Unset/absent = disabled = unlimited continuous UNLOCKED lifetime.
  • Enabled value is an integer number of days from 1 through 31.
  • No hour/minute settings.
  • When enabling with no prior enabled value, the UI selector starts at 1 day.
  • 1 day is not the global default: until explicitly enabled/saved, effective behavior remains disabled/unlimited.
  • Active-session changes apply against the original UNLOCKED start time; they do not start a fresh lifetime.

Vault compatibility / migration contract

  • Continue to read/decrypt canonical Vault Format 1 and new Vault Format 2.
  • Format-1 decode maps auto_lock_days to unset/disabled.
  • New canonical generations created by a Format-2-capable Web mutation use Vault Format 2.
  • Format 2 layout/AAD is exactly defined by [Decision] Define configurable automatic-lock semantics #138.
  • Before migrating/sending Format 2, Device hello must explicitly advertise supported_vault_formats containing 2.
  • Absence of that capability is treated conservatively as no proven Format-2 write support; do not send Format 2 to shipped v0.1.0 firmware.
  • Format-1 -> Format-2 migration preserves vault_id and VMK, increments generation as an ordinary canonical mutation, uses a fresh random nonce, and uses the existing browser transaction journal / exact Device reconciliation path.
  • Reconciliation must compare Vault format in addition to vault_id and generation.
  • Once canonical state is Format 2, ordinary Format-2 -> Format-1 downgrade is not offered or generated.
  • Recovery Package version remains 1; new Web accepts packages carrying Vault Format 1 or 2 and exports Format-2 canonical state with explicit vaultFormatVersion = 2.
  • A Format-1 Recovery Package maps auto-lock to disabled until a Format-2 canonical mutation occurs.
  • VMK wrap version remains 1; Vault-format migration alone does not require Passphrase entry, VMK rotation, or new physical confirmation.

Scope

  • Add an enable/disable control for automatic LOCK under the appropriate Settings surface.
  • When disabled/unset, clearly communicate that no automatic maximum UNLOCKED lifetime is configured.
  • When enabled, allow selection of whole days 1..31 inclusive.
  • If enabling with no previously stored valid value, initialize the selector to 1 day.
  • Validate before attempting a canonical update.
  • Extend logical Vault model/codec/crypto support to read Format 1 and Format 2 and write Format 2 per [Decision] Define configurable automatic-lock semantics #138.
  • Implement capability-gated V1 -> V2 canonical migration inside the existing authenticated generation transaction.
  • Persist/synchronize the optional setting through the authenticated encrypted canonical Vault generation/update path; do not add a separate settings side channel.
  • Keep browser canonical / Recovery Package Vault-format metadata consistent with the active envelope.
  • Show the currently effective configured state/value without exposing secret material.

Acceptance criteria

  • Existing v0.1.0 Browser canonical/Recovery Format-1 state can be read without destructive migration and maps to disabled/unlimited.
  • Existing v0.1.0 Device that does not advertise Format 2 is never sent a Format-2 candidate.
  • New Device firmware advertising [1,2] can receive a Web-created Format-2 canonical generation.
  • Format-1 -> Format-2 migration uses same VMK/vault_id, generation+1, fresh nonce, and existing transaction journal/reconciliation semantics.
  • Pending/reconciled exact identity includes Vault format; format mismatch is not reported as successful exact reconciliation.
  • New canonical writes after migration remain Format 2; Web does not ordinary-downgrade to Format 1.
  • Recovery Package v1 import supports Vault Format 1 and 2; unknown newer formats fail closed.
  • Recovery Package export for current Format-2 state identifies Vault Format 2 consistently.
  • Newly provisioned state is disabled/unlimited until explicitly enabled/saved.
  • Enabling an unset option presents 1 day initially.
  • Only integer values 1..31 can be saved while enabled.
  • No hour/minute configuration is offered.
  • Disabling persists absence/null semantics in Format 2 rather than an invalid numeric sentinel.
  • Saving uses the existing authenticated/canonical generation update path rather than an ad-hoc side channel.
  • Successful save is reflected in Web and Device state according to [Decision] Define configurable automatic-lock semantics #138.
  • If a shorter limit applied to the current session is already expired, UI correctly handles the Device immediately transitioning to LOCKED after successful application.
  • Failed/ambiguous writes do not falsely report success, prematurely change the canonical setting, or silently diverge from Device state.
  • Disabled mode, 1-day, 31-day, invalid values, enable/disable, reconnect, refresh, Format-1 migration, Device capability absence, Recovery Package F1/F2, and reconciliation are covered by tests.
  • Japanese/English localization introduced by [Task][Web] Add Japanese localization, usage guide, and navigation/layout refinements #142 covers this setting and its explanatory text.
  • No plaintext TOTP secret, Passphrase, VMK, session key, Recovery Package, or other key material is added to browser persistence/logging.

Security constraints

  • Preserve active Trusted Browser ownership, generation conflict handling, browser journal, exact reconciliation, and transactional canonical update semantics.
  • Do not weaken physical-confirmation or unlock requirements.
  • No runtime remote dependencies or analytics.
  • Do not represent disabled mode using a numeric value such as 0.
  • Do not persist auto_lock_days outside the authenticated encrypted Vault.
  • Do not claim v0.1.0 Web/firmware rollback compatibility after canonical state has migrated to Vault Format 2; older clients must fail closed.

Out of scope

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions