An easy-to-host PDS on the ATProtocol, iPhone and MacOS. Maintain control of your keys and data, always.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(relay): require password on OAuth consent for multi-user relay #47

open opened by malpercio.dev targeting main from malpercio/oauth-consent-password-gate

Summary#

  • The OAuth consent page previously used get_single_account_did() — a single-user PDS shortcut that issued auth codes to anyone who clicked Approve with no identity verification. This is wrong for a multi-user relay where many identities share the same server.
  • The consent page now collects a handle/DID and password, verifies them via the same Argon2id path as createSession, and re-renders with an error on failure rather than redirecting the client with access_denied.
  • The ATProto login_hint query parameter is honoured: clients can pre-populate the identifier field by including it in the authorization redirect.

Changes#

  • Remove get_single_account_did from db/oauth (single-user assumption eliminated)
  • resolve_identifier, verify_password, AccountRow promoted to pub(crate) in create_session so the consent handler reuses the same credential path
  • Identifier + password inputs added to the consent page HTML/CSS
  • POST /oauth/authorize verifies credentials before issuing an authorization code
  • Pre-existing clippy::too_many_arguments on promote_account suppressed with allow attr
  • Pre-existing rustfmt drift in app.rs import order corrected

Test plan#

  • cargo test -p relay oauth_authorize — 30 tests pass (6 new credential-gate tests)
  • Manually open /oauth/authorize with a valid client_id — confirm identifier and password fields appear, login_hint pre-populates the identifier field
  • Submit with wrong password — confirm form re-renders with "Invalid credentials."
  • Submit with correct credentials — confirm redirect to redirect_uri?code=...
  • Submit deny — confirm redirect with error=access_denied (no credentials required)
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:web:malpercio.dev/sh.tangled.repo.pull/3mhqtkplojr22
Diff #0

No differences found between the selected revisions.

History

1 round 0 comments
sign up or login to add to the discussion
malpercio.dev submitted #0
patch application failed: error: No valid patches in input (allow with "--allow-empty")
expand 0 comments