Access callbacks allow only on a literal true (owner's decision for 1.18.0), strictAccessAnswers: false for the old reading; the new 1.18.0 security options checked strictly at start; docs, skills, changelog
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
d90825a396
commit
c6bfb621f5
@@ -80,6 +80,19 @@ export function assertPluginSwitches(options: Record<string, unknown>): void {
|
||||
assertSwitchOrObject(name, options[name])
|
||||
}
|
||||
assertBooleanSwitch('indexNow', options.indexNow)
|
||||
// 1.18.0 (security audit): `listLimit: 0` / `'false'` must not read as off; a max below 1 caps every list to nothing
|
||||
assertSwitchOrObject('listLimit', options.listLimit, { allowTrue: false })
|
||||
const listLimit = bag(options.listLimit)
|
||||
if (listLimit) {
|
||||
assertNumberSwitch('listLimit.max', listLimit.max, { min: 1 })
|
||||
assertBooleanSwitch('listLimit.staff', listLimit.staff)
|
||||
if (listLimit.exclude !== undefined && !(Array.isArray(listLimit.exclude) && listLimit.exclude.every((c) => typeof c === 'string'))) {
|
||||
throw new Error(`${where('listLimit.exclude')} must be a list of collection slugs such as ['products'] (received ${JSON.stringify(listLimit.exclude)}).`)
|
||||
}
|
||||
}
|
||||
assertBooleanSwitch('refuseOperatorSort', options.refuseOperatorSort)
|
||||
assertSwitchOrObject('lockedDocuments', options.lockedDocuments, { allowTrue: false })
|
||||
assertBooleanSwitch('strictAccessAnswers', options.strictAccessAnswers)
|
||||
// 1.17.2: `adminSameOrigin: 0` / `'false'` must not read as off (it took the origin check off the panel actions)
|
||||
assertSwitchOrObject('adminSameOrigin', options.adminSameOrigin)
|
||||
const adminSameOrigin = bag(options.adminSameOrigin)
|
||||
|
||||
Reference in New Issue
Block a user