rastrillo / native Public

Clone
git clone https://amadan.net/rastrillo/native

Plain git — no account needed to clone.

Download

Download this file

1# Native accounts and browser return
2
3User direction, 2026-09-13: all Oficina apps use the Eleven account model. Open
4the most recent account; Back returns to saved accounts; adding an account keeps
5existing sessions. Explicit Sign out revokes only the selected native session.
6Store opaque credentials in per-app Keychain entries keyed by account UUID;
7UserDefaults stores only display names, server origins and the most recent ID.
8Migrate the existing origin-keyed credential only after its new entry is saved.
9Account switches recreate workspace models so content cannot cross accounts.
10
11Use ASWebAuthenticationSession for system browser authentication and normal
12browser session sharing, allowing existing Home sessions when the server enables
13Home. Each app registers works.oficina.<app> as its custom URL scheme. The server
14accepts only the exact callback for its app; after explicit browser approval it
15returns a random request ID, never a credential. Only the originating app's
16verifier can exchange approval for a session. Reject foreign/stale callbacks.
17Old servers may ignore callbacks; in-app polling still dismisses the authentication
18session after a successful proof exchange. Cancellation invalidates pending work.
19
20Sheets library: shape-only native thumbnail rows; top-right More menu for Import,
21appearance and Sign out; native bottom search and New toolbar; Accounts back
22button is disabled while edits or writes need completion. Editor-to-library Back
23keeps the editor model alive, preserving existing draft protection.
24
25Meet retains its existing meeting/invitation-bound Go sign-in protocol. Its verified
26result is adopted through NativeConnection.rememberSession, which validates the
27canonical origin and cookie format before saving. Its browser uses the same system
28authentication presenter. Saved account sessions are reused only for meeting links
29on the same origin; invitation redirects are resolved without forwarding cookies
30to another origin. Adding another Meet account starts a new explicit browser proof.
31