GeezerVison is showing github.com — feat(aggregator): config-gated Access-JWT author derivation for writes (#1253, salvage of #7383) by dezren39 · Pull Request #8645 · developing-today/code
Conversation
dezren39
commented
Nov 11, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Salvage re-application of the remainder of closed archive PR #7383 (task 14941, batch issue #7297) — the aggregator slice of #1253 (design tracker #1253 stays open; this is the aggregator-only slice, as in the original).
What
- New
pm-stack/aggregator/src/access-identity.ts: config-gated Cloudflare Access JWT author derivation for aggregator writes. When PM_AGG_ACCESS_TEAM_DOMAIN and PM_AGG_ACCESS_AUD are set, write endpoints validate Cf-Access-Jwt-Assertion against the team JWKS and derive the DashAuthor from verified claims (sub/email), never from the caller-supplied author. drew kind only when the verified identity is in the PM_AGG_OWNER_IDS allowlist; contradictory asserted drew → 403; invalid token → 401. Fail-closed: Access configured but allowlist unset/empty → all drew-kind authors rejected; non-drew kinds still derive from the verified JWT. Access unconfigured → byte-identical legacy behavior (accepted risk per aggregator(dashboard): comment API accepts self-asserted author identities — anyone can post as Drew into the orchestrator/GitHub flow (PR #920) #941).
server.ts: enforceAccessAuthor wired into all four write paths — roadmap annotations, comments, actions, and the batch-actions loop (per-item error in the batch case) — +22 lines, mirroring the archive wiring at the current handler sites.
- New
pm-stack/aggregator/test/access-identity.test.ts (7 tests).
Not re-applied: the archive's coverage-snapshot.json (a runtime data seed swept into the janitor archive, not source) and .pr-body-4964.md (PR-body scratch).
Tests (laptop, this branch)
bun test test/access-identity.test.ts — 7 pass / 0 fail.
- Full aggregator suite: 2047 pass / 19 fail — every identified failing suite (projects, orchestration, quota, source-gate-1195, actions hook timeout) produces identical results on a pristine worktree of the same base commit (e.g. 87 pass / 6 fail on the four named files, both sides): pre-existing environmental failures, none in the touched paths.
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chatgpt-codex-connector[bot] reacted with thumbs up emoji
#1253)
Salvage re-application of the remainder of closed archive PR #7383 (task 14941, issue #7297): new pm-stack/aggregator/src/access-identity.ts (Cf-Access-Jwt-Assertion verification against the team JWKS when PM_AGG_ACCESS_TEAM_DOMAIN + PM_AGG_ACCESS_AUD are set; author derived from verified claims, drew kind only for PM_AGG_OWNER_IDS allowlist, fail-closed when the allowlist is empty, inert legacy path when unconfigured) wired via enforceAccessAuthor into the four aggregator write paths in server.ts (roadmap annotations, comments, actions, batch actions), with test/access-identity.test.ts. The archive coverage-snapshot.json (runtime data seed) and .pr-body-4964.md (scratch) are not source and are not re-applied.
coderabbitai
Bot
commented
Nov 11, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 3 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
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:
338643c6-7c3d-43db-ada9-437ee9c02174
Commits
-
Reviewing files that changed from the base of the PR and between a3cc79e and e4dda6e.
Files selected for processing: 3
-
pm-stack/aggregator/src/access-identity.ts
pm-stack/aggregator/src/server.ts
pm-stack/aggregator/test/access-identity.test.ts
- 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
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-11-11T10:50:59.338385Z |
e4dda6e |
New commits |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 991f935961
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…standing drew identity
Codex P2s on PR #8645: (1) the batch loop re-verified the same request JWT per action — with a cold JWKS cache or a failing certs endpoint a 100-action batch could stack ~100 sequential 5s timeouts reporting the same 401. New createAccessAuthorEnforcer memoizes the verification (identity or 401) per request while derivation, including the per-item contradictory-drew 403, still runs per item; the batch loop uses one enforcer and enforceAccessAuthor delegates to it. New test: certs endpoint down, 3 enforcer calls, exactly 1 fetch. (2) The verified owner derived author id = email/sub, which re-keys saved views (ownerKey drew:drew matched exactly by ViewsStore) and all pre-Access drew authorship the day Access is enabled. The allowlisted owner now derives the standing drew identity {kind:drew, id:drew, label:Drew} from registry.ts; the allowlist check is what authorizes it.
|
Both P2s fixed in e4dda6e:
Verify once per batch: new createAccessAuthorEnforcer(req, env, fetch) in access-identity.ts memoizes the request's JWT verification — the verified identity or the 401 failure is computed at most once per enforcer, while deriveAuthorFromAccess (including the per-item contradictory-drew 403) still runs per call. The batch loop in server.ts now creates one enforcer for the whole request; enforceAccessAuthor delegates to the same enforcer for single writes. New test: certs endpoint down, three enforcer calls return the same 401 with exactly 1 JWKS fetch attempt. Focused suite: 8 pass / 0 fail.
Saved-view ownership: the allowlisted owner now derives the standing drew identity { kind: "drew", id: "drew", label: "Drew" } (the registry.ts identity), instead of id = email/sub. The allowlist check is what authorizes the mapping — caller-supplied authors are still never trusted — and ownerKey stays drew:drew, so the verified owner keeps rename/remove/setDefault over pre-Access saved views (and pre-Access drew authorship on comments/actions stays continuous). The derivation test's expectation is updated to the standing identity.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Salvage note (task 13372, lane any-b, 2026-11-13): duplicate PR #4882 diffed against this canonical PR — nothing unique to salvage.
Shepherding PR #4882 (queue/4964-1253-access-authorship, the same #1253 Access-JWT slice) required a pairwise diff against this PR's landed version before any close, per the fleet's duplicate protocol. Result of the full three-file diff (access-identity.ts, server.ts, access-identity.test.ts):
Nothing unique exists in PR #4882 to port. It is being closed as superseded by this PR, with the reason recorded on it and on batch issue #7297.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 13, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|