Security audit fixes for 1.18.0: Markdown negotiation private + Vary: Accept (F3), public lists capped (F4), operator sort names refused (F5), CSP report log normalised and capped (F1), buildUrlField and the reference socials (F2), document locks for staff only
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
d2f19095dc
commit
e9f9947eb7
@@ -11,6 +11,7 @@ import { describe, expect, test, vi } from 'vitest'
|
||||
|
||||
import { adminOrEditor } from '../src/modules/access/access.js'
|
||||
import { visitorWritableEntities } from '../src/modules/doctor/visitorWrites.js'
|
||||
import { applyLockedDocumentsAccess } from '../src/modules/security/queryGuard.js'
|
||||
import { iapl } from '../src/plugin.js'
|
||||
import { buildTestConfig } from './helpers.js'
|
||||
|
||||
@@ -49,6 +50,13 @@ describe('visitorWritableEntities', () => {
|
||||
}
|
||||
}, 30_000)
|
||||
|
||||
test('Payload\'s document locks are not listed once iapl\'s staff-only rule is on (lockedDocuments, 1.18.0)', async () => {
|
||||
const config = await build([{ slug: 'customers', access: { create: () => false }, auth: true, fields: [] }])
|
||||
expect(await visitorWritableEntities(live(config))).toContain('payload-locked-documents:create')
|
||||
applyLockedDocumentsAccess(config)
|
||||
expect((await visitorWritableEntities(live(config))).filter((e) => e.startsWith('payload-locked-documents'))).toEqual([])
|
||||
}, 30_000)
|
||||
|
||||
test('a site with only the staff login collection: nothing to report', async () => {
|
||||
const config = await build([{ slug: 'pages', access: { read: () => true }, fields: [{ name: 'title', type: 'text' }] }])
|
||||
expect(await visitorWritableEntities(live(config))).toEqual([])
|
||||
|
||||
Reference in New Issue
Block a user