Repository navigation
feat(identity): accept co-author credit from trusted-proxy headers - #196867
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesThis PR imports trusted-proxy co-author details into protected profile metadata and uses them for commit credit after explicit consent. Example: Keycloak supplies Alice Test and [email protected] without a linked GitHub identity.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it delivers a useful capability absent from main, and the earlier findings are addressed. No new blocking code defect was found; current-head security approval and the failed CI gate still govern merging. Priority: P2 Before merge
FindingsNone. Agent review detailsHow this fits togetherAuthenticated HTTP and WebSocket admission import proxy claims through the existing profile preference worker; Profile manages consent, and the attribution owner combines eligible session participants into commit trailers while preserving separate publication credentials. flowchart LR
A[Authenticated proxy headers] --> B[HTTP and WebSocket admission]
B --> C[Profile preference worker]
C --> D[Profile display and consent]
C --> E[Session attribution owner]
D --> C
E --> F[Agent commit instructions]
E --> G[Managed publication]
Technical reviewBest possible solution: Retain the proxy-only extension within the existing profile, consent and attribution owners, preserving GitHub fallback and separate publication authority. Do we have a high-confidence way to reproduce the issue? This is a capability extension: current main requires eligible GitHub identity, while the supplied live validation demonstrates proxy-only attribution through the real product. Is this the best way to solve the issue? The narrowed implementation fits the existing owners, replaces the extracted reader rather than retaining competing logic, and keeps proxy credit separate from authentication, GitHub ownership and publishing credentials. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f765f6340ebe. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +645, Tests +1479, Docs +92, Generated 0, Other +14. Total +2230 across 52 files. Added test files: 5. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (7 earlier review cycles)
Reviewed November 12, 2026, 10:41 AM ET / 15:41 UTC (Revision 8). |
|
@clawsweeper re-review Updated head |
|
🦞👀 Re-review progress:
|
✅ Maintainer security changes approvedA maintainer approved this revision with an explicit security approval comment.
A later push requires a fresh approval comment for an external contributor's PR. |
7e57878 to
7fb8a61
Compare
|
/allow-security-sensitive-change |
Signed-off-by: Russell Bryant <[email protected]>
Reset consent when the first supplied address arrives, preserve the selected address and its consent through merges, and keep optional organization defaults from exhausting user preference capacity. Transfer custom details before consent when merge capacity is limited. Keep optional co-author constants outside browser startup. Signed-off-by: Russell Bryant <[email protected]>
Signed-off-by: Russell Bryant <[email protected]>
Signed-off-by: Russell Bryant <[email protected]>
Bind organization credit to the observed details and current proxy policy, refresh Profile safely, preserve verified GitHub mentions, and repair CI fixtures and canonical configuration metadata. Fold in the related OIDC presentation fix: do not infer a display name from an issuer-qualified subject, hide opaque authentication aliases from Linked emails, and preserve the canonical principal bindings and profile IDs. Keep mutation responses consistent with profile reads and cover name/avatar saves in the resident and real-Gateway regressions. Show selected credit details inline beside consent, distinguish sign-in emails, and expose only the verified public-GitHub noreply pair in self-profile reads. Regenerate the owning protocol validators and align the Profile browser fixtures. Co-authored-by: sallyom <[email protected]>
Keep consent local to identity reads and consolidate canonical documentation, protected metadata, admission and Profile coverage. Preserve full preference capacity, both sign-in transports, explicit organization consent and verified GitHub variants. Co-authored-by: sallyom <[email protected]>
b89c163 to
0164d66
Compare
|
/allow-security-sensitive-change |
|
On behalf of @sallyom: final review of |
|
Merged via squash.
|
Related: #196845
What Problem This Solves
A shared OpenClaw Gateway behind Keycloak identifies separate users, but ordinary Keycloak profile claims do not establish the verified GitHub identity needed by existing automatic commit credit. Publication credentials serve a separate purpose.
User Impact
An administrator can map authenticated proxy headers to a co-author name and email, with an optional email-verification header. HTTP and WebSocket profile admission import that pair into protected profile metadata. Profile shows the pair read-only and requires explicit consent before publishing the email in commit history.
This proposal is proxy-only. There are no editable co-author name/email fields, manual identity preferences, custom overrides, or custom-before-default precedence. Existing GitHub-derived credit remains the fallback. These claims do not link a GitHub account or change the authenticated principal, permissions, or publication credentials. Independently verified, host-selected GitHub identities remain available for mentions; proxy claims never create GitHub mentions. Updating alone does not reset existing Cloudflare/Tailscale GitHub credit when the new organization mapping is not enabled.
The related OIDC Profile fix prevents issuer-qualified sign-in subjects from appearing as default display names or linked email addresses, including after name/avatar saves. The underlying authentication aliases, binding IDs, profile IDs and role inputs remain intact. A deliberately chosen display name with the same HTTP(S)-URL-plus-subject shape is also hidden, without deleting its stored value; it can be replaced with a human-readable name. No database schema migration is introduced.
The implemented attribution layout shows the selected name/email inline beside the consent control, removes the separate Credit source row and the paragraph below the pair, and explains that Linked emails serve sign-in/profile linking rather than determining commit credit. Organization details use existing protected metadata. Verified public-GitHub credit uses a read-only self-profile projection derived from the verified account ID/login, sharing the actual trailer's noreply formatter. Enterprise commit addresses remain excluded from profile responses. Consent defaults and publication selection are unchanged.
Deployment compatibility
For existing Cloudflare Access and GitHub-backed Tailscale team Gateways, this remains additive when configuration is unchanged: updating alone does not require relinking or re-enabling existing Git co-author credit. Enabling the new organization mapping intentionally selects a new address source and requires disclosure consent. Current deployment-scope report.
The feature is configuration-gated, not exclusively multiplayer-gated. A single-person trusted-proxy deployment may opt in, and shared Profile UI/API and OIDC presentation improvements can affect single-user profiles too. Ordinary token/password owner installations gain no new personal co-author identity or authentication permissions. We do not claim zero changes outside multiplayer mode or a newly performed live Cloudflare/Tailscale upgrade test.
Why This Change Was Made
Our Keycloak proxy maps authenticated
name,email, andemail_verifiedclaims to overwritten upstream headers while preserving the issuer-qualified subject. OpenClaw accepts them only after successful trusted-proxy authentication. Missing/invalid configured claims clear imported details.Imported details are bound to their principal/credit-header mapping. A replacement mapping withholds previously imported details and requires renewed consent after refresh. Enabling credit atomically checks the organization details observed in Profile, including their absence. Inactive stored metadata does not block GitHub-fallback consent or silently revive later. Updates under an unchanged mapping retain the existing profile-wide preference.
The existing preference, profile, and attribution owners preserve merge opt-outs, participant/delegated attribution, incognito exclusions, publisher separation, and publication-time checks. One protected organization-metadata slot remains outside the 128 user-preference allowance.
The OIDC presentation repair addresses the misleading identity fields observed during live validation of this same Keycloak flow. Presentation normalization stays in the existing server profile owner; the shared browser display-name helper remains unchanged. Canonical authentication data is not filtered. The attribution layout reuses the existing Profile and settings components, with no new module, stylesheet, persistent state or authentication path.
Review Repairs
Evidence
Current integration:
0164d66f9c4d3c17c3d42f7fa8b8b1944842de56Rebased onto canonical main b10c9e1 to resolve the generated config-baseline conflict. The owning config-documentation generator regenerated the conflicting hash artifact and its canonical check passed; no hash was hand-computed or edited. Range-diff preserves all four contributor patches and the cleanup patch unchanged. The only feature-patch difference is the generated baseline hashes reflecting current main. Contributor authorship/sign-offs and Sally’s credit are preserved. Cleanup remains separate as 0164d66f9c4d, following feature-repair commit 4870fb5.
Rebased-head verification: 84 focused tests passed across eight files (attribution 11, documentation 10, import/admission 18, canonical profiles 13, Profile UI 32; 75.94 s wrapper wall time). Canonical config-documentation/protocol checks, UI typecheck and whitespace checks passed. The source checkout is clean. GitHub reported the new head mergeable after the exact-lease push; CI and security approval remain separate gates, not an all-green claim.
Earlier cleanup/main-integration checkpoint: b89c163bb68b
The five approved cleanups are published in a separate commit, 8ef6995e9398. It removes 11 production lines and 102 test lines across seven paths: temporary config-artifact emission is removed and the four documentation-key checks share the existing renderer; consent becomes local to the Profile identity read; protected object/null denial uses the canonical preference test; quota/admission cases retain 128 saved preferences, both transports, cross-transport refresh and consent preservation; and both GitHub-backed/organization-only UI cases retain the stronger consent assertions. Main at 0001c18 is included by merge commit b89c163bb68b094ae9d316b61bfc37e9091654fd, without rewriting the existing contributor or feature commits. There were no overlapping changed paths or merge conflicts; the exact lockfile remained unchanged. The cleanup commit is intentionally not squashed.
Integrated-head verification: 59 focused tests passed across six files (documentation 10, canonical profiles 13, admission 4, Profile UI 32; 70.96 s wrapper wall time). UI types, targeted lint, formatting/whitespace, canonical gateway:validators:check and config:docs:check passed; the generator checks changed no committed files. Fresh independent review found no actionable cleanup issue. These checks preserve the distinct contracts rather than deleting failed behavior tests. Broad new-head CI remains separate; importing main does not claim the earlier CI failures are fixed.
The PR now changes 62 paths versus the integrated main, down from 63 before cleanup. The published UI copy/layout is unchanged by cleanup; the general raw-Git prompt issue remains deferred to #197860.
The preceding 7fb8a615 revision changed only the Git co-author help wording from 7e57878990ef, retaining the upstream sentence structure while including organization-provided details. Keyless i18n, formatting and both public/Enterprise help browser scenarios passed again; the UI bundle built successfully. The layout/API source and earlier focused proof are otherwise unchanged. The separate no-credit prompt repair was considered but is not included, at Sally’s request to keep this PR focused.
The approved attribution layout is now implemented, not just a design preview. Independent source review found one stale assertion for the removed row; it was repaired to check the disabled switch, configuration guidance and absence of an inline identity. No additional correctness, privacy, Solid-reactivity or mutation-retention finding was reported. The browser fixture was also brought into line with the existing organization preference read and atomic consent precondition, and its public/Enterprise scenarios then passed.
After explicit task-scoped authorization, dependencies were installed offline from the exact frozen lockfile in the independently owned task checkout, without lifecycle scripts or changes to shared installs/live Gateway state. The canonical
pnpm gateway:validators:genrefreshed the committed validator;pnpm gateway:validators:checkpassed. The large generated diff is compiler checker/index renumbering plus the optional self-profile field, not hand-edited generated code. Keylesspnpm ui:i18n:baselinepassed; its raw-copy baseline stayed unchanged.Earlier focused proof on 7e57878990ef, before the cleanup and integration checks above:
users.test.ts: 45 passed; 45.73 s Vitest duration, 49.24 s tool wall time. This includes compiled-result validation for public-GitHub details and Enterprise-address exclusion.profile-page-coauthor.test.tsx: 12 passed; 3.38 s Vitest duration, 5.14 s wall time. Inline identity, sign-in/credit separation, consent, stale views and mutation projection retention are covered.git-coauthor-attribution.test.ts: 11 passed; 12.64 s Vitest duration, 14.44 s wrapper time. Existing organization, verified-account, participant and inherited-credit behavior passed.profile-page.e2e.test.ts: 2 passed, 9 explicitly unselected; 14.56 s Vitest duration, 17.29 s wall time. Their production UI bundle built successfully in 10.25 s. This is a mocked-Gateway browser boundary test, not a live Keycloak or publication replay.users.tsmax-lines limit: the prior published file already had 742 physical lines against a 700-line rule; this delta adds ten physical lines. No limit override or unrelated size-only extraction was introduced.Simplification removes the separate source row and reuses the existing Profile/projection owners and raw binding APIs. The earlier layout update modified 13 paths already in the PR and added the browser-test helper path and allocation record (61 → 63 paths); cleanup subsequently reduced the changed-file set to 62. No manual identity editor, parallel store, database migration or stylesheet was added.
The current linear history retains four Russell Bryant-authored commits, one RoboClaw/Sally feature-repair commit and the separate cleanup commit. The rebase changed commit IDs, not contributor authorship or the source/test patches; the earlier main-merge checkpoint above is historical. Fresh managed-writer and actual fork-head checks preceded the force-with-lease update against b89c163, and the fork/PR head were read back at the SHA above. No merge into main or release was performed.
Refreshed implemented-layout/OIDC screenshots and live results for 7e57878990ef, before the help-copy-only revision above, are recorded in the existing maintainer evidence comment, replacing the earlier run. That refresh includes a retained failed raw-Git assertion; it is not an all-green claim. Current-head CI is tracked separately. No repository hook code was executed.
CI findings on preceding integrations
Run 43259466349 completed red on preceding head
6a561ab7134572f3167c0dcaa11d641b685b959c. Its failed Gateway shard reported a 30-second timeout inserver.auth.guest-dictation.test.ts; no matching-main attribution or proven repair is claimed. The workflow-size shard and aggregate gate also failed. This is prior-head evidence, not the current head's result.Run 43254633341 belongs to earlier head
9ba4f766ef653070ab85f5f4f514b65c541dee94.users.selfcorrectly returned no opaque principal inemails, while the test expected one. The committed assertion matches actual-email-only presentation and separately proves the principal binding survives.7b75336b789cae240bb82caa931ff7387e04e46acontains the same 480,352-byteci.ymlreported by the failure against its 480,000-byte guard. This PR changes neither the workflow nor the guard. The exact base Git objects and assertion were inspected without rebasing; this is an attributed upstream failure, not a reason to alter unrelated workflow policy here.Maintainer live validation and screenshots
Refreshed evidence and inspected synthetic-identity screenshots now cover
7e57878990ef52f77a5314cbd36eff81aa9b2ade, replacing the prior-head run. Fresh Keycloak OIDC/proxy/Gateway state and real model turns verified the implemented inline layout, disclosure help, consent off → on → off commits, and opaque-subject/empty-Linked-emails suppression after name/avatar saves and reloads. Shared-task commits credited only the consenting participant, then only the other participant after consent reversal. Mapping replacement disconnected the old connection, canceled its queued save and required renewed consent.A fresh verified-backup/package/Doctor upgrade from stable
2026.11.3retained both profile IDs and saved choices. First organization import preserved the opt-out and reset the prior opt-in. Synthetic stable preferences were seeded through the authenticated API with explicit maintainer authorization. The baseline screenshot is a genuine stable-release capture, not an off-state labeled before.Retained failure: the separate-task no-trailer assertion failed. Alice remained opted out and the production attribution resolver returned no credit, but the model read earlier repository history and explicitly added Alice's trailer through raw Git. Bob's credit did not leak. No passing replay, product fix or all-green live result is claimed. The ordinary-task empty-credit prompt branch and direct-Git boundary also exist in upstream base 8864d27. This is a pre-existing agent/prompt limitation, not evidence that the new proxy resolver ignored consent or leaked Bob’s profile credit. It is tracked separately in #197860, filed on behalf of @sallyom; no prompt fix, Git wrapper or hook is added to this PR. The failure did not require mid-session revocation.
The disconnect still prevents exercising a delivered stale save's atomic-conflict response live. Broker-managed publication and GitHub-rendered attribution remain untested. Prior-head ClawSweeper conclusions do not automatically cover this refreshed result. Fixed asset-size budget violations remain in the refreshed UI build output; CI findings above remain separate.
Earlier CI and canonical configuration metadata
Run 43229841343 completed on
c74e47e5425b0a6737fcf4c190216438ef3523d3. Selected Node/runtime, UI, UI-E2E, docs and baseline-ratchet jobs passed. Android Access 16-KiB job 131222856333 failed resolving Gradle/Maven buildscript dependencies before tests, leaving the aggregate CI gate red. The PR changes no Android/Gradle inputs, workflows, CI scripts or root package/lock files. The classifier called it new because matching main passed; no matching-main failure, persistent source regression or general Maven outage is claimed. This is historical evidence, not a current green run.The original docs/ratchet failures were PR-caused stale generated metadata, not upstream noise. Four core documentation entries change 2,647 to 2,651. Owning integration job 131196831664 emitted the exact canonical hash/count bytes used in the committed files; they were not manually calculated. The earlier rebase incorporated upstream lifecycle fixture fix #197738, with an identical scheduled-main assertion. The original eight patches were patch-identical across that rebase before the later squash and OIDC addition.
No merge or release is requested. Current-head maintainer/security approval and required CI still govern readiness.