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:
co-authored by
Claude Opus 5.5
parent
fc70a34f3e
commit
4e68b7e44a
@@ -36,7 +36,7 @@ async function signIn(caller: Caller, baseURL: string, playwright: { request: {
|
||||
async function ask(api: APIRequestContext, door: (typeof DOORS)[number]): Promise<DoorAnswer> {
|
||||
const res = door.graphql
|
||||
? await api.post('/api/graphql', { data: { query: door.graphql } })
|
||||
: await api.fetch(door.path!, { data: door.body, maxRedirects: 0, method: door.method ?? 'GET' })
|
||||
: await api.fetch(door.path!, { data: door.body, headers: door.headers, maxRedirects: 0, method: door.method ?? 'GET' })
|
||||
const text = await res.text()
|
||||
let body: unknown = text
|
||||
try {
|
||||
@@ -72,6 +72,16 @@ for (const caller of ['anonymous', 'customer', 'editor'] as const) {
|
||||
})
|
||||
}
|
||||
|
||||
test.describe('closed doors: the cron secret opens the job queue (IAWL idea 35, 1.17.2)', () => {
|
||||
test('Authorization: Bearer <CRON_SECRET> runs the queue; nothing else changes', async ({ baseURL, playwright }) => {
|
||||
test.skip(lateStaff !== '1' || !process.env.CRON_SECRET, 'needs the fixture\'s job queue (E2E_LATE_STAFF=1) and CRON_SECRET (pnpm e2e:built sets both)')
|
||||
const cron = await playwright.request.newContext({ baseURL, extraHTTPHeaders: { authorization: `Bearer ${process.env.CRON_SECRET}` } })
|
||||
const res = await cron.get('/api/payload-jobs/run?limit=1')
|
||||
expect([res.status(), await res.text()]).toEqual([200, expect.any(String)])
|
||||
await cron.dispose()
|
||||
})
|
||||
})
|
||||
|
||||
test.describe('closed doors: the proxy skips /api, /admin and /_next as whole segments only (IAWL idea 36)', () => {
|
||||
test('the admin and the API are not sent to a locale; a page that only starts with those letters is', async ({ request }) => {
|
||||
for (const path of ['/admin', '/api/health']) {
|
||||
|
||||
Reference in New Issue
Block a user