Skip to content

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

Closed
developing-today-fleet[bot] wants to merge 2 commits into
mainfrom
felix/16655-session-approval
Closed

developing-today-fleet[bot] wants to merge 2 commits into
mainfrom
felix/16655-session-approval

Conversation

@developing-today-fleet

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

Copy link
Copy Markdown
Contributor

Implements the #16655 remainder of #13972 slice 3: the minimal account session and the pending-claim approval surface for pkgs/idp-provider.

What

  • Account session (new src/account.rs): a door login completed with an active identity — federated door callback or the local door — establishes a short-lived (1h), provider-issued, account-bound session, carried as an HttpOnly cookie (idp_account_session; Bearer header also accepted). Server-side store on FlowState; no general-purpose RP session is introduced.
  • Approval surface: GET /account/claims lists the session account's pending claims; POST /account/claims/{provider}/{subject}/approve|reject acts on them. A claim naming another account is answered exactly like a nonexistent claim (404) and never touched. The audit row is written before the store transition (fail closed); the transition records the approve/reject identity event with actor established-session.
  • Session-add: GET /account/add/{name}/start (session required) parks a door request bound to the session's account; the callback registers an unseen returning identity as pending with claimed_via=session-add, no-ops if already active on the same account, and denies identities active/pending on another account or unlinked. The upstream redirect construction is shared with the RP door start (extracted as doors::upstream_location).
  • Rate limits (SSO (#9077): pending-link registration — new provider sign-ins register without trust until approved from an established session #13972 §4 claim-spam control): pending registrations capped per account (5/h) and per provider subject (3/h) on both registration paths (email-match and session-add); the account surface is capped per account (30/min). Exceeding a cap is an audited denial (429).

Acceptance mapping (#16655)

  • Session established via an already-active identity, with tests ✓
  • Approve → identity active, both providers then sign in fully; reject → denied, no tokens; both written to identity history + audit; no-session and cross-account denials tested ✓ (the policy's example flow runs end to end over real HTTP against mock upstreams in tests/account.rs: Google-established account, cold Microsoft email-match claim, approval from the session, full Microsoft sign-in; GitHub added the same way via session-add)
  • Rate limits enforced on the claim/approval endpoints, with tests ✓
  • Existing door behaviour preserved: full crate suite green (below) ✓

Note: approval activates the identity on the account; a later cold login still passes the standing deny-by-default allowlist gate, so live config keeps allowlisting the owner's door identities as it already does for the seeded set.

Verification

Remote, via fleet-command dispatch (builds/tests are never run on the seat):

  • Run 46242428121 (implementation commit): success — existing suites green.
  • Run 46244138547 (implementation + tests): success — 55 passed, 0 failed: lib 19, account 7, doors 16, flow 5, rollover 4, endpoints 3, consumer 1.

Refs #16655

{
  "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:04Z",
    "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.

@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: 1bb792ad-213c-46f0-8a2d-5a50d92885e8

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