1.18.0 upgrade notes

PROGRAMISTA §6 rows 83–87 now 1.18.0 (1.17.2 was never released alone) and new rows 88–94; iapl-upgrade blocks for
speed and growth and for drafts in related documents, the 1.17.2 blocks as "→ 1.18.0 (from 1.17.2)"; every "since
1.17.2" in docs, comments and tests reads 1.18.0; reference skills, AGENTS.md and the reference index on 1.18.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-12-02 09:38:00 +01:00
co-authored by Claude Opus 5.5
parent af98cfba96
commit 9b83cc600a
53 changed files with 231 additions and 184 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ export const READ_PUBLISHED = Symbol.for('iapl.readPublished')
*
* For `read`. Version history (`readVersions`) asks for the status at another path (`version._status`): use
* `readPublishedVersions()` there. Given to `readVersions` of a collection or global that iapl() sees, this rule
* is swapped for `readPublishedVersions()` with the same role (1.17.2; in 1.17.1 it answered 500 there).
* is swapped for `readPublishedVersions()` with the same role (1.18.0; in 1.17.1 it answered 500 there).
*
* access: { read: readPublished(), readVersions: readPublishedVersions() }
*/
+1 -1
View File
@@ -5,7 +5,7 @@ import { AuthenticationError, formatNames, toWords } from 'payload'
import { staffCollectionSlugs } from './predicates.js'
/**
* A locked staff account answers its login exactly like a wrong password (`accounts.lockedAnswer`, 1.17.2).
* A locked staff account answers its login exactly like a wrong password (`accounts.lockedAnswer`, 1.18.0).
*
* Payload checks the lock BEFORE the password: after five wrong passwords for `owner@site` any password gets
* `401 "This user is locked due to having too many failed login attempts."` (GraphQL: `LockedAuth`), while an
+1 -1
View File
@@ -59,7 +59,7 @@ export type AccountsOptions = {
firstUserRoute?: 'all' | 'panel' | string[]
/**
* What a staff account that Payload has locked (too many wrong passwords) is told when it logs in.
* Default (1.17.2): exactly what a wrong password gets — same status, message and GraphQL error name — so
* Default (1.18.0): exactly what a wrong password gets — same status, message and GraphQL error name — so
* nobody can find out which addresses have a staff account by locking them. The lock itself is unchanged.
* `'wrong'` = the default, said out loud. `'payload'` = Payload's own "This user is locked due to having too many failed login attempts."
*/
+4 -4
View File
@@ -9,14 +9,14 @@ import { COOKIE_BUTTON_RESERVE, cookieButtonSpaceScript, reserveCookieButtonSpac
import { consentDecidedScript } from './firstPaint.js'
/**
* The site footer: the selector of the placement before 1.17.2, when the button moved up by the visible part of
* The site footer: the selector of the placement before 1.18.0, when the button moved up by the visible part of
* the footer. `<CookieButton avoid={COOKIE_BUTTON_AVOID} />` brings that placement back.
*/
export const COOKIE_BUTTON_AVOID = 'footer, [role="contentinfo"]'
export type CookieButtonProps = {
/**
* Placement before 1.17.2: a CSS selector of elements the button lifts above while they are on screen
* Placement before 1.18.0: a CSS selector of elements the button lifts above while they are on screen
* (`COOKIE_BUTTON_AVOID` = the site footer; no room is reserved then). Default: none — the button stays in the
* bottom corner of the window and never moves. `false` = the same as the default (kept for sites that set it).
*/
@@ -40,10 +40,10 @@ export type CookieButtonProps = {
* after deciding (GDPR: withdrawing consent must be as easy as giving it).
* Hidden while the banner is showing.
*
* Placement (1.17.2): fixed in the bottom corner of the window, on every page and at every scroll position. It
* Placement (1.18.0): fixed in the bottom corner of the window, on every page and at every scroll position. It
* never moves — it does not climb above the footer any more. So that it covers nothing at the very end of a page,
* the footer gets room under its last row while the button is shown (`reserve`, cookieButtonSpace.ts). The
* placement before 1.17.2 (riding on the footer's top edge): `avoid={COOKIE_BUTTON_AVOID}`.
* placement before 1.18.0 (riding on the footer's top edge): `avoid={COOKIE_BUTTON_AVOID}`.
*
* Colours follow the same design tokens as CookieBanner (--ipal-surface,
* --ipal-border, --ipal-hover, --ipal-text). Position: --ipal-cookie-button-offset
+1 -1
View File
@@ -1,5 +1,5 @@
/**
* Room for the cookie button at the end of the page (1.17.2).
* Room for the cookie button at the end of the page (1.18.0).
*
* The button is fixed in the bottom corner of the window and never moves. At the very end of a page whatever is in
* that corner — usually the footer's last row — would stay under it for good. So while the button is shown, the
+2 -2
View File
@@ -231,7 +231,7 @@ export const securityRules: DoctorRule[] = [
{
// Payload accepts the login cookie from ANY origin while its `csrf` list is empty — and it is empty
// unless `csrf` or `serverURL` is set. A page on a sibling subdomain can then act with a panel user's cookie.
// The plugin's own-origin checks (2FA verify / setup / reset, the panel actions — 1.17.2) then know the site
// The plugin's own-origin checks (2FA verify / setup / reset, the panel actions — 1.18.0) then know the site
// only from the request's Host: behind a proxy that rewrites it, the site's own panel would be refused.
id: 'csrf-empty',
check: (ctx) => {
@@ -264,7 +264,7 @@ export const securityRules: DoctorRule[] = [
},
{
// An account of a visitor login collection (customers, members) may write content or settings: Payload fills a
// missing rule with "any signed-in account", and the plugin narrows only its own entities (owner's Q3, 1.17.2).
// missing rule with "any signed-in account", and the plugin narrows only its own entities (owner's Q3, 1.18.0).
id: 'visitor-writes',
check: (ctx) => {
const byEntity = new Map<string, string[]>()
+1 -1
View File
@@ -109,7 +109,7 @@ export type DoctorStatus = {
/** Auth collections whose `create` rule lets an anonymous request through (slugs only). */
openSignUp?: null | string[]
/**
* The running config has a `serverURL` (1.17.2), or a non-empty `csrf` list. Without either Payload takes the
* The running config has a `serverURL` (1.18.0), or a non-empty `csrf` list. Without either Payload takes the
* login cookie from any origin, and the plugin's own-origin checks know the site only from the request's host.
*/
originKnown?: boolean
+1 -1
View File
@@ -164,7 +164,7 @@ const withHint = (key: 'email' | 'number' | 'text' | 'textarea') => withShowWhen
/**
* REST/GraphQL: a staff account (any role) with its second factor. Local API (submitForm) is unaffected. Before
* 1.17.2 any signed-in account was enough — a customer of a visitor login collection could POST
* 1.18.0 any signed-in account was enough — a customer of a visitor login collection could POST
* /api/form-submissions past the rate limit, Turnstile, consent and validation, and the form's e-mails went out.
* `formSubmissionOverrides.access.create` is the way back.
*/
+1 -1
View File
@@ -7,7 +7,7 @@ import { RELAY_CONNECT_LINK_PATH, RELAY_CONNECT_PATH, RELAY_DISCONNECT_PATH } fr
import { reportRefusedOrigin, requestFromOwnOrigin } from './totp/sameOrigin.js'
/**
* The plugin's panel actions only from the site's own origin (`adminSameOrigin`, 1.17.2; IAWL idea 7, owner's Q6).
* The plugin's panel actions only from the site's own origin (`adminSameOrigin`, 1.18.0; IAWL idea 7, owner's Q6).
*
* These endpoints act with the panel's login cookie and read a body whatever its `Content-Type` says — a
* `text/plain` POST, which another origin can send without a CORS preflight. A page on a sibling subdomain is
+2 -2
View File
@@ -7,7 +7,7 @@ import { userMeetsRole } from '../access/predicates.js'
/**
* Who may run Payload's job queue over HTTP (`GET /api/payload-jobs/run`, `/api/payload-jobs/handle-schedules`,
* both checked by `jobs.access.run`). Payload's own default is any signed-in account of ANY auth collection — a
* customer of a shop included (IAWL idea 35: a route open to the web is a visitor, not the system). Since 1.17.2,
* customer of a shop included (IAWL idea 35: a route open to the web is a visitor, not the system). Since 1.18.0,
* when the project writes no `jobs.access.run`, iapl sets: an admin signed in with the second factor (an admin's API
* key counts), or `Authorization: Bearer <CRON_SECRET>`. A project's own rule always wins; `jobsRunAccess: false`
* keeps Payload's default. Jobs run in-process (`jobs.autoRun`, `payload jobs:run`, `payload.jobs.run()`) never
@@ -71,7 +71,7 @@ export function jobsRunNotice(config: { custom?: unknown; jobs?: { enabled?: boo
if (secret.length >= CRON_SECRET_MIN_LENGTH) {return null}
return (
`[iapl] Payload's job queue runs over HTTP (/api/payload-jobs/run, /handle-schedules) only for an admin signed in with the second factor ` +
`or with "Authorization: Bearer <${secretVar}>" (1.17.2), and ${secretVar} is ${secret ? `shorter than ${CRON_SECRET_MIN_LENGTH} characters` : 'not set'}. ` +
`or with "Authorization: Bearer <${secretVar}>" (1.18.0), and ${secretVar} is ${secret ? `shorter than ${CRON_SECRET_MIN_LENGTH} characters` : 'not set'}. ` +
`A cron that calls the run route: set ${secretVar} and send the header. In-process runs (jobs.autoRun, payload jobs:run) are not affected. ` +
'Your own jobs.access.run wins; iapl({ jobsRunAccess: false }) keeps Payload\'s default (docs/security.md "Payload\'s job queue").'
)
+2 -2
View File
@@ -95,7 +95,7 @@ export function setUnknownIpFactor(factor: number): void {
}
/**
* IPv6 is counted per network, not per address (1.17.2, IAWL idea 9). A host with IPv6 gets a whole /64
* IPv6 is counted per network, not per address (1.18.0, IAWL idea 9). A host with IPv6 gets a whole /64
* (2^64 addresses) — every home connection and every server does — so counting per address gave one visitor
* as many budgets as it has addresses. Every limiter of the plugin (forms, search, MCP, consent log, stats,
* doctor, the mail service's confirm route and account-mail limit) counts a /64 as one client. One home network
@@ -105,7 +105,7 @@ export function setUnknownIpFactor(factor: number): void {
* customer often holds a /48 (65,536 /64s). Off by default — mobile carriers can put many phones in one /48.
*/
export type Ipv6Grouping = {
/** Prefix length one client is counted by. Default 64; 128 = per address (as before 1.17.2). 1–128. */
/** Prefix length one client is counted by. Default 64; 128 = per address (as before 1.18.0). 1–128. */
prefix?: number
/** A second counter per this wider prefix (e.g. 48), at `wideFactor` × the limit. Default: none. */
wide?: false | number
+2 -2
View File
@@ -50,7 +50,7 @@ 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: 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) {
@@ -93,7 +93,7 @@ export function assertPluginSwitches(options: Record<string, unknown>): void {
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)
// 1.18.0: `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'))) {