Merge local main (1.17.2) into security-a-118
Conflicts resolved by keeping both sides: lockedAnswer + sign-in rules in plugin.ts and switches.ts, IPv6 grouping in the mail service's new per-visitor address count, both built-site specs in e2e:built, docs and skills (reference copies synced). The lockedAnswer suite and the sign-in-answers spec now reach Payload's lock the 1.18.0 way: a spray from 50 IPs, one failure each (one IP alone gets 429 after five). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -50,9 +50,11 @@ export function assertPluginSwitches(options: Record<string, unknown>): void {
|
||||
// `accounts: 0` / `''` dropped every account rule (staff-only reads, admin-only writes, the panel role,
|
||||
// the password rule, the closed first-user route).
|
||||
assertSwitchOrObject('accounts', options.accounts, { allowTrue: false })
|
||||
// 1.17.2: only 'payload' brings Payload's "locked" answer back (it tells which addresses have an account).
|
||||
// 1.18.0: the sign-in rules. `signInLimit: 0` / `'false'` must not read as off; a limit of 0 never refuses.
|
||||
const accounts = bag(options.accounts)
|
||||
if (accounts) {
|
||||
assertOneOf('accounts.lockedAnswer', accounts.lockedAnswer, ['payload', 'wrong'])
|
||||
assertBooleanSwitch('accounts.confirmOwnChanges', accounts.confirmOwnChanges)
|
||||
assertSwitchOrObject('accounts.signInLimit', accounts.signInLimit, { allowTrue: false })
|
||||
const limit = bag(accounts.signInLimit)
|
||||
@@ -78,6 +80,12 @@ export function assertPluginSwitches(options: Record<string, unknown>): void {
|
||||
assertSwitchOrObject(name, options[name])
|
||||
}
|
||||
assertBooleanSwitch('indexNow', options.indexNow)
|
||||
// 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)
|
||||
if (adminSameOrigin && adminSameOrigin.origins !== undefined && !(Array.isArray(adminSameOrigin.origins) && adminSameOrigin.origins.every((o) => typeof o === 'string'))) {
|
||||
throw new Error(`${where('adminSameOrigin.origins')} must be a list of origins such as ['https://panel.example.com'] (received ${JSON.stringify(adminSameOrigin.origins)}).`)
|
||||
}
|
||||
// an unknown name ('IAPL') used to mean 'ipal': the scanner declared one visitor cookie while the site set another
|
||||
assertOneOf('storageNames', options.storageNames, ['ipal', 'iapl'])
|
||||
assertBooleanSwitch('lightbox', options.lightbox)
|
||||
|
||||
Reference in New Issue
Block a user