Skip to content

idp-provider: account session + pending-claim approval surface (#16655) - #16679

Closed
developing-today-fleet[bot] wants to merge 1 commit into
mainfrom
felix/16655-session-a9c03
Closed

developing-today-fleet[bot] wants to merge 1 commit into
mainfrom
felix/16655-session-a9c03

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Implements the remainder of #13972 slice 3 (tracked as #16655), the recorded blocker for #13973 passkey slice 1.

What lands

  • Minimal account session (src/account.rs): a short-lived (600s), provider-issued, account-bound credential established by completing a door login (or the local-door authorize) with an active identity — Set-Cookie: idp_account_session on the login redirect, also accepted as a Bearer token. Scoped to account-management acts only; RP tokens remain the code+PKCE flow.
  • Approval surface: GET /account/session, GET /account/claims, POST /account/claims/approve|reject. Dispositions go through the store's approve_pending/reject_pending (identity-history event, actor established-session) plus an audit record (claim_approved/claim_rejected). A session names exactly one account: another account's claim reads as not found.
  • Session-add claims: GET /account/add/{door} starts the door flow bound to the session's account; the returning identity registers as pending with claimed_via=session-add.
  • Rate limits: pending registrations limited per target account (5/h) and per provider subject (3/h) — the claim-spam control SSO (#9077): pending-link registration — new provider sign-ins register without trust until approved from an established session #13972 §4 names — enforced on both the email-match and session-add paths with an audited claim_rate_limited denial; approval acts limited per account (20/h).

One door-order fix the acceptance requires

An identity a session approves becomes active in the store but was never on the config allowlist, and the allowlist gate sat before the status check — so approval could never take effect at the door. Known rows are now decided by store status (the store is authoritative after seeding, per identities.rs); the deny-by-default allowlist still gates never-seen enrollments exactly as before.

Verification

Remote run 46242855446 (cargo test -p idp-provider): the Execute step completed with success and the job log shows 55 passed / 0 failed across 9 suites, including the 7 new tests/session.rs tests — the policy's example flow over real HTTP against mock upstreams (Google-established account → cold Microsoft email-match claim denied without a code → session approves → Microsoft signs in fully; rejection path; GitHub session-add; cross-account isolation; both rate limits; no-session denials). Existing suites (doors/flow/endpoints/consumer/rollover) all green. (The run's post-steps hung after the command step — the known executor pathology — so results were read from the job log, job 141283594758.)

Refs #16655, #13972. Left unmerged for Felix's review.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-29T08:57:09Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch",
      "repo": "developing-today/code",
      "branch": "main",
      "sha": "ac3f377b7f752f50918f491d7443b79e95b5dc34"
    },
    "auth_subject": "felix",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…16655)

The #13972 slice-3 remainder: a minimal, account-bound session
established by a door login with an active identity; pending
claims listed and approved/rejected from that session (history
event + audit record per disposition, actor established-session);
session-add claim creation from inside the session; rate limits
on pending registrations (per account, per provider subject)
and on approval acts.

One door-order fix the acceptance requires: a store row the
session approved is active but was never on the config allowlist,
and the allowlist gate sat before the status check, so approval
could never take effect at the door. Known rows are now decided
by store status (the store is authoritative after seeding); the
allowlist still gates never-seen enrollments, deny-by-default.

Refs #16655, #13972
@coderabbitai

coderabbitai Bot commented Nov 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3a624a7a-bd42-4094-866a-8c66db9a445a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@developing-today-fleet

Copy link
Copy Markdown
Contributor Author

Superseded: the parallel implementation for #16655 landed as PR #16677 (merged 2026-11-29T08:59:53Z). Three Felix lanes built this concurrently after a draw race; #16677 is the landed one, so this PR closes unmerged. No unique work is lost — the acceptance surface (account session, claim approval, rate limits) is on main via #16677. — Felix

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.

0 participants