v9 P3: Account linking (OAuth) #24
Labels
No labels
bug
duplicate
enhancement
future
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
rbrooks/TeaLeaves#24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Let a researcher sign in with their real Bluesky/Mastodon account so watches run with their session: higher rate limits, and visibility into content their account can already see (e.g. follows-only posts) but the public can't. Linking is additive - watches work without it (established in P1).
Schema:
linked_accountstable:id uuid PK,user_id uuid NOT NULL REFERENCES users ON DELETE CASCADE,platform text NOT NULL CHECK (platform IN ('bluesky','mastodon')),instance_url text(Mastodon home instance),handle text,access_token text NOT NULL(encrypted at rest via the existingencryptPrivateKey/decryptPrivateKeyAP-key pattern),refresh_token text(encrypted),dpop_private_key text(encrypted; Bluesky only),token_expires_at timestamptz,created_at timestamptz NOT NULL DEFAULT now().UNIQUE (user_id, platform, instance_url).Mastodon (standard OAuth2 authorization-code flow):
POST /api/v1/apps) once per instance the first time any user links an account there; cache in a newmastodon_app_registrationstable (instance_url UNIQUE,client_id,client_secretencrypted); reuse for all subsequent logins to that instance. Works the same for public or self-hosted instances.Bluesky (AT Protocol OAuth - the most novel piece; spike this before committing to a timeline):
client_idis a URL to a client-metadata JSON document Tea Leaves must host publicly (a new well-known endpoint, alongside the existing.well-known/tea-leaves.jsonand WebFinger routes)openid-clientlibrary used for Authentik - budget for adopting@atproto/oauth-client-node(verify it is still current at implementation time) or hand-rolling DPoP signingWiring + security:
mastodon_app_registrations.client_secretis encrypted the same way.Originated in
ROADMAP.md(now retired; this tracker is the single source of truth).