oficina / home Public

Oficina ID native slice: review record and Paul's eight questions Question open

On branch spec/oficina-id-native

17. Questions for Paul

  1. Factor rule (§5). Choose (a) native passkey assertion in slice A (recommended), (b) a recovery code or the browser until slice B, or (c) the code alone natively (not recommended).
  2. Keymail addresses. Slice 1 keeps the Keymail upgrade. Choose (a) Keymail approval in an ASWebAuthenticationSession sheet, with "Email me a code instead" (recommended), or (b) always mail a code and skip the upgrade.
  3. Silent minting. Native assertions (§7), and the web handle for its one consumer (§12), skip slice 1's Continue page. Recommended: yes to both.
  4. Lifetimes. Grants: 90 days idle, 365 days absolute. Native instance sessions: 7 days, which also bounds how long a revocation takes to reach them. Recommended as stated.
  5. Web labels for several IDs. Home holds no address. Choose (a) label each ID by its teams' names (recommended: nothing new is held), (b) a person-chosen nickname sealed at Home and shown only on the directory, or (c) the address in a sealed browser cookie, rendered by the directory.
  6. Team hue. Choose (a) derive it on the client from sqid for now (recommended), or (b) add an owner-set column of closed Calma hues to teams.
  7. First app for slice A. Docs (recommended: it already has the multi-account NativeConnection), or Calls (PLAN's order, but it has to move onto RastrilloApple first).
  8. Code strength. Is a mailed 6-digit code (10 minutes, 5 tries, rate-limited) equal to a magic link as mailbox proof? Recommended: yes. It proves the same mailbox, and it fixes the cross-device and cross-browser failures.

Portal steps for Paul. None has been taken.

  • Register the App Group group.works.oficina.
  • Enable Associated Domains on the ten works.oficina.* App IDs.
  • Issue Developer ID provisioning profiles for the Mac Sparkle builds, covering keychain-access-groups, the App Group and associated domains. It is not yet verified that these builds need them (PLAN Phase 0).

Revision 2 at 7acf2a1: Paul's answers of 2026-11-14 recorded (Q1 a, Q2 a, Q5 a, Q6 a, Q7 Docs; Q4 provisional) and every finding of Fable's READY AFTER FIXES review of 4cc21a8 applied (B1-B4, H1-H4, M1-M9, low). Not re-reviewed. Q3 and Q8 are re-asked in reframed form. The open questions are now:

Still open:

A. Confirmation, split in two (B1).

  • (i) Native assertions without a Continue page (§7). Recommended: yes. The tap is in the app and the key is on the device.
  • (ii) May the web link sign in a browser without confirmation? The trade-off: silent sign-in is the seamless experience, but it is a login-CSRF hole. Choose one: - (a) a fixed-text confirmation plus a one-shot, consumer-only session. Recommended. Residual risk: a victim who presses Continue on a lured link lands in the attacker's team. - (b) no web sign-in from the app: the plain URL, signed in by the browser's own Home session, if it has one. - (c) silent sign-in. Not recommended.

B. Accounts that sign in by code only (H1, replaces Q8). A code alone means about 17% a year of takeover under sustained guessing, phishing relay, and lockout for ~96 mails a day. Choose one:

  • (a) a daily failure cap of 20, falling back to link-only sign-in, plus a prompt to make a passkey. Recommended: under 1% a year.
  • (b) require a passkey within N days of the first code sign-in.
  • (c) accept the risk as stated.

C. Spending recovery codes in routine sign-in. There are only ten, and regenerating them needs a passkey on the web. Choose one:

  • (a) allow, showing how many are left, and prompt below 3. Recommended.
  • (b) native recovery only as a last resort, once per device.

D. One compromised app yields everything (H3). Any process in the keychain group can assert for any audience and open the web. A parsing bug in Calls could therefore expose Memoria private items in every team. Choose one:

  • (a) accept and disclose the risk. Recommended for slice A.
  • (b) per-app keys bound to app zones. This needs App Attest, which is iOS-only in practice; later work.

E. Guest ID disclosure (H4). Choose one:

  • (a) name-only by default, with Oficina ID behind an explicit choice that names the disclosure. Recommended.
  • (b) Oficina ID by default for registered instances.

F. Mac releases (B4). Every Mac release depends on provisioning profiles plus the launch gate, and the Mac App Group becomes 9U4A84C4WK.works.oficina (iOS keeps group.works.oficina). Accept? Recommended: yes.

G. Code entry on the web door. In or out? Recommended: out. The web keeps its links, which are stronger against phishing.

H. Zero teams. Choose one:

  • (a) "Create a team" through Alta, plus "Waiting for an invitation?" help. Recommended once Alta runs.
  • (b) the help text only.

I. Should app sign-out end the browser sessions it opened (§10)? Choose one:

  • (a) yes, best effort per instance. Recommended.
  • (b) no: those sessions end at their normal lifetime, or on the web's Sign out.

J. Migration scope. Does it cover Till's machines and lagged, or only Paul's? Recommended: Paul's only, with Till told separately.

Portal steps for Paul.

  • Register the App Group group.works.oficina (iOS only).
  • Enable Associated Domains and keychain sharing on every works.oficina.* App ID.
  • Issue a provisioning profile for every Mac build, Developer ID and App Store. Slice 0a's spike makes these a hard prerequisite.

Revision 3 at 575e824 (238 lines): Paul's rulings A–J and the confirmed lifetimes are recorded in §16 as decided; no questions remain open. New ruling applied: slice 1's browser completion is amended with the same no-fork rule (AllocatesHomeOnly evaluated in the writer transaction; signed-out browsers on instances with addressed local accounts land on /account/home/connect-first). Fable's re-review of 7acf2a1 applied in full: N1 receipt-then-GET /native/web/finish with no silent replacement; N2 Home-chosen domain-separated native and web nonces, plus a two-digit match number; N3 per-(address, device key) caps with a returning-key exemption, corrected B cost (~4 mails/day blocks new devices only); N4 500 IP buckets, ip_bucket = IPv4 /32 or IPv6 /64 from the last X-Forwarded-For, start bucket numbers; N5 connect.IsHomeDerived; N6 landing URL, copy and two labelled native routes; N7 shared mintPolicy, empty in slice A; N8 first enrolment revokes passkey-less grants; N9 jti after verify, per-grant limit, pre-grant calls proof-only; N10 Keymail sheet moved to A2 and ephemeral; all lows. Recovery moves to slice B; slice A gains a minimal Sign out all devices. Not re-reviewed.

Revision 4 at 1b74278 (256 lines). Paul's fork ruling (members choose) replaces revision 3's instance-wide AllocatesHomeOnly rule: the roster decision comes first through a non-allocating Admit hook. Non-members, an unavailable roster and instances without Unlinked keep today's unknown answer byte for byte. Only a roster Member with no link sees /account/home/choose, with 'Connect my existing account' and 'I'm new here — continue with Oficina ID'; native answers 409 choose and offers the same two routes. The browser path is no longer claimed to be one transaction. Fable's third pass @575e824: the returning-key exemption is limited by end_reason and gets its own start limit (3); first enrolment, native or web, revokes passkey-less grants, in slice A (4); sign-out sends /native/web/end before /signout, also at launch (5); browser scope is stated without the transaction claim (6); one-way nonce wording (7); lockout copy (8); the second-app onboarding line, no per-team sign-out, slice D handle gates, the shared email allowance, the /devices URL and the web Open in the app button are restored. Not re-reviewed.

Revision 5 at b6aea35 (264 lines): Fable's fourth pass @1b74278 applied, within Paul's rulings.

  1. An unavailable roster stays 503 on both paths; byte for byte now means status, body and header set (the marker is freshly sealed); the gate is fixed.
  2. NativeExchange's real order: verify, read, Admit with no transaction open and the 409 returned before any jti write, then one writer transaction. Unlinked runs outside it, because EnsureHome opens its own writer.
  3. The no-app-session precondition is restored: unknown plus marker before Admit; the choose POST refuses with an app session present; Connect consumes the proof.
  4. The choose page is reached through the Fail hook and lands on the default path /.
  5. Native choice gates are added, and Admit joins the Unlinked/HomeOnly set-together invariant.
  6. Sign-out pre-signs /native/v1/signout before deleting the key and token. Also: the choose page's request-forgery protection (cookie-bound HMAC token plus same-origin Origin). Not re-reviewed.

Revision 6 at 02e00c4 (273 lines): Fable's fifth-pass finding applied; ready for Paul. The single-writer-transaction claims are dropped from NativeExchange, the choose POST and (for consistency) the web finish. The jti is now reserved in its own short transaction; resolving (HomeOnly) and minting then run with no transaction open, because Unlinked, HomeOnly and sessions Mint each use their own handle on Docs' single writer connection, so holding a transaction around them would wedge the writer permanently. Steps renumbered: 4 allocate (choice:"new" only; on ErrNoPerson or an error, re-resolve, else 403 or 503 with no jti kept); 5 reserve the jti, then resolve and mint. The accepted non-atomicity is stated (a burned jti with no session means a fresh assertion). New gate: no hook and no session mint is called with the writer held. The Unlinked citation is corrected to connect/api.go:64.