feed auth README.md
2.2 kB · 47 lines
Markdown
at main

auth — the aligned.click OAuth sidecar and the write path #

Own auth, own per product, no allowlist. Any atproto handle can log in and create topics; that is the point — a topic request is the requester's own words, and it lives in their own repo.

  • oauth/ — the OAuth sidecar (Node, the only process that holds a credential). It is the one place a session exists and the only thing that signs anything. Talks to 127.0.0.1 only; reached through the auth proxy. node auth/oauth/server.mjs (needs npm install in auth/oauth).
  • bsky.py — every read and write made as a person, by DID, through the sidecar. Failures are loud and never fall back to another identity.
  • records.py — the one write path: a topic request record in the requester's repo.
  • publish.py — publishes the lexicon schemas and the feed generator records under the domain account (ADMIN_DID), plus prints the DNS TXT lines that make the lexicons resolvable.

How a topic gets created #

  1. The reader signs in through the proxy (OAuth login → sidecar session).
  2. The app writes a click.aligned.feed.request record to their repo via the sidecar (auth.records.create), as their DID.
  3. The ingest worker's jetstream watcher sees the createRecord event and calls feed/topics.create_topic — embed, store, then the background harvest/index/seed pass.

Until the proxy routing lands, the app's /api/request creates the topic directly when no DID is present (development mode); the record path is what runs in production.

Domain records #

click.aligned.feed.request is authored by feed.aligned.click (the NSID's own segments reversed, minus the last). Publishing it needs:

  • the schema published under com.atproto.lexicon.schema by ADMIN_DID,
  • a DNS TXT record _lexicon.aligned.click → did=<ADMIN_DID>,
  • the ADMIN_DID account logged into the sidecar (no app passwords here).

The main feed generator is did:web:aligned.click, resolved by clients to this product's getFeedSkeleton at https://aligned.click/xrpc/.

Environment #

OAUTH_SIDECAR (default http://127.0.0.1:4098), OAUTH_PORT, PUBLIC_URL, PROXY_URL, ADMIN_DID — see .env.example.