Skip to content

feat(extension): chosen idle lock delay, several accounts, fingerprint or face unlock - #921

Merged
rubenvdlinde merged 13 commits into
developmentfrom
feat/clients-extension-unlock-lock-and-accounts
Oct 2, 2026
Merged

rubenvdlinde merged 13 commits into
developmentfrom
feat/clients-extension-unlock-lock-and-accounts

Conversation

@rubenvdlinde

@rubenvdlinde rubenvdlinde commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Closes #784

Builds and archives the OpenSpec change clients-extension-unlock-lock-and-accounts: a chosen idle lock delay, several accounts, and fingerprint or face unlock in the browser extension.

Up to date with development. Lane L (#913, the policy on the save path) and lane C (#934, fill scope and Disconnect deleting the app password) changed the old service-worker.js. Both are carried into browser-extension/src/background/router.js, per account, and their tests (savePolicy.spec.js, unpair.spec.js) run against the new worker.

What changed

  • Idle lock delay. Each account picks 1, 5, 15, 30, 60 or 240 minutes in a new popup settings view. The worker reads GET /api/v1/extension/policy at every unlock and uses the shorter of the choice and the administrator maximum (extension_max_idle_minutes, default 240, new admin section "Browser extension"). If the policy cannot be read, the delay is capped at 15 minutes, so an unreachable server never lengthens it.
  • Several accounts. Up to five, stored as keepiq.accounts; the old keepiq.config becomes the first account on worker start. Each account has its own key, timer and match cache. The popup header switches accounts and shows lock state. OS lock locks all.
  • Fill isolation. A fill names its account and is refused unless the id came from the active account's own last match, and the tab is still on the matched site. The old fallback that fetched any secret id from the server on fill is gone.
  • Sender check. The worker accepts only capture-credential, capture-decision, webauthn-create and webauthn-get from a tab. Everything else (unlock, match, fill, save, settings, the raw-key unlock) needs one of the extension's own pages as sender. Before this, a content script could send any message.
  • Fingerprint or face unlock. A new unlock window enrols a platform passkey with PRF (extension origin as relying party, user verification required) and unlocks with it. The server stores only the wrapped unlock key, PRF salt and metadata. keepiq_passkey_credentials gains client_kind and rp_id (migration Version001007Date20261002180000, version 0.3.4-unstable.20261002180000); login options are scoped per client, so the web app never gets an extension credential and the reverse. The web passkey list labels extension credentials and revokes them as before.

Design note: the design names SessionTimeoutSection.vue for the admin field; that file does not exist, so the field is a new src/components/settings/ExtensionSection.vue.

Tests (red before, green after)

  • tests/extension/accounts.spec.js (30): through the worker's real router with real crypto and a fake server. Legacy upgrade, sixth pairing refused, per-account timers, admin maximum wins, cross-account fill refused with nothing decrypted, unoffered id refused without a fetch, fill refused after the tab moved, capture saved to the submit-time account, and 16 popup-only messages refused from a content script. On the old code a page sender could call fill, match, unlock and the rest.
  • tests/extension/biometricUnlock.spec.js (10): enrol and unlock against a fake PRF authenticator; the request carries no master password, raw key or PRF output; no raw key in storage; no PRF means no enrolment; unlock-raw from a page is refused.
  • tests/extension/popupAccounts.spec.js (4): the real popup against the real router (switcher, idle settings).
  • tests/Unit/Service/PasskeyServiceTest.php, tests/Unit/Controller/ExtensionControllerTest.php, tests/components/PasskeyManager.spec.js, tests/components/ExtensionSection.spec.js.
  • tests/extension/savePolicy.spec.js (lane L) is adapted to the per-account worker and still passes.

Owed

  • Live check: Playwright with the unpacked Chrome build and a virtual authenticator with PRF: pair, unlock, Settings, "Set up fingerprint or face unlock", lock, "Unlock with fingerprint or face" (task 3.3's verify).
  • Manual check (task 3.5): current Chrome, Edge and Firefox on a machine with Windows Hello or a fingerprint reader. Record which ones show the option in browser-extension/README.md. Firefox may refuse WebAuthn from a moz-extension:// page; the option then stays hidden.

checks: pending, coordinator runs check.sh

…ation

The renew-root endpoint had no caller, so an admin warned about the
root's expiry could not act on it. The CA health section now has a
renew root button that opens a confirmation dialog; only the confirm
posts, and the result names how many suites were signed again.
A controller test pins the admin-only posture of every CA write.

Fixes #741
The extension saved and updated logins without the strength floor or the
breach block that the web app applies. The rules now live in
src/policy/rules.js and src/health/hibpMatch.js, free of Nextcloud page
imports, and the extension bundles the same code. The worker reads the
same policy endpoint, refuses before encrypting, and the in-page bar
explains the refusal instead of offering a save.

Refs #746
…l page

The per-application lease-policy override had a PUT and no screen. A new
GET /api/v1/applications/{id}/lease-policy answers the policy in force,
the stored override and the instance values, for an admin or the
application's registrant (404 for anyone else). The leases panel now
shows a form: an admin saves the override, an empty field inherits the
instance value, and the registrant sees it read-only.

Refs #753
…e now expects

Development moved the range route to POST with the prefix in the body
(keepiq#866). The extension's new lookup follows it, with a test that
the prefix never appears in the URL.

Refs #746
…edentials

GET /api/v1/extension/policy returns the administrator's maximum idle lock
delay for the browser extension (default 240 minutes). Passkey credentials
gain client_kind and rp_id, and the login options are scoped to the asking
client, so the web app never gets an extension credential and the reverse.

Refs #784
…eck on worker messages

The extension holds up to five paired accounts, each with its own key, idle
timer and match cache. The old single pairing becomes the first account.
Matching, filling, the one-time code and saving use the active account, and
the worker refuses a fill whose id did not come from the active account's own
match for the current site. Only the four content-script messages are
accepted from a tab; everything else needs an extension page as sender.

The idle delay is per account, capped at the organisation maximum read at
each unlock.

Refs #784
…e delay settings

The unlock window enrols a platform passkey with PRF for one account (the
extension's own origin as relying party, user verification required) and
unlocks with it: the raw unlock key is unwrapped in the window and handed to
the worker, which imports the key and drops the bytes. The server gets only
the wrapped key, the PRF salt and the credential metadata. The option shows
only where a user-verifying platform authenticator exists.

The popup header switches between accounts and shows each one's lock state;
a settings view picks the idle delay, with delays above the organisation's
maximum shown as unavailable.

Refs #784
…web list; archive the change

The admin settings get a Browser extension section for the longest idle
delay users may pick. The web app's passkey list labels extension
credentials, which the owner revokes there as any other. The change
clients-extension-unlock-lock-and-accounts is archived: its spec deltas are
synced into openspec/specs and the parity rows clients-06, clients-21 and
crypto-09 are set to built.

Closes #784
expect(sixth.error).toContain('up to 5 accounts')
expect(await api.loadAccounts()).toHaveLength(5)
expect(
server.calls.some((c) => c.url.startsWith('https://cloud6.example')),
(c) => c.method === 'POST' && c.url.endsWith('/api/v1/secrets'),
)
expect(posts).toHaveLength(1)
expect(posts[0].url.startsWith(HOME)).toBe(true)
…accounts

Lane L (#913) landed as a squash, so its files conflicted with the copies
this branch carried: the lane L files take development's version, the
service worker and the save-policy test keep this branch's per-account
form, the l10n catalogues take development's and the new keys are applied
again, and the app version stays 0.3.4-unstable.20261002180000.
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/keepiq @ b63cd0f

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ❌
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
check-manifest ✅
test-l10n ✅
format ✅
check-l10n-js ✅
check-schema-l10n ✅
composer ✅ ✅ 114/114
npm ✅ ✅ 660/660
app:check-code ⏭️
info.xml ✅
REUSE ✅
lockfile sync ✅
PHPUnit ❌
Newman ✅
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ❌

Quality workflow — 2026-10-02 11:31 UTC

Download the full PDF report from the workflow artifacts.

…accounts

Lane C (#934) changed the old service worker: Disconnect now deletes the
app password, and the fill messages name the host so only frames of that
site fill. Both are carried into router.js for the account being
disconnected and the active account's match, and lane C's unpair test runs
against the per-account worker. The l10n catalogues take development's
version and this change's keys are applied again.
…xtension-unlock-lock-and-accounts

# Conflicts:
#	appinfo/info.xml
#	l10n/be.js
#	l10n/be.json
#	l10n/bg.js
#	l10n/bg.json
#	l10n/bs.js
#	l10n/bs.json
#	l10n/ca.js
#	l10n/ca.json
#	l10n/cs.js
#	l10n/cs.json
#	l10n/da.js
#	l10n/da.json
#	l10n/de.js
#	l10n/de.json
#	l10n/el.js
#	l10n/el.json
#	l10n/en.js
#	l10n/en.json
#	l10n/es.js
#	l10n/es.json
#	l10n/et.js
#	l10n/et.json
#	l10n/fi.js
#	l10n/fi.json
#	l10n/fr.js
#	l10n/fr.json
#	l10n/ga.js
#	l10n/ga.json
#	l10n/hr.js
#	l10n/hr.json
#	l10n/hu.js
#	l10n/hu.json
#	l10n/is.js
#	l10n/is.json
#	l10n/it.js
#	l10n/it.json
#	l10n/lb.js
#	l10n/lb.json
#	l10n/lt.js
#	l10n/lt.json
#	l10n/lv.js
#	l10n/lv.json
#	l10n/mk.js
#	l10n/mk.json
#	l10n/mt.js
#	l10n/mt.json
#	l10n/nb.js
#	l10n/nb.json
#	l10n/nl.js
#	l10n/nl.json
#	l10n/pl.js
#	l10n/pl.json
#	l10n/pt.js
#	l10n/pt.json
#	l10n/rm.js
#	l10n/rm.json
#	l10n/ro.js
#	l10n/ro.json
#	l10n/ru.js
#	l10n/ru.json
#	l10n/sk.js
#	l10n/sk.json
#	l10n/sl.js
#	l10n/sl.json
#	l10n/sq.js
#	l10n/sq.json
#	l10n/sr.js
#	l10n/sr.json
#	l10n/sv.js
#	l10n/sv.json
#	l10n/tr.js
#	l10n/tr.json
#	l10n/uk.js
#	l10n/uk.json
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/keepiq @ 74a9f53

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
check-manifest ✅
test-l10n ✅
format ✅
check-l10n-js ✅
check-schema-l10n ✅
composer ✅ ✅ 114/114
npm ✅ ✅ 660/660
app:check-code ⏭️
info.xml ✅
REUSE ✅
lockfile sync ✅
PHPUnit ❌
Newman ✅
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ✅

Quality workflow — 2026-10-02 13:43 UTC

Download the full PDF report from the workflow artifacts.

@rubenvdlinde

Copy link
Copy Markdown
Contributor Author

Local checks: full check on 37946fe had two findings on this branch's own lines (AdminSettingsService class complexity 51, a missing @SPEC); both fixed (reasoned suppression pointing at the #774 split, and the tag). After merging development (44041c5): PHPUnit 1661 tests OK, vitest 1300 of 1300, phpmd over lib (three rulesets) 0, phpstan 0, phpcs 0 errors, format, lint, test:l10n and check:l10n-js 0, gate-16 0, gate-25 2 of 2 new endpoints covered. Hydra gates otherwise 0 on the full check.

@rubenvdlinde
rubenvdlinde merged commit 7bd5288 into development Oct 2, 2026
44 of 49 checks passed
rubenvdlinde added a commit that referenced this pull request Oct 2, 2026
The extension's handlers moved to router.js (#921), so the use-only
match filter, fill refusal, owner report and save-prompt block move
there too. info.xml goes to 181000, past development's 180000.
rubenvdlinde added a commit that referenced this pull request Oct 2, 2026
The vault-policy refusal code (#910) moves into SecretUpdateController's
403; SecretController keeps forbidden() for create. SecretService takes
both the org ownership guard and the offline edit guard. The admin
settings keep the extension idle maximum (#921) and the offline switches.
The offline manifest test builds the service with the two-factor gate.
l10n takes development's catalogues with the offline keys applied again.
rubenvdlinde added a commit that referenced this pull request Oct 2, 2026
Version001008Date20261002181000, so it sorts after #921's migration.
rubenvdlinde added a commit that referenced this pull request Oct 2, 2026
…copy link for this session's sends

The extension bundles argon2-browser's WebAssembly (esbuild binary loader,
'wasm-unsafe-eval' in the extension CSP) and wraps a send's key under an
Argon2id key from the password, as the web app does. The load check now
opens the real action popup: the worker refuses popup.html opened as a
tab since #921, so the check failed on development too.
rubenvdlinde added a commit that referenced this pull request Oct 2, 2026
…k mode, locked use, password sends (#991)

* feat(generator): character classes, minimum digits and symbols, ambiguity, usernames

* feat(extension): Generator sub-tabs, usernames, history, remembered options, pick mode and use while locked

* test(extension): generator options, history lifetime and offline policy

* feat(extension): password-protected sends with the bundled Argon2id, copy link for this session's sends

The extension bundles argon2-browser's WebAssembly (esbuild binary loader,
'wasm-unsafe-eval' in the extension CSP) and wraps a send's key under an
Argon2id key from the password, as the web app does. The load check now
opens the real action popup: the worker refuses popup.html opened as a
tab since #921, so the check failed on development too.

* chore(extension): keep consent.html and unlock.html as they were (formatting only)

* chore(extension): keep popup.html's own formatting; only the new markup changes

* docs(openspec): clients-extension-complete, step 1
rubenvdlinde added a commit that referenced this pull request Oct 3, 2026
…#995)

* feat(generator): character classes, minimum digits and symbols, ambiguity, usernames

* feat(extension): Generator sub-tabs, usernames, history, remembered options, pick mode and use while locked

* test(extension): generator options, history lifetime and offline policy

* feat(extension): password-protected sends with the bundled Argon2id, copy link for this session's sends

The extension bundles argon2-browser's WebAssembly (esbuild binary loader,
'wasm-unsafe-eval' in the extension CSP) and wraps a send's key under an
Argon2id key from the password, as the web app does. The load check now
opens the real action popup: the worker refuses popup.html opened as a
tab since #921, so the check failed on development too.

* chore(extension): keep consent.html and unlock.html as they were (formatting only)

* chore(extension): keep popup.html's own formatting; only the new markup changes

* docs(openspec): clients-extension-complete, step 1

* feat(extension): item form rules, fresh item fetch, sparse saves, move and write-error messages

* feat(extension): item detail sections, the form for every kind of item, clone, move and the unsaved-changes guard

* feat(extension): folder manager with the server's delete protocol, and New folder in the picker

* style(extension): function declaration in the folder test

* style(extension): prettier on the folder manager spec
rubenvdlinde added a commit that referenced this pull request Oct 3, 2026
…997)

* feat(generator): character classes, minimum digits and symbols, ambiguity, usernames

* feat(extension): Generator sub-tabs, usernames, history, remembered options, pick mode and use while locked

* test(extension): generator options, history lifetime and offline policy

* feat(extension): password-protected sends with the bundled Argon2id, copy link for this session's sends

The extension bundles argon2-browser's WebAssembly (esbuild binary loader,
'wasm-unsafe-eval' in the extension CSP) and wraps a send's key under an
Argon2id key from the password, as the web app does. The load check now
opens the real action popup: the worker refuses popup.html opened as a
tab since #921, so the check failed on development too.

* chore(extension): keep consent.html and unlock.html as they were (formatting only)

* chore(extension): keep popup.html's own formatting; only the new markup changes

* docs(openspec): clients-extension-complete, step 1

* feat(extension): item form rules, fresh item fetch, sparse saves, move and write-error messages

* feat(extension): item detail sections, the form for every kind of item, clone, move and the unsaved-changes guard

* feat(extension): folder manager with the server's delete protocol, and New folder in the picker

* style(extension): function declaration in the folder test

* feat(extension): vault snapshot and sync, offline reads and autofill, writes off while offline
rubenvdlinde added a commit that referenced this pull request Oct 3, 2026
…ast tab and theme (#999)

* feat(generator): character classes, minimum digits and symbols, ambiguity, usernames

* feat(extension): Generator sub-tabs, usernames, history, remembered options, pick mode and use while locked

* test(extension): generator options, history lifetime and offline policy

* feat(extension): password-protected sends with the bundled Argon2id, copy link for this session's sends

The extension bundles argon2-browser's WebAssembly (esbuild binary loader,
'wasm-unsafe-eval' in the extension CSP) and wraps a send's key under an
Argon2id key from the password, as the web app does. The load check now
opens the real action popup: the worker refuses popup.html opened as a
tab since #921, so the check failed on development too.

* chore(extension): keep consent.html and unlock.html as they were (formatting only)

* chore(extension): keep popup.html's own formatting; only the new markup changes

* docs(openspec): clients-extension-complete, step 1

* feat(extension): item form rules, fresh item fetch, sparse saves, move and write-error messages

* feat(extension): item detail sections, the form for every kind of item, clone, move and the unsaved-changes guard

* feat(extension): folder manager with the server's delete protocol, and New folder in the picker

* style(extension): function declaration in the folder test

* feat(extension): vault snapshot and sync, offline reads and autofill, writes off while offline

* feat(extension): popup shell with a bottom tab bar, pop-out window, last tab and theme tokens

The unlocked popup keeps its header and tab bar fixed and scrolls between
them, at 380 by at most 600 pixels. Settings joins the tab bar. The popup
reopens on its last tab for the browser session, forgotten on lock. A
pop-out window stays pinned to the tab it was opened over, for This site,
the generator and fill, and fill still refuses a tab that changed site.
This site says to open a website on browser pages. Colours follow the
system's dark preference or an explicit data-theme.

* fix(extension): the popped-out window can talk to the worker, and data-theme wins over the system

A page in its own window is a tab, so the sender check refused every
message from the popped-out popup (and from the unlock window). An
extension page now counts when it is the top frame of its tab; the pages
are not web-accessible, so no web page can frame or open them.

The older dark-mode rules ignored data-theme. They now follow the same
scheme as the tokens.
rubenvdlinde added a commit that referenced this pull request Oct 3, 2026
crypto-new-device-approval task 3.1, on top of #921's worker raw-key
unlock. The locked popup offers "Approve from another device" when the
administrator left the feature on. The worker generates the one-time
X25519 key, files the request as clientKind extension, and keeps the
private key and request secret in memory only; the popup shows the five
word phrase and polls every three seconds. On approval the worker opens
the sealed unlock key with the web app's openUnlockKey, unlocks through
vault.unlockWithRawKey, zeroes the key and drops the request. A key
sealed for another request id, a denial, an expiry or a cancel drop the
one-time key. The new messages are refused from web pages.

tests/extension/deviceApproval.spec.js drives the real router and popup
with a key sealed by the web app's sealUnlockKey: red on the old router
(7 of 7), green now.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants