m2/org/openalice-auth
openalice-auth
“> JWT authentication + SSO cookie service. The single front door for every OpenAlice product.”
Features
38
Status
·unknown
Last activity
12d ago
Branch
mvp
auth/agent
2 features- auth.agent_config.getsrc/routes.rs:1578Read the user's unified agent config — shared identity (avatar + VRM), voice settings (TTS+STT provider/voice/language/emotion/pace), and per-product enable+system-prompt for live/social/persona/world. Returns a built-in default when no row exists yet.api:GET /auth/agent-configsince 0.1.0
- auth.agent_config.putsrc/routes.rs:1605Upsert the user's agent config. Validates tts/stt providers against the known-good allowlist and per-product JSON shape. Partial updates supported — fields the request omits keep their current values.api:PUT /auth/agent-configsince 0.1.0
auth/broadcast
2 features- auth.broadcast_config.getsrc/routes.rs:1737Read the user's current studio broadcast config (preset_id + per-stream overrides). Defaults to {preset_id="qa-host", overrides={}} when no row has been saved yet — first-time streamers don't have to click anything before going live.api:GET /auth/broadcast-configsince 0.1.0
- auth.broadcast_config.putsrc/routes.rs:1765Upsert the user's studio broadcast config. Validates preset_id against the @openalicelabs/presets allowlist; rejects unknown ids with 400. Returns the persisted row so the client can mirror updated_at.api:PUT /auth/broadcast-configsince 0.1.0
auth/chat
1 feature- auth.chat_sources.createsrc/routes.rs:2787Persist a chat-read source (YouTube / Twitch / Kick) — the config blob is encrypted at rest by the same crypto pipeline as stream_destinations. Returns the masked public shape.api:POST /auth/chat-sourcessince 0.1.0
auth/crypto
1 feature- auth.password.hashsrc/auth.rs:361Hash a password with Argon2id using a per-call random salt.since 0.1.0
auth/devices
4 features- auth.devices.listsrc/devices.rs:180List the user's paired devices — Hub /account/devices renders this.api:GET /auth/devicessince 0.6.0
- auth.devices.pair_claimsrc/devices.rs:107Exchange a pairing code for a 90-day device-scoped JWT (audience = live + persona). Unauthenticated by design — the code itself is the credential.api:POST /auth/devices/pair/claimsince 0.6.0
- auth.devices.pair_startsrc/devices.rs:74Generate a short-lived pairing code (8 chars, 10 min TTL) the user types into openalice-stream-host. Code is single-use; claiming it issues a 90-day device-scoped JWT.api:POST /auth/devices/pair/startsince 0.6.0
- auth.devices.revokesrc/devices.rs:210Revoke a paired device — sets revoked_at, the issued JWT's jti goes into the revocation set so subsequent calls from that token are rejected.api:DELETE /auth/devices/{id}since 0.6.0
auth/email
2 features- auth.email.verifysrc/routes.rs:936Consume an email-verification token (looked up by SHA-256 hash). Marks the user verified and the token used. Idempotent — already-verified users get 200 with the same payload.api:POST /auth/verifysince 0.1.0
- auth.email.verify_sendsrc/routes.rs:814Issue a new email-verification token for the authenticated user, hash it, persist with 24h expiry, and "send" the verification link via the email stub.api:POST /auth/verify-email/sendsince 0.1.0
auth/mfa
3 features- auth.mfa.disablesrc/routes.rs:1492Disable MFA after re-confirming the user's password (defense against a session-stealing attacker silently turning MFA off). Clears mfa_secret + mfa_enabled.api:POST /auth/mfa/disablesince 0.1.0
- auth.mfa.setupsrc/routes.rs:1367Begin MFA enrollment — generates a fresh TOTP secret, stores it on the user (NOT yet enabled), and returns the secret + otpauth URL so the client can render a QR. Re-running before /auth/mfa/verify rotates the secret. Idempotent against an already-enabled user — returns 409 so the client tells the user to disable first.api:POST /auth/mfa/setupsince 0.1.0
- auth.mfa.verifysrc/routes.rs:1424Confirm enrollment by submitting a code derived from the secret stored at /auth/mfa/setup. On success, mfa_enabled flips to true and subsequent /auth/login flows require a second factor.api:POST /auth/mfa/verifysince 0.1.0
auth/oauth
1 feature- auth.oauth.youtube_startsrc/routes.rs:1902Begin a YouTube (Google) OAuth flow — generates a state nonce, persists it server-side, returns the Google authorize URL the client should redirect to. The callback will create a `chat_sources` row with the user's refresh + access tokens.api:POST /auth/connectors/youtube/startsince 0.1.0
auth/password
2 features- auth.password.forgotsrc/routes.rs:1061Issue a password-reset token for the given email and send the reset link via the email stub. Always returns 204 — never reveals whether the email is registered (timing attacks aside, this stops trivial account-enumeration).api:POST /auth/password/forgotsince 0.1.0
- auth.password.resetsrc/routes.rs:1115Consume a password-reset token (looked up by SHA-256 hash) and rewrite the user's password. Marks the token used and revokes ALL outstanding refresh tokens for the user (forces re-login on every device).api:POST /auth/password/resetsince 0.1.0
auth/presence
1 feature- auth.presence.onlinesrc/routes.rs:609List users with last_seen ≤ 2 minutes ago who haven't set their status to invisible. Powers the Hub "who's online" widget and any cross-product presence indicator.api:GET /auth/users/onlinesince 0.1.0
auth/realtime
4 features- auth.realtime.broadcastsrc/routes.rs:2686Service-to-service entry point — POST a notification (optionally targeted at a specific user) and the auth WS hub fans it out to every connected client. Authenticated by a shared secret in the `X-Internal-Secret` header (env `INTERNAL_BROADCAST_SECRET`). Producers: social-api on DM, persona on session events, billing on plan changes.api:POST /internal/broadcastsince 0.1.0
- auth.realtime.chat_eventsrc/routes.rs:3036Service-to-service entry — POST a normalized chat message from any platform connector (openalice-chat-bridge for YouTube/Twitch/Kick/TikTok) and the broadcast owner's connected agent receives it as a `chat_message` event over /auth/ws. Bypasses the notification cooldown (chat is a stream). Authenticated by X-Internal-Secret.api:POST /internal/chatsince 0.1.0
- auth.realtime.chat_feedsrc/routes.rs:3064Service-to-service entry — POST a mechanical chat aggregation tick (n-gram topics + mood + highlight quotes over a fixed window) from the chat-bridge feed-aggregator. The broadcast owner's connected agent receives it as a `chat_feed` event over /auth/ws — a cheap "what is the room doing?" heartbeat that costs zero LLM tokens to produce. Authenticated by X-Internal-Secret.api:POST /internal/chat-feedsince 0.5.0
- auth.realtime.wssrc/routes.rs:1341WebSocket fan-out — clients open with ?token=ACCESS_JWT and receive cross-product real-time events (presence_changed today, notifications + DM events later). Server-push only; messages from the client are currently ignored.api:GET /auth/wssince 0.1.0
auth/sessions
2 features- auth.sessions.listsrc/routes.rs:1227List the authenticated user's active refresh-token sessions (one per browser/device login). Each row carries user_agent, created_at, last_used_at, and a `current` flag marking the device this request came from.api:GET /auth/sessionssince 0.1.0
- auth.sessions.revokesrc/routes.rs:1265Revoke a specific refresh-token session by id. Marks the row revoked and blacklists its current jti so the next /auth/refresh from that device fails. Existing access tokens on that device survive until natural expiry (≤1h).api:DELETE /auth/sessions/:idsince 0.1.0
auth/streams
6 features- auth.streams.createsrc/routes.rs:2341Persist a per-platform stream destination — label, platform, optional RTMP URL override, encrypted stream key. Returns the masked public shape.api:POST /auth/streamssince 0.1.0
- auth.streams.deletesrc/routes.rs:2487Permanently delete a stream destination.api:DELETE /auth/streams/:idsince 0.1.0
- auth.streams.internal_lookupsrc/routes.rs:2563Service-to-service endpoint for the broadcaster — given a user_id (path) and optional destination ids (query), returns enabled destinations with PLAINTEXT stream keys. Authenticated via X-Internal-Secret. The broadcaster is the only caller.api:GET /internal/users/:id/streamssince 0.1.0
- auth.streams.listsrc/routes.rs:2421List the user's stream destinations with masked stream keys ("live_••••wxyz" preview).api:GET /auth/streamssince 0.1.0
- auth.streams.revealsrc/routes.rs:2511Reveal the plaintext stream key after re-confirming the user's password. Stream keys aren't returned by the list endpoint by design — this is the dedicated unmask path.api:POST /auth/streams/:id/revealsince 0.1.0
- auth.streams.updatesrc/routes.rs:2448Update a destination's label or enabled flag. Stream-key rotation is a delete + create operation by design.api:PUT /auth/streams/:idsince 0.1.0
auth/tokens
1 feature- auth.token.refreshsrc/routes.rs:419Exchange a refresh token for a fresh access+refresh JWT pair (rotation).api:POST /auth/refreshsince 0.1.0
auth/users
6 features- auth.account.deletesrc/routes.rs:775Permanently delete the authenticated user's account and revoke all tokens.api:DELETE /auth/accountsince 0.1.0
- auth.profile.updatesrc/routes.rs:648Update authenticated user's profile fields (display name, avatar, bio).api:PUT /auth/profilesince 0.1.0
- auth.user.loginsrc/routes.rs:229Verify email+password and issue access+refresh JWT pair.api:POST /auth/loginsince 0.1.0
- auth.user.login_mfasrc/routes.rs:341Exchange a pre-MFA token + TOTP code for a full session. Issued only when /auth/login responds with mfa_required=true. Pre-MFA token is audience-restricted so it can't be used against any downstream service if leaked.api:POST /auth/login/mfasince 0.1.0
- auth.user.mesrc/routes.rs:570Return current authenticated user's profile (id, email, username, status). Side effect — bumps users.last_seen so the user surfaces in the online-users feed.api:GET /auth/mesince 0.1.0
- auth.user.registersrc/routes.rs:124Register a new user with email + username + password (Argon2id), returns access+refresh JWT pair.api:POST /auth/registersince 0.1.0