The minted tokens lived in an in-memory Map, so every restart of the platform
silently invalidated every open frame: the browser kept sending a cookie that
matched nothing and the frame answered 401 mid-session with "no gitea frame
session". Deploying anything at all logged everyone out of the iframe — which
is exactly how this was found, a restart landing between a sign-in and the POST
that followed it.
An HMAC over the account and an expiry needs no state, so a restart changes
nothing. Same shape api/browser/relay-auth.ts already uses, and the same key —
getKey('jwt') from the secret store, which persists.
Compared with timingSafeEqual, because comparing a signature with === leaks how
much of it was right.
Gitea
Your own Gitea inside Officer — repositories, issues and pull requests, rendered as the real thing rather than a copy of it.
What you get
Gitea's own web interface, in an Officer panel. Not a reimplementation: the actual application, proxied through Officer so it stays signed in, with an open in a new tab button for anything the frame handles badly.
Requirements
A Gitea instance Officer can reach.
Setup
Install the plugin, open /gitea, and set the instance URL and an API token in the connection panel. Then sign in to Gitea inside the frame, once — the frame shows your Gitea account, not the owner's.
The stored token is used only for the small things around the frame. Everything you see in it is your own session.
For agents
This plugin ships an affordance: use plain git for clone, fetch, pull and push; use tea for pull
requests, issues, comments and releases. tea is logged in as you, with your permissions.
Permissions
One permission, gitea, grantable per role like any other app permission. Each account reaches its own
Gitea identity.