Skip to content

test(access): pin the client queue path, and apply the guard at the third buildConfig site - #858

Merged
sydevs-bot merged 5 commits into
mainfrom
claude/fix-857-pin-client-job-queue
Sep 29, 2026
Merged

sydevs-bot merged 5 commits into
mainfrom
claude/fix-857-pin-client-job-queue

Conversation

@sydevs-bot

Copy link
Copy Markdown
Contributor

Stacked on #857, targeting its branch. Adopts two review threads there. One commit each.

jobs.access.queue is admin-only, and the intake path is a client's

enqueueSubmissionScreening forwards the submitting client's req with no overrideAccess, so every Atlas and app form submission rests on Payload defaulting it to true (payload/dist/queues/localAPI.js: args?.overrideAccess !== false). That default is a library internal, and no spec named it.

payload-system-access.int.spec.ts gains one case: a contact submission posted over REST with a published sahaj-atlas-client key, asserting the screenSubmission job row appears. Reintroducing the defect — overrideAccess: false in the hook — fails that case and only that case.

The existing user-submissions-create spec does exercise the path today, since every create there starts at pending and fires the hook. It just fails opaquely, and names nothing.

The third buildConfig call site

seeds/tests/test-payload.config.ts also calls buildConfig and did not apply restrictPayloadSystemEntities, while the docblock and docs/rules/access.md both said there were two sites. Harmless today — no plugins, never served — but prose is the only enforcement, so it now names three and the grep that counts them.

A wrapper owning buildConfig(...).then(restrictPayloadSystemEntities) was considered and rejected: a fourth site can still call buildConfig directly, so the wrapper moves the coupling without closing it.

Third commit answers the fourth thread: a line saying the SYSTEM_COLLECTIONS table is the inventory, not a rule the ?? fallback would already supply.

Verification

npx tsc --noEmit and -p tsconfig.test.json clean, eslint clean on the changed files, payload-system-access.int.spec.ts 15 passed.

Not run here: the full unit lane and pnpm build. CI covers both.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Tk5jpo777wbp6Vqqi7EnNR


Generated by Claude Code

antontcymbal and others added 4 commits September 28, 2026 19:23
…s to API clients

Payload appends payload-jobs, payload-jobs-stats, payload-locked-documents,
payload-preferences, payload-migrations and payload-kv after every plugin has
run, so accessPlugin never saw them, and most kept Boolean(user) access. A
published client key could queue or rewrite jobs, call /api/payload-jobs/run,
overwrite the job-stats global, create document locks, and PATCH another
user's preference row into its own. jobs.access (run/queue/cancel) had the
same default.

restrictPayloadSystemEntities sets their access on the sanitized config, at
both buildConfig call sites: admins only for jobs, migrations, job stats and
jobs.access; active managers for locks; managers' own rows for preferences,
including the /:key endpoints that skip access. An unlisted payload-* entity
defaults to admins only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`seeds/tests/test-payload.config.ts` is a third `buildConfig` call site and
did not apply `restrictPayloadSystemEntities`, while the docblock and
docs/rules/access.md both said there were two. Harmless today — that config
registers no plugins and is never served — but the rule is enforced by prose
alone, so the prose has to be right.

A wrapper owning `buildConfig(...).then(...)` would not close this: a fourth
site can still call `buildConfig` directly. Naming the sites and the grep is
what a reader can act on.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Tk5jpo777wbp6Vqqi7EnNR
`jobs.access.queue` is admin-only now, and the one production path that
queues a job — `enqueueSubmissionScreening` — forwards the submitting
client's `req` with no `overrideAccess`. Every Atlas and app form submission
therefore rests on Payload defaulting `overrideAccess` to `true`, a library
internal no spec named.

The case posts a contact submission over REST with a published
`sahaj-atlas-client` key and asserts the `screenSubmission` job row appears.
Reintroducing the defect (`overrideAccess: false` in the hook) fails this
case and only this case.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Tk5jpo777wbp6Vqqi7EnNR
`payload-jobs` and `payload-migrations` map to the same policy the `??`
fallback already supplies, so a reader cannot tell whether the entries are
load-bearing or leftovers. They are the inventory of what Payload ships
today; the fallback is for what a future version adds.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Tk5jpo777wbp6Vqqi7EnNR
@railway-app

railway-app Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-858 environment in sahajcloud

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Sep 29, 2026 at 3:56 am UTC
1 service not affected by this PR
  • mailpit

@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-858 September 28, 2026 23:19 Destroyed
Base automatically changed from fix/payload-system-entities-access to main September 29, 2026 03:47
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Sep 29, 2026
@sydevs-bot

sydevs-bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 03:48Z resolve-conflicts · attempt 1 · session · done
  • 03:48Z resolve-conflicts · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot

sydevs-bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 resolve-conflicts · started 03:48Z · attempt 1 · session

recent dispatches
  • 03:48Z resolve-conflicts · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

#857 squash-landed as c6511bc, so this branch's copy of its commit shares no
ancestry with main's and every file it added came back as an add/add.

main's `systemEntities.ts` and `payload-system-access.int.spec.ts` are
byte-identical to this branch's base, so taking this side loses nothing — it
is that same content plus the three commits here. `docs/rules/access.md`
conflicted on the one line #858 rewrites ("both call sites" to "every call
site"); main's side was the pre-#858 wording. #853's edit to that file
elsewhere merged clean and is kept.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01D33Z68cuaxB8VpGSwhgkjY
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Merged main in and pushed 736cddc. #857 squash-landed, so this branch's copy of its commit shares no ancestry with main's and both files it added came back as add/add.

Took this side on all three hunks. Main's systemEntities.ts and payload-system-access.int.spec.ts are byte-identical to this branch's base, so that loses nothing — same content plus the three commits here. docs/rules/access.md conflicted only on the line this PR rewrites ("both call sites" to "every call site"); main's side was the pre-#858 wording. #853's edit further up that file merged clean and is kept.

Re-ran the grep the new docblock cites: still three real buildConfig sites, all three applying the guard.

Lean gate green, payload-system-access.int.spec.ts 15 passed.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot added awaiting and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Sep 29, 2026
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-858 September 29, 2026 03:56 Destroyed
@sydevs-bot
sydevs-bot added this pull request to the merge queue Sep 29, 2026
Merged via the queue into main with commit 6ad5fdd Sep 29, 2026
22 checks passed
@sydevs-bot
sydevs-bot deleted the claude/fix-857-pin-client-job-queue branch September 29, 2026 04:37

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-858 — 736cddcd Deployed Sep 29, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

4 participants