1.17.2 (owner's Q1-Q3): form submissions over REST for staff only; Payload's job queue for an admin or Bearer CRON_SECRET; doctor visitor-writes; explicit write rules on the reference site

- form-submissions create: a staff account with its second factor (formSubmissionOverrides.access.create keeps the way back)
- jobsRunAccess (default on when the project writes no jobs.access.run): admin with the second factor or Bearer CRON_SECRET (16+); start-up note when the secret is missing; jobsRunAccess: false keeps Payload's default
- iapl-doctor deep rule visitor-writes: entities a visitor login account may write, asked by behaviour
- reference: Pages, Posts, CaseStudies, Media, Header, Footer, Company get adminOrEditor write rules
- closed doors: submissions, pages, media, header, company closed for customers; the fixture's job queue refused without the secret, run with it
- route snapshot reasons, docs, AGENT.md, skills, changelog draft 1.17.2

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-12-01 10:44:18 +01:00
co-authored by Claude Opus 5.5
parent fc70a34f3e
commit 4e68b7e44a
40 changed files with 657 additions and 187 deletions
+13 -1
View File
@@ -203,6 +203,18 @@ describe('M1 rules: access-missing, turnstile-degraded, turnstile-env-key', () =
expect(await run(cfg, ['open-signup'])).toEqual([])
})
test('visitor-writes: one warning per entity a visitor account may write, its operations named', async () => {
const cfg = "iapl({ access: { authCollection: 'users' } })"
const report = await doctor(project({ ...base(), 'src/payload.config.ts': cfg }), ['visitor-writes'], { deepStatus: { visitorWrites: ['globals/header:update', 'pages:create', 'pages:delete', 'pages:update'] } })
expect(report.findings.map((f) => `${f.severity}: ${f.message}`)).toEqual([
'warning: an account of a visitor login collection may update the global "header"',
'warning: an account of a visitor login collection may create, delete, update in "pages"',
])
expect(await run(cfg, ['visitor-writes'], { visitorWrites: [] })).toEqual([])
expect(await run(cfg, ['visitor-writes'], { visitorWrites: null })).toEqual([])
expect(await run(cfg, ['visitor-writes'])).toEqual([])
})
test('staff-accounts-open: a staff collection an account of another collection may write to is an error', async () => {
const cfg = "iapl({ access: { authCollection: 'users' } })"
expect(await run(cfg, ['staff-accounts-open'], { staffOpenToOthers: ['agents:delete', 'agents:update', 'users:create'] })).toEqual(['staff-accounts-open:error', 'staff-accounts-open:error', 'staff-accounts-open:error'])
@@ -529,7 +541,7 @@ describe('security and deep status', () => {
}
const status = await collectDoctorStatus(payload as never)
expect(status).toMatchObject({ pendingCookies: 4, usersWithout2fa: 2 })
expect(Object.keys(status).sort()).toEqual(['mail', 'node', 'openSignUp', 'pendingCookies', 'plugin', 'staffOnOwnRoles', 'staffOpenToOthers', 'turnstile', 'turnstileSecretFromEnv', 'usersSetupClosed', 'usersWithout2fa'])
expect(Object.keys(status).sort()).toEqual(['mail', 'node', 'openSignUp', 'pendingCookies', 'plugin', 'staffOnOwnRoles', 'staffOpenToOthers', 'turnstile', 'turnstileSecretFromEnv', 'usersSetupClosed', 'usersWithout2fa', 'visitorWrites'])
expect(status.usersSetupClosed).toBeNull() // no setup window in this config
expect(status.mail).toBeNull() // no Site integrations global in this config
})