Skip to content

docs(auth): document programmatic/bot auth, slim stale provider docs#588

Merged
tompscanlan merged 2 commits into
mainfrom
docs/api-auth-automation
Jun 2, 2026
Merged

docs(auth): document programmatic/bot auth, slim stale provider docs#588
tompscanlan merged 2 commits into
mainfrom
docs/api-auth-automation

Conversation

@tompscanlan

Copy link
Copy Markdown
Contributor

Why

A community member automating event reminders for their Slack group hit two undocumented walls: the required x-tenant-id header, and refresh-token rotation (the old token is single-use). The auth doc also still described never-implemented Apple/Twitter flows inherited from the NestJS boilerplate, and omitted GitHub and Bluesky entirely.

What

docs/auth.md — verified against the codebase, slimmed and corrected:

  • Added programmatic / automation guidance: the email → refresh → re-login loop for bots, the single-use refresh-token rotation gotcha, and the required x-tenant-id header.
  • Added an ATProto service-auth section — the non-interactive bot path (POST /api/v1/auth/atproto/service-auth), with the exact aud / lxm=net.openmeet.auth claims and the getServiceAuth exchange.
  • Corrected the provider list to what actually ships: Google, GitHub, Facebook, Bluesky/ATProto. GitHub and Bluesky were previously undocumented.
  • Removed the never-implemented Apple and Twitter sections (no src/auth-apple / src/auth-twitter modules) plus brocoders boilerplate screenshots/videos.
  • Refresh lifetimes described as env-configurable (drive off tokenExpires) rather than a hardcoded value.

README.md — added a Documentation subsection linking the Auth guide (the README had no docs/ link before).

Test plan

Docs-only — no code paths touched.

  • Verified each documented route/claim against source (auth.controller.ts, atproto-service-auth.service.ts, auth-bluesky/, did-web.controller.ts).
  • Internal links (database.md, serialization.md) and TOC anchors resolve.

Follow-up (separate issue): purge leftover APPLE_APP_AUDIENCE / TWITTER_* env vars from env-example* now that those providers are documented as not implemented.

- Add automation guidance: email+refresh loop, single-use refresh rotation,
  and the required x-tenant-id header
- Document ATProto service-auth as the non-interactive bot path
- Correct the provider list to what actually ships (Google, GitHub,
  Facebook, Bluesky); drop never-implemented Apple/Twitter boilerplate
- Link the Auth guide from the top-level README
The ATProto service-auth path works for any AT Protocol account, not just
Bluesky. Lead with that, and add a 'Finding the bot's PDS' step showing how
to resolve a handle to its PDS (handle -> DID -> DID doc -> #atproto_pds)
instead of hardcoding bsky.social.

Verified end-to-end: discovery resolves both a bsky.social account and an
account on our pds.opnmt.me PDS; createSession + getServiceAuth + exchange
yields a usable OpenMeet JWT.
@tompscanlan tompscanlan merged commit 570c8c6 into main Jun 2, 2026
4 checks passed
@tompscanlan tompscanlan deleted the docs/api-auth-automation branch June 2, 2026 15:45
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.

1 participant