From 619a4e06caa8e79f01ce7886f52ab0fcde15c0ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Smoli=C5=84ski?= Date: Wed, 25 Nov 2026 10:26:51 +0100 Subject: [PATCH] 1.16.8 upgrade notes Co-Authored-By: Claude Opus 5.5 --- docs/access.md | 2 +- docs/agent/reference-site/INDEX.md | 2 +- docs/agent/skills/ipal-upgrade/SKILL.md | 25 +++++++++++++++++-- docs/dev/PROGRAMISTA.md | 1 + .../.agents/skills/ipal-upgrade/SKILL.md | 25 +++++++++++++++++-- reference/AGENTS.md | 2 +- 6 files changed, 50 insertions(+), 7 deletions(-) diff --git a/docs/access.md b/docs/access.md index 1e2c26c..e184000 100644 --- a/docs/access.md +++ b/docs/access.md @@ -305,7 +305,7 @@ of the collection **can** hold one of the two, the collection gets the admin rul | a select **with `hasMany`** and `editor` or `admin` among its values — `user, editor, admin, boss`; `viewer, editor` | the admin rules (first row above) | | a field that holds a list whose values cannot be listed — text with `hasMany`, json, a relationship with `hasMany` (to documents whose ids are text, the ids are the roles), a select without options, a type the plugin does not know: anything can be written there | the admin rules | | a select with `hasMany` whose values are all your own and hold neither — `lead, member` | "an account of that same collection" (second row) | -| a field that holds **one** value — a select, text or relationship without `hasMany`, a radio, a number (`rolesAreAList` is false) | second row. The plugin counts roles only from an array: an account whose `roles` is the single value `admin` is **not** a plugin admin, so there is nothing of the plugin's to protect and the collection's accounts keep managing each other | +| a field that holds **one** value — a select, text or relationship without `hasMany`, a radio, a number (`rolesAreAList` is false) | second row. The plugin counts roles only from an array: an account whose `roles` is the single value `admin` is **not** a plugin admin, so there is nothing of the plugin's to protect and the collection's accounts keep managing each other. If your own code gives rights by that value, write the collection's own rules | | no `roles` field | second row; every account of it is an admin to the plugin (below) | Otherwise any account of such a collection could hand the value out: create an `admin` and be in Site diff --git a/docs/agent/reference-site/INDEX.md b/docs/agent/reference-site/INDEX.md index aabe8e7..f71d7a4 100644 --- a/docs/agent/reference-site/INDEX.md +++ b/docs/agent/reference-site/INDEX.md @@ -2,7 +2,7 @@ -The reference site is one complete client site on ipal-kit 1.16.7 ("Example Studio", made up) that uses +The reference site is one complete client site on ipal-kit 1.16.8 ("Example Studio", made up) that uses every convention in AGENT.md. It lives in the plugin repo (`reference/`, not in the npm package). Copy the PATTERN of the file you need; change only the project's content. Files up to 40 lines are below in full; open the rest in the repo at the tag of your plugin version: diff --git a/docs/agent/skills/ipal-upgrade/SKILL.md b/docs/agent/skills/ipal-upgrade/SKILL.md index 724605e..8730eb3 100644 --- a/docs/agent/skills/ipal-upgrade/SKILL.md +++ b/docs/agent/skills/ipal-upgrade/SKILL.md @@ -462,7 +462,7 @@ account → "Two-step verification: Set up." and the reset button; delete the ac - an account of the collection **can hold `editor` or `admin`** although its roles are not just the plugin's (`user, editor, admin, boss`; `viewer, editor`; a `roles` field that is text, json or a relationship) — the field must hold a LIST (`hasMany`; a single-valued `roles` is not affected, its value never counts): the admin rules too, - since the release after 1.16.7 (the value on the account makes a plugin admin or editor). **Check:** do + since 1.16.8 (the value on the account makes a plugin admin or editor). **Check:** do accounts with one of your own roles (`boss`, `viewer`) manage accounts there? Then write that as the collection's own rules. Read the start log: `No staff account holds the role "admin", so NOBODY can create, delete or unlock accounts in "…"` — give one account `admin` with a script, or write the rules; @@ -477,7 +477,7 @@ account → "Two-step verification: Set up." and the reset button; delete the ac A staff collection added by a plugin listed after ipalKit gets the same rules at start, put in FRONT of the rules it has (both must allow). If that plugin's collection needs a rule wider than the plugin's default, set `custom: { ipal: { accountRules: false } }` on it. - From the release after 1.16.7: a **copy** of a staff collection made by such a plugin (`{ ...staff, slug: 'copy' }`) + From 1.16.8: a **copy** of a staff collection made by such a plugin (`{ ...staff, slug: 'copy' }`) gets the plugin's rule for its own slug in front of the copied rules — the copy's accounts edit themselves only after `access: { ...staff.access, update: adminOrSelfIn('copy') }`, and the original's accounts no longer manage the copy's. A collection of your config that such a plugin makes the panel's (`admin.user`) keeps the rules you @@ -509,6 +509,27 @@ account → "Two-step verification: Set up." and the reset button; delete the ac `staff-accounts-open`, `staff-own-roles`, `turnstile-degraded`, `turnstile-env-key`); as an admin `GET /api/globals/site-integrations` shows `"smtpPassword":"********"`; a test e-mail and a test form still work; an editor and an admin still log in. +**→ 1.16.8 (security follow-ups; CHANGELOG 1.16.8; PROGRAMISTA §6, item 71) — most sites: update, rebuild, read the start log:** +1. Update the package, `pnpm install`, `pnpm ipal:skills`. No option, schema, migration or import-map change. +2. **Built with Turbopack?** `grep -n '"build"' package.json` — `next build` without `--webpack`: the old build serves + the plugin's `package.json` under `/_next/static/media/` (registry and repository addresses, no secret). + `rm -rf .next`, build, `find .next/static -name 'package*.json'` prints nothing; redeploy; purge a CDN or cache. +3. **A staff collection of the project's own** (`grep -n "staffCollections\|admin.*user" src/payload.config.ts`) without + access rules: look at its `roles` field. + - it holds a list that can contain `editor` or `admin` (select with `hasMany` and one of them next to values of + its own; text or relationship with `hasMany`; json): only an admin manages its accounts now. Do accounts with + another role manage them today? Write the collection's own `access.create` / `update` / `delete`; + - a **single** select (no `hasMany`) with only `user` / `editor` / `admin`: its accounts manage each other again. + Does the project's code give rights by that value? Write the collection's own rules; + - anything else: nothing. +4. **Start log:** `No staff account holds the role "admin", so NOBODY can …` → give one account `admin` with a script + (`pnpm payload run`, Local API) or write the rules. `Could not check …` → make sure one account holds `admin`. +5. **A plugin listed after ipalKit that copies a staff collection or sets `admin.user`** + (`grep -rn "\.\.\.staff\|collections: \[\.\.\." src` in the project's own plugins): CHANGELOG 1.16.8 "Requires project + changes" — the copy's `access.update`, `accountRules: false`, or naming the collection in `access.staffCollections`. +**Check:** a customer and the lowest staff account get `403` on `POST /api/`; an admin still manages +accounts; `pnpm exec ipal-doctor --url ` (`staff-own-roles`). + ## 2. Inventory (no code changes) **What changed for projects** between your old and new plugin version is exactly the reference site's diff — `git diff v v -- reference/` in the ipal-kit repo (or the two `docs/agent/reference-site/INDEX.md` files): diff --git a/docs/dev/PROGRAMISTA.md b/docs/dev/PROGRAMISTA.md index 9f06a24..c6f2cc0 100644 --- a/docs/dev/PROGRAMISTA.md +++ b/docs/dev/PROGRAMISTA.md @@ -678,6 +678,7 @@ Do one item at a time, build, check. Order by importance: | 68 | **1.16.6 — 2FA setup required** (not a routine patch: a new default that can lock accounts out) — an account that has not set 2FA up still reads data over the API with its password; or after the upgrade an account "can do nothing" / is blocked | Before upgrading: `ipal-doctor --url` → accounts without 2FA set it up or are removed; one admin (better two) must have 2FA; deploy day agreed with the owner. Then, in ONE deploy: update, `generate:types`, `generate:importmap` (`TwoFactorStatusField`, `TwoFactorAlert`), **Postgres/SQLite: `migrate:create` and the migration applied in the same deploy when the new container starts — `prodMigrations` or `pnpm payload migrate && pnpm start`, never a pre-deployment command (deployment.md §4.3) — (column `totp_setup_from`); without it every login answers 500**, build, redeploy. Existing accounts get 72 h from the first start; blocked later → admin: account page → "Reopen setup". Password-login integrations: API key or `requireSetup.exempt`. `pnpm ipal:skills` | CHANGELOG 1.16.6, security.md "Setup required" | | 69 | **1.16.7 — hardening** (not a routine patch: stricter defaults) — an account with only the role `user` sees "Unauthorized" in the panel; or the API returns `"smtpPassword":"********"`; or a form with a File field is refused while Turnstile is misconfigured; or "The password must have at least 12 characters."; or "Enter the password again…" on the SMTP password; or `403` "Not allowed from this origin." on the 2FA code | Update, `generate:types`, redeploy; no import map, schema or migration. Every slug in `access.staffCollections` must be an auth collection (otherwise Payload does not start: `/api/health` 503, the old container keeps serving). Set `serverURL` (a proxy that rewrites `Host` otherwise blocks the 2FA code; the log names the origin). Read the start log (`N account(s) … cannot open the admin panel`) and give panel users `editor`. Own code that read the two secrets over the API → Local API on the server. `TURNSTILE_SECRET_KEY` is deprecated: with the owner move the key into the panel. Own staff collection without rules: an admin (update: or the account itself; roles only by an admin; read by staff only) where the roles are the plugin's, accounts of that collection where they are the project's own — write that collection's own rules. Existing short passwords keep working. Switches: `accounts`, `secrets`, `forms.turnstileOnConfigError`, `twoFactor.sameOrigin`, `dashboardAlerts`. `pnpm ipal:skills` | CHANGELOG 1.16.7, access.md "Account rules", security.md "Stored secrets", turnstile.md | | 70 | **1.16.7** — `next build --webpack`: `'server-only' cannot be imported from a Client Component module`, from a `'use client'` file that imports `isAdmin`, `isEditor` or `hasMinimumRole` | Import them from `@intecion/ipal-kit/client` in client components, keep the second argument (`isAdmin(user, config)`); `import type` may stay on the main entry | CHANGELOG 1.16.7, access.md | +| 71 | **1.16.8 — security** — a site built with Turbopack (`next build` without `--webpack`) serves `/_next/static/media/package..json`; or the project has a staff collection of its own without access rules; or a plugin listed after ipalKit copies a staff collection or sets `admin.user`; or the start log says `No staff account holds the role "admin", so NOBODY can …` | Update, `pnpm ipal:skills`, `rm -rf .next`, rebuild; no option, schema, migration or import map. Turbopack: `find .next/static -name 'package*.json'` empty, purge a CDN. Own staff collection: a `roles` list that can hold `editor` / `admin` → only an admin manages its accounts (write own rules otherwise; one account must hold `admin`); a single select with only `user` / `editor` / `admin` → its accounts manage each other again (own rules if your code goes by the value). A copy: `access.update: adminOrSelfIn('copy')`, or `custom.ipal.accountRules: false` | CHANGELOG 1.16.8, access.md "Account rules" | After updating the package: `pnpm ipal:skills` (new skill versions), `pnpm payload generate:importmap`, `rm -rf .next`, restart dev, grep for the new symbol in `node_modules/@intecion/ipal-kit/dist`. diff --git a/reference/.agents/skills/ipal-upgrade/SKILL.md b/reference/.agents/skills/ipal-upgrade/SKILL.md index 724605e..8730eb3 100644 --- a/reference/.agents/skills/ipal-upgrade/SKILL.md +++ b/reference/.agents/skills/ipal-upgrade/SKILL.md @@ -462,7 +462,7 @@ account → "Two-step verification: Set up." and the reset button; delete the ac - an account of the collection **can hold `editor` or `admin`** although its roles are not just the plugin's (`user, editor, admin, boss`; `viewer, editor`; a `roles` field that is text, json or a relationship) — the field must hold a LIST (`hasMany`; a single-valued `roles` is not affected, its value never counts): the admin rules too, - since the release after 1.16.7 (the value on the account makes a plugin admin or editor). **Check:** do + since 1.16.8 (the value on the account makes a plugin admin or editor). **Check:** do accounts with one of your own roles (`boss`, `viewer`) manage accounts there? Then write that as the collection's own rules. Read the start log: `No staff account holds the role "admin", so NOBODY can create, delete or unlock accounts in "…"` — give one account `admin` with a script, or write the rules; @@ -477,7 +477,7 @@ account → "Two-step verification: Set up." and the reset button; delete the ac A staff collection added by a plugin listed after ipalKit gets the same rules at start, put in FRONT of the rules it has (both must allow). If that plugin's collection needs a rule wider than the plugin's default, set `custom: { ipal: { accountRules: false } }` on it. - From the release after 1.16.7: a **copy** of a staff collection made by such a plugin (`{ ...staff, slug: 'copy' }`) + From 1.16.8: a **copy** of a staff collection made by such a plugin (`{ ...staff, slug: 'copy' }`) gets the plugin's rule for its own slug in front of the copied rules — the copy's accounts edit themselves only after `access: { ...staff.access, update: adminOrSelfIn('copy') }`, and the original's accounts no longer manage the copy's. A collection of your config that such a plugin makes the panel's (`admin.user`) keeps the rules you @@ -509,6 +509,27 @@ account → "Two-step verification: Set up." and the reset button; delete the ac `staff-accounts-open`, `staff-own-roles`, `turnstile-degraded`, `turnstile-env-key`); as an admin `GET /api/globals/site-integrations` shows `"smtpPassword":"********"`; a test e-mail and a test form still work; an editor and an admin still log in. +**→ 1.16.8 (security follow-ups; CHANGELOG 1.16.8; PROGRAMISTA §6, item 71) — most sites: update, rebuild, read the start log:** +1. Update the package, `pnpm install`, `pnpm ipal:skills`. No option, schema, migration or import-map change. +2. **Built with Turbopack?** `grep -n '"build"' package.json` — `next build` without `--webpack`: the old build serves + the plugin's `package.json` under `/_next/static/media/` (registry and repository addresses, no secret). + `rm -rf .next`, build, `find .next/static -name 'package*.json'` prints nothing; redeploy; purge a CDN or cache. +3. **A staff collection of the project's own** (`grep -n "staffCollections\|admin.*user" src/payload.config.ts`) without + access rules: look at its `roles` field. + - it holds a list that can contain `editor` or `admin` (select with `hasMany` and one of them next to values of + its own; text or relationship with `hasMany`; json): only an admin manages its accounts now. Do accounts with + another role manage them today? Write the collection's own `access.create` / `update` / `delete`; + - a **single** select (no `hasMany`) with only `user` / `editor` / `admin`: its accounts manage each other again. + Does the project's code give rights by that value? Write the collection's own rules; + - anything else: nothing. +4. **Start log:** `No staff account holds the role "admin", so NOBODY can …` → give one account `admin` with a script + (`pnpm payload run`, Local API) or write the rules. `Could not check …` → make sure one account holds `admin`. +5. **A plugin listed after ipalKit that copies a staff collection or sets `admin.user`** + (`grep -rn "\.\.\.staff\|collections: \[\.\.\." src` in the project's own plugins): CHANGELOG 1.16.8 "Requires project + changes" — the copy's `access.update`, `accountRules: false`, or naming the collection in `access.staffCollections`. +**Check:** a customer and the lowest staff account get `403` on `POST /api/`; an admin still manages +accounts; `pnpm exec ipal-doctor --url ` (`staff-own-roles`). + ## 2. Inventory (no code changes) **What changed for projects** between your old and new plugin version is exactly the reference site's diff — `git diff v v -- reference/` in the ipal-kit repo (or the two `docs/agent/reference-site/INDEX.md` files): diff --git a/reference/AGENTS.md b/reference/AGENTS.md index 50d755b..7cfceaa 100644 --- a/reference/AGENTS.md +++ b/reference/AGENTS.md @@ -47,7 +47,7 @@ Write everything in this file in English. -## ipal-kit 1.16.7 — agent guide +## ipal-kit 1.16.8 — agent guide This project is built on `@intecion/ipal-kit` (a Payload CMS 3 plugin). Before you write code: