1.16.4 upgrade notes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
03443fd7ee
commit
d722157e20
+1
-1
@@ -111,7 +111,7 @@ What follows:
|
||||
carry `collection`: `{ ...doc, collection: 'users' }`. Payload's own strategies and `payload.auth()` set it. An
|
||||
account without it is not staff.
|
||||
|
||||
> **Changed in the release after 1.16.3.** Before, a role or the "no roles field" rule counted for an account
|
||||
> **Changed in 1.16.4.** Before, a role or the "no roles field" rule counted for an account
|
||||
> of any auth collection: an account of a second auth collection passed staff checks — every one when its
|
||||
> collection had no `roles` field, and the matching ones when it had its own `roles` field. A project with one
|
||||
> auth collection sees no difference. A project that relied on a second collection being staff sets
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<!-- Generated by scripts/reference-index.mjs from reference/ — do not edit by hand (pnpm reference:index). -->
|
||||
|
||||
The reference site is one complete client site on ipal-kit 1.16.3 ("Example Studio", made up) that uses
|
||||
The reference site is one complete client site on ipal-kit 1.16.4 ("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:
|
||||
|
||||
@@ -39,7 +39,7 @@ through this procedure. Ask only when you are missing something you cannot get y
|
||||
| `isAdmin(user)` / `isEditor(user)` is always `false` in a client component or in `proxy.ts` | the staff collections are not known there (no config in the browser bundle / middleware), and the predicates fail closed | `isAdmin(user, config)` with `useConfig()`; in middleware `isAdmin(user, { staffCollections: ['users'] })` |
|
||||
| startup: `[ipal] twoFactor: the injected 2FA plugin did not add the totpSecret field / hasTotp field / totp auth strategy` | the installed `@clocklimited/payload-2fa` is not a version ipal-kit's second-factor check recognises (tested: 3.0.0-beta.1 and beta.7), or a custom factory was injected | install a supported version; stop-gap only: `twoFactor.guard: false` (the plugin's own data is then not covered by 2FA — security.md) |
|
||||
| own route or script gets `403` / "not allowed" on `form-submissions`, `forms`, a settings global with `overrideAccess: false`, although the user is an admin | the `user` was fetched by id and passed by hand: it does not carry how the account logged in, so the second-factor check refuses it | take the user from `payload.auth({ headers })` (it sets `collection` and how the account logged in), or (server-only code that needs no access check) leave `overrideAccess` at its default; a hand-built user needs at least `collection: 'users'` for its role to count |
|
||||
| an account of a second auth collection (`customers`) gets `403` from a settings global, submissions, `/api/ipal/*`, `/api/setup-totp`, or `isAdmin` / `adminOnly` say no although it has `roles: ['admin']`, after an upgrade | by design since the release after 1.16.3: roles and staff checks count only for accounts of a staff collection | write the one rule it needs (`formSubmissionOverrides`, `globalOverrides`, `collectionOverrides`); a second STAFF collection: `access.staffCollections` (access.md "Who is staff") |
|
||||
| an account of a second auth collection (`customers`) gets `403` from a settings global, submissions, `/api/ipal/*`, `/api/setup-totp`, or `isAdmin` / `adminOnly` say no although it has `roles: ['admin']`, after an upgrade | by design since 1.16.4: roles and staff checks count only for accounts of a staff collection | write the one rule it needs (`formSubmissionOverrides`, `globalOverrides`, `collectionOverrides`); a second STAFF collection: `access.staffCollections` (access.md "Who is staff") |
|
||||
| `TS2307 next/navigation` in the plugin's `dist` | import without `.js` in the plugin client (NodeNext) | **ipal-kit bug** → plugin gap; the plugin imports `'next/navigation.js'` |
|
||||
| `TS2307 @payloadcms/storage-s3` | package missing when using `buildR2Storage` | `pnpm add @payloadcms/storage-s3` + `buildR2Storage(['media'], { s3Storage })` |
|
||||
| `does not provide an export named X` / `X is not a function` | symbol not exported from the entry point, or wrong subpath (`/client` vs root vs `/server` vs `/rsc`) | `docs/README.md` → the right import; missing from every entry → **ipal-kit bug** (export) |
|
||||
|
||||
@@ -328,8 +328,13 @@ recommended, not required (the plugin's peer range stays `^3.90.2`):**
|
||||
21.0.4; `pnpm audit --prod` → no high or critical; `pnpm exec ipal-doctor` → no `versions` finding; Coolify Terminal
|
||||
`node -v` → 22.23.5 or later; the panel opens, a document saves, a form submission arrives.
|
||||
|
||||
**→ the release after 1.16.3 (PROGRAMISTA §6, item 65; security fixes: 2FA coverage and staff checks) — required
|
||||
**→ 1.16.4 (PROGRAMISTA §6, items 65–66; security fixes: 2FA coverage and staff checks) — required
|
||||
for every site:**
|
||||
0. **Before deploying:** check the production `PAYLOAD_SECRET` length (Coolify app → Terminal →
|
||||
`node -e 'console.log(process.env.PAYLOAD_SECRET.length)'`). Shorter than 32: set a new random secret (with the
|
||||
owner's OK: logs everyone out, 2FA code again, API keys regenerate; deployment.md "`PAYLOAD_SECRET` — length and
|
||||
changing it"), or add `secretMinLength: 0` to `ipalEnvRules({ … })` for now and note it under "Project
|
||||
decisions" in AGENTS.md.
|
||||
1. Update the package, `pnpm install`, `pnpm ipal:skills`, build, redeploy on Coolify. No migration, no config
|
||||
change for a site with one auth collection. `pnpm ls @clocklimited/payload-2fa` should show 3.0.0-beta.7 (tested: beta.1 and beta.7);
|
||||
another version may stop startup with `[ipal] twoFactor: the injected 2FA plugin did not add …`.
|
||||
@@ -354,7 +359,8 @@ for every site:**
|
||||
**Check:** with 2FA on, log in over the API with the password only (security.md → "What the second factor covers" →
|
||||
Check) → `403` from `/api/globals/site-integrations`, `/api/form-submissions`, `/api/users`; log in fully in the
|
||||
panel → Site integrations and a form submission open, a setting saves. With a second auth collection: its token
|
||||
gets `403` from the same addresses and from `POST /api/setup-totp`.
|
||||
gets `403` from the same addresses and from `POST /api/setup-totp`. The Coolify log has no
|
||||
`PAYLOAD_SECRET must be at least`; `pnpm exec ipal-doctor` has no `env` finding.
|
||||
|
||||
## 2. Inventory (no code changes)
|
||||
**What changed for projects** between your old and new plugin version is exactly the reference site's diff —
|
||||
|
||||
@@ -672,7 +672,8 @@ Do one item at a time, build, check. Order by importance:
|
||||
| 62 | **1.16.1** — `pnpm dev` warns "Next.js 16.4.3 is affected by a known security vulnerability"; ipal-doctor `next-min` error below 16.4.5 (GHSA-mfr8-8qww-v76h) | `pnpm add [email protected] [email protected]`, `rm -rf .next`, build, commit the lockfile, redeploy on Coolify; `pnpm ipal:skills`; no option, migration or import map change | CHANGELOG 1.16.1, AGENT.md §4 item 11 |
|
||||
| 63 | **1.16.2** — `pnpm audit --prod` shows `mongoose` (critical, via `@payloadcms/db-mongodb`) or `happy-dom` (high, via `@payloadcms/richtext-lexical`); ipal-doctor `transitive-min` | `pnpm.overrides`: `"mongoose@>=8 <8.24.7": "~8.24.10"` (MongoDB sites) and `"happy-dom@<21.0.4": "^21.0.4"`; `pnpm install`, build, commit the lockfile, redeploy on Coolify; `pnpm ipal:skills`; no migration | CHANGELOG 1.16.2, AGENT.md §4 item 12 |
|
||||
| 64 | **1.16.3** — the reference site and the starter run Payload 3.94.1; the site is still on 3.90–3.93, or `node -v` (locally or in the Coolify app's Terminal) is below 22.23.5 | Recommended, not required (the plugin still accepts `^3.90.2`). First make sure Node is 22.23.5 or later everywhere, Coolify included (Nixpacks picks the patch: check `node -v`, update Coolify if lower). Then every `payload` / `@payloadcms/*` 3.94.1 (in `dependencies` and `pnpm.overrides`), `react` / `react-dom` 19.3.1, `"engines": { "node": ">=22.23.5 <23" }`; overrides: keep `dompurify` and `happy-dom`, drop `mongoose`, `undici` and `graphql-scalars`; `pnpm install`, `generate:types`, `generate:importmap`, `rm -rf .next`, build, redeploy; Postgres/SQLite: `migrate:create`; `pnpm ipal:skills` | CHANGELOG 1.16.3, AGENT.md §4 items 11–12, ipal-upgrade "Every upgrade — Payload" |
|
||||
| 65 | **the release after 1.16.3 — security** — with 2FA on, a login with the password only gets `200` from `/api/globals/site-integrations` or `/api/form-submissions`; or the project has a second auth collection (`customers`) | Upgrade and redeploy (no config change with one auth collection). With the owner: change the SMTP password and the Turnstile secret, review Site settings / Site integrations / each form's Emails tab for values nobody set. Second auth collection: `admin: { user }` in `buildConfig`, `adminOrSelfIn('<slug>')`, `access.staffCollections` only for a second STAFF collection. Every account must have 2FA set up (`ipal-doctor --url` → 0 without). Own endpoints: `secondFactorPassed(req)`; own `overrideAccess: false` calls: `user` from `payload.auth()`. `pnpm ipal:skills`; no migration | CHANGELOG "Unreleased — security fixes", security.md "What the second factor covers", access.md "Who is staff" |
|
||||
| 65 | **1.16.4 — security** — with 2FA on, a login with the password only gets `200` from `/api/globals/site-integrations` or `/api/form-submissions`; or the project has a second auth collection (`customers`) | Upgrade and redeploy (no config change with one auth collection). With the owner: change the SMTP password and the Turnstile secret, review Site settings / Site integrations / each form's Emails tab for values nobody set. Second auth collection: `admin: { user }` in `buildConfig`, `adminOrSelfIn('<slug>')`, `access.staffCollections` only for a second STAFF collection. Every account must have 2FA set up (`ipal-doctor --url` → 0 without). Own endpoints: `secondFactorPassed(req)`; own `overrideAccess: false` calls: `user` from `payload.auth()`. `pnpm ipal:skills`; no migration | CHANGELOG 1.16.4, security.md "What the second factor covers", access.md "Who is staff" |
|
||||
| 66 | **1.16.4** — production `PAYLOAD_SECRET` shorter than 32 characters (the site would stop at `assertEnv`) | Before deploying 1.16.4, check the length in Coolify (`node -e 'console.log(process.env.PAYLOAD_SECRET.length)'`). Shorter: a random 32+ character secret (logs everyone out, asks for 2FA again, breaks stored API keys), or `ipalEnvRules({ secretMinLength: 0 })` for now | CHANGELOG 1.16.4, deployment.md "PAYLOAD_SECRET — length and changing it" |
|
||||
|
||||
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`.
|
||||
|
||||
+2
-2
@@ -398,7 +398,7 @@ The package wraps the `access` functions of the collections and globals that are
|
||||
it runs**. ipalKit runs it early, so the plugin's own globals and collections (Site settings, Site integrations,
|
||||
Cookie banner, Notifications, forms, form submissions, consent records, cookie review, stats) and anything a
|
||||
plugin listed after `ipalKit` adds were not wrapped. **Up to 1.16.3 a staff password without the TOTP code
|
||||
therefore read and changed them over the API.** Since the release after 1.16.3 ipal-kit closes that itself:
|
||||
therefore read and changed them over the API.** Since 1.16.4 ipal-kit closes that itself:
|
||||
|
||||
| Where | How |
|
||||
|---|---|
|
||||
@@ -614,7 +614,7 @@ data access, not just the UI — for what is in the config when it runs; ipal-ki
|
||||
- Uploads: `buildUploadSecurityHeaders()` in `next.config.ts` (an SVG cannot run a script on the site's domain).
|
||||
- `users`: the plugin injects an auth collection when the project has none (roles and 2FA always attach).
|
||||
|
||||
## The release after 1.16.3 — two access fixes
|
||||
## 1.16.4 — two access fixes
|
||||
|
||||
- **Staff checks and a second auth collection.** Roles and the "no roles field" rule counted for an account of
|
||||
any auth collection — a `customers` account passed the plugin's staff checks, and with its own `roles` field
|
||||
|
||||
@@ -39,7 +39,7 @@ through this procedure. Ask only when you are missing something you cannot get y
|
||||
| `isAdmin(user)` / `isEditor(user)` is always `false` in a client component or in `proxy.ts` | the staff collections are not known there (no config in the browser bundle / middleware), and the predicates fail closed | `isAdmin(user, config)` with `useConfig()`; in middleware `isAdmin(user, { staffCollections: ['users'] })` |
|
||||
| startup: `[ipal] twoFactor: the injected 2FA plugin did not add the totpSecret field / hasTotp field / totp auth strategy` | the installed `@clocklimited/payload-2fa` is not a version ipal-kit's second-factor check recognises (tested: 3.0.0-beta.1 and beta.7), or a custom factory was injected | install a supported version; stop-gap only: `twoFactor.guard: false` (the plugin's own data is then not covered by 2FA — security.md) |
|
||||
| own route or script gets `403` / "not allowed" on `form-submissions`, `forms`, a settings global with `overrideAccess: false`, although the user is an admin | the `user` was fetched by id and passed by hand: it does not carry how the account logged in, so the second-factor check refuses it | take the user from `payload.auth({ headers })` (it sets `collection` and how the account logged in), or (server-only code that needs no access check) leave `overrideAccess` at its default; a hand-built user needs at least `collection: 'users'` for its role to count |
|
||||
| an account of a second auth collection (`customers`) gets `403` from a settings global, submissions, `/api/ipal/*`, `/api/setup-totp`, or `isAdmin` / `adminOnly` say no although it has `roles: ['admin']`, after an upgrade | by design since the release after 1.16.3: roles and staff checks count only for accounts of a staff collection | write the one rule it needs (`formSubmissionOverrides`, `globalOverrides`, `collectionOverrides`); a second STAFF collection: `access.staffCollections` (access.md "Who is staff") |
|
||||
| an account of a second auth collection (`customers`) gets `403` from a settings global, submissions, `/api/ipal/*`, `/api/setup-totp`, or `isAdmin` / `adminOnly` say no although it has `roles: ['admin']`, after an upgrade | by design since 1.16.4: roles and staff checks count only for accounts of a staff collection | write the one rule it needs (`formSubmissionOverrides`, `globalOverrides`, `collectionOverrides`); a second STAFF collection: `access.staffCollections` (access.md "Who is staff") |
|
||||
| `TS2307 next/navigation` in the plugin's `dist` | import without `.js` in the plugin client (NodeNext) | **ipal-kit bug** → plugin gap; the plugin imports `'next/navigation.js'` |
|
||||
| `TS2307 @payloadcms/storage-s3` | package missing when using `buildR2Storage` | `pnpm add @payloadcms/storage-s3` + `buildR2Storage(['media'], { s3Storage })` |
|
||||
| `does not provide an export named X` / `X is not a function` | symbol not exported from the entry point, or wrong subpath (`/client` vs root vs `/server` vs `/rsc`) | `docs/README.md` → the right import; missing from every entry → **ipal-kit bug** (export) |
|
||||
|
||||
@@ -328,8 +328,13 @@ recommended, not required (the plugin's peer range stays `^3.90.2`):**
|
||||
21.0.4; `pnpm audit --prod` → no high or critical; `pnpm exec ipal-doctor` → no `versions` finding; Coolify Terminal
|
||||
`node -v` → 22.23.5 or later; the panel opens, a document saves, a form submission arrives.
|
||||
|
||||
**→ the release after 1.16.3 (PROGRAMISTA §6, item 65; security fixes: 2FA coverage and staff checks) — required
|
||||
**→ 1.16.4 (PROGRAMISTA §6, items 65–66; security fixes: 2FA coverage and staff checks) — required
|
||||
for every site:**
|
||||
0. **Before deploying:** check the production `PAYLOAD_SECRET` length (Coolify app → Terminal →
|
||||
`node -e 'console.log(process.env.PAYLOAD_SECRET.length)'`). Shorter than 32: set a new random secret (with the
|
||||
owner's OK: logs everyone out, 2FA code again, API keys regenerate; deployment.md "`PAYLOAD_SECRET` — length and
|
||||
changing it"), or add `secretMinLength: 0` to `ipalEnvRules({ … })` for now and note it under "Project
|
||||
decisions" in AGENTS.md.
|
||||
1. Update the package, `pnpm install`, `pnpm ipal:skills`, build, redeploy on Coolify. No migration, no config
|
||||
change for a site with one auth collection. `pnpm ls @clocklimited/payload-2fa` should show 3.0.0-beta.7 (tested: beta.1 and beta.7);
|
||||
another version may stop startup with `[ipal] twoFactor: the injected 2FA plugin did not add …`.
|
||||
@@ -354,7 +359,8 @@ for every site:**
|
||||
**Check:** with 2FA on, log in over the API with the password only (security.md → "What the second factor covers" →
|
||||
Check) → `403` from `/api/globals/site-integrations`, `/api/form-submissions`, `/api/users`; log in fully in the
|
||||
panel → Site integrations and a form submission open, a setting saves. With a second auth collection: its token
|
||||
gets `403` from the same addresses and from `POST /api/setup-totp`.
|
||||
gets `403` from the same addresses and from `POST /api/setup-totp`. The Coolify log has no
|
||||
`PAYLOAD_SECRET must be at least`; `pnpm exec ipal-doctor` has no `env` finding.
|
||||
|
||||
## 2. Inventory (no code changes)
|
||||
**What changed for projects** between your old and new plugin version is exactly the reference site's diff —
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ Write everything in this file in English.
|
||||
<!-- /starter:decisions -->
|
||||
|
||||
<!-- ipal-kit:start -->
|
||||
## ipal-kit 1.16.3 — agent guide
|
||||
## ipal-kit 1.16.4 — agent guide
|
||||
|
||||
<!-- Managed by `pnpm exec ipal-skills` — edits between the markers are overwritten. -->
|
||||
This project is built on `@intecion/ipal-kit` (a Payload CMS 3 plugin). Before you write code:
|
||||
|
||||
Reference in New Issue
Block a user