Compare commits

...
105 Commits
Author SHA1 Message Date
Radosław SmolińskiandClaude Opus 5.5 e436534190 1.18.0 notes: the changelog's link to consent.md follows the heading's new version
CI / check (push) Failing after 8m19s
CI / reference (push) Skipped
CI / reference-full (push) Skipped
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-02 10:08:27 +01:00
Radosław SmolińskiandClaude Opus 5.5 9b83cc600a 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]>
2026-12-02 09:38:00 +01:00
Radosław SmolińskiandClaude Opus 5.5 af98cfba96 1.18.0
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-02 09:36:13 +01:00
Radosław SmolińskiandClaude Opus 5.5 b9bcd55ac4 Audit clean with dev tooling: overrides for esbuild (<0.25, via drizzle-kit), eslint (<9.39.4, @eslint/plugin-kit) and minimatch (7–11.0.7, via typescript-eslint); security:gate fails on moderate and above in the production tree and the dev tooling (--audit-level, --prod-only to loosen); doctor transitive-min warns on esbuild for Postgres sites; AGENT.md §4 item 12, skills, security.md, changelog
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-02 00:41:46 +01:00
Radosław SmolińskiandClaude Opus 5.5 f38a8cc677 Overrides for two advisories published 2026-12-01: ws below 8.23.0 (GHSA-37g9-w4hg-h9qr, high, via payload) and cross-spawn below 7.1.0 (GHSA-ghv9-86vm-4v8m, critical, Windows only, via cross-env / eslint) in the plugin and the reference site (and so the starter); doctor transitive-min, AGENT.md §4 item 12, setup and upgrade skills, changelog
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 23:54:52 +01:00
Radosław SmolińskiandClaude Opus 5.5 713b28e79f Changelog: connect-link only from the site's own origin
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 23:00:59 +01:00
Radosław SmolińskiandClaude Opus 5.5 be30812423 connect-link ("Połącz z IWSN") is a panel action: only from the site's own origin (adminSameOrigin), like connect and disconnect
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 23:00:52 +01:00
Radosław SmolińskiandClaude Opus 5.5 9ca563e2af Merge claude/iwsn-connect: "Połącz z IWSN" — the IAPL side of IWSN contract 1.8.0 (connect)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 23:00:26 +01:00
Radosław SmolińskiandClaude Opus 5.5 68fb8fc8f3 Routes snapshot: the new admin route connect-link is judged; a test comment names the database variables in full
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 22:01:54 +01:00
Radosław SmolińskiandClaude Opus 5.5 25af43442e Real-service test: the connect flow against IWSN's code at IWDL de560ef (policy connect) — wait, link, confirm on the stand-in's page, active, send
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 21:44:19 +01:00
Radosław SmolińskiandClaude Opus 5.5 2c0262367d IWSN: "Połącz z IWSN" — a person of Intecion connects the site (contract 1.8.0)
- the state block on the e-mail tab (method IWSN): the button while the service offers the confirmation page
  (connectAvailable) or before the site has enrolled; a click asks the site's server for the link
  (POST /api/iapl/mail-relay/connect-link, admin only), which asks the service (POST /v1/connect, enrolling first),
  checks that it begins with the service's own {base}/connect?, and hands it over without storing or logging it;
  the browser opens it in a new tab with noopener noreferrer; the block asks /v1/status every 5 s for 10 min
- states: waiting for confirmation (button), waiting for approval (no page), connected, stopped; 503
  connect-unavailable and 429 said in the admin's language; a load of the panel asks the service while the site waits
- dashboard alert for a waiting site (live); doctor mail-relay-connect (error) — replaces the pending warning and the
  "not enrolled yet" note of mail-relay-state
- opt-out mail.relay.connectButton: false (no button, no route); building blocks requestRelayConnectLink,
  isRelayConnectUrl, RELAY_CONNECT_LINK_PATH; the fake service implements /v1/connect, connectAvailable and
  confirmConnect
- contract copy 1.8.0 (IWDL working tree, checksums match); docs, AGENT.md, setup / upgrade / debug skills, changelog

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 21:42:23 +01:00
Radosław SmolińskiandClaude Opus 5.5 347e3bafa1 Minimum safe Next.js 16.4.6 (owner's decision): doctor next-min, AGENT.md §4 item 11, doctor.md, setup and upgrade skills, changelog; O1 settled — Next 16.4.6's React copy carries the GHSA-xqc2-xf4c-x3h3 fix (checked in the code)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 20:57:47 +01:00
Radosław SmolińskiandClaude Opus 5.5 dcf820b365 F3 docs: HTML pages keep Next's own Vary and their ISR caching (measured on the built reference site, both bundlers); the private, no-store Markdown answer is what closes F3
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 18:01:21 +01:00
Radosław SmolińskiandClaude Opus 5.5 631c583fa3 Lint: queryGuardHttp test config keys in order
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 17:47:56 +01:00
Radosław SmolińskiandClaude Opus 5.5 2af8ef180f List cap (F4): a server read with overrideAccess: true that passes a request on is not capped (the cookie scanner's scheduled crawl read its review list through the token request); reference types without the e2e fixtures; changelog heading covers all of 1.18.0
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 17:22:10 +01:00
Radosław SmolińskiandClaude Opus 5.5 e23edb2429 Merge claude/security-audit-1180-fixes: security audit fixes F1–F5, document locks for staff, strict access callbacks, the security suites and gate
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 17:20:40 +01:00
Radosław SmolińskiandClaude Opus 5.5 c6bfb621f5 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]>
2026-12-01 17:07:04 +01:00
Radosław SmolińskiandClaude Opus 5.5 d90825a396 Security audit fixes: the document-locks door closed for customers, route reasons for the staff-only locks
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 17:03:56 +01:00
Radosław SmolińskiandClaude Opus 5.5 e5964d4e05 Security audit fixes: docs (security.md, content.md, i18n.md, AGENT.md, skills), changelog, static-rule judgments for the merged doctor and 2FA code, hook mark for the account-rule tests
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 17:02:20 +01:00
Radosław SmolińskiandClaude Opus 5.5 e9f9947eb7 Security audit fixes for 1.18.0: Markdown negotiation private + Vary: Accept (F3), public lists capped (F4), operator sort names refused (F5), CSP report log normalised and capped (F1), buildUrlField and the reference socials (F2), document locks for staff only
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 16:56:09 +01:00
Radosław SmolińskiandClaude Opus 5.5 d2f19095dc Security suites from the 2026-12 audit: static rules, attack probes, per-class tests, gate
- doctor: code-patterns (unescaped HTML/JSON-LD, eval, shell, NEXT_PUBLIC_ secrets,
  overrideAccess / Local API user, where from the request, redirects and fetches to a
  request address) and config-dangerous; live-probes runs the safe attack probes on --url
- ATTACK_PROBES / runAttackProbes / createProbeContext exported from /doctor; the reference
  site runs all of them in pnpm e2e:built (both bundlers) plus CSRF and cookie flags;
  project template iapl-audit/resources/attack-probes.spec.template.ts
- test/securityPatterns.test.ts gates every hit against test/security-patterns.allow.json;
  test/securityClasses.test.ts covers XSS, redirects, pollution, logs, DoS, cache poisoning
- pnpm security:gate (pnpm audit --prod, the two suites, optional offline ZAP) in prepublishOnly
- audit findings F1, F3, F4, F5 reproduced as expected-to-fail tests/probes; no fix built
- docs: security.md threat list + Security suites, doctor.md, AGENT.md, CHANGELOG, skills

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 16:46:42 +01:00
Radosław SmolińskiandClaude Opus 5.5 a416411f01 legacy:site accepts only the performance errors the unedited 1.16.7 site meets (perf-budgets); changelog: /client helpers are plain values in server components, iaplTtlFrom in MongoDB types
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 16:45:07 +01:00
Radosław SmolińskiandClaude Opus 5.5 c9285f0349 Merge claude/performance-1180-items: the owner's performance decisions for 1.18.0 (lazy form and Turnstile with /client/eager, metadata stripped on upload, MongoDB TTL indexes, version limit, unused-media notice, performance rules as errors)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 16:20:07 +01:00
Radosław SmolińskiandClaude Opus 5.5 8cf5a58045 Doctor: the performance rules are errors (owner's decision for 1.18.0); lowered or silenced per rule in iapl-doctor.json; growth stays warnings; audit reports them as errors; legacy:site lists perf-* errors an old site meets; docs, skills, changelog; reference skills refreshed
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 16:10:23 +01:00
Radosław SmolińskiandClaude Opus 5.5 f0127ac1b8 1.18.0 performance items: tests, the reference budget gate tightened (JS 195 kB, 404 without its exception, TTL check), docs (performance.md, AGENT.md, iapl-performance, module pages, api.md), changelog: what changes for an existing site
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 15:54:15 +01:00
Radosław SmolińskiandClaude Opus 5.5 d628839235 1.18.0 performance items: reference 404 placeholder and heading font without preload, lazy form and Turnstile code (eager entry /client/eager), Turnstile space kept, background video paused for reduced motion, card hover on opacity, metadata stripped on upload, MongoDB TTL indexes for the consent log and statistics, unused-media notice, version limit for the plugin's entities
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 15:38:38 +01:00
Radosław SmolińskiandClaude Opus 5.5 076b3ef707 Merge claude/performance-2026-12-36a376: fewer queries per render, no 'use client' on the /client barrels, budgets, the doctor's performance and growth groups
Conflicts kept both sides: the doctor status (twoFactorConfirm with growth and media), its key test, e2e:built (the 2FA
enrolment spec and the performance budgets), the reference index (regenerated). Reference skill copies synced
(iapl-performance added, iapl-audit and iapl-reference updated).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 14:58:44 +01:00
Radosław SmolińskiandClaude Opus 5.5 350e3147cf Merge claude/2fa-enrolment-email-confirm: the first two-step set-up is confirmed by e-mail (twoFactor.confirmByEmail, security audit F0)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 14:57:55 +01:00
Radosław SmolińskiandClaude Opus 5.5 8991867e01 What grows: the doctor's growth group (sizes, versions, retention, submissions, KV, unused media, disk) with thresholds, expired mail-service nonces swept, opt-in forms.submissionRetentionDays, docs
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 14:48:35 +01:00
Radosław SmolińskiandClaude Opus 5.5 6b16b9f933 perf-budgets reports only for a project that runs Playwright (a new starter site has no e2e yet)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 14:29:17 +01:00
Radosław SmolińskiandClaude Opus 5.5 3b32e659c5 Budget gate: Next's idle link prefetches counted apart, third parties recorded then aborted, spec filter safe for any checkout path; zero counted queries fail
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 14:19:26 +01:00
Radosław SmolińskiandClaude Opus 5.5 beef517c23 Tests: the lightbox viewer's first open waits for its chunk; reference index lists the performance spec and the lab helper
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 14:07:07 +01:00
Radosław SmolińskiandClaude Opus 5.5 9bac7e7bf0 Performance review: final numbers for both bundlers, memory measured on its own, the font decision measured
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 14:04:45 +01:00
Radosław SmolińskiandClaude Opus 5.5 45c6dcd968 e2e:built runs the performance budgets with both bundlers; Turbopack numbers after
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 13:53:57 +01:00
Radosław SmolińskiandClaude Opus 5.5 c6c5dfbcbf Docs: performance.md, the iapl-performance skill, AGENT.md 6.11b, doctor.md, audit, api.md, the measurements and the audit
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 13:51:43 +01:00
Radosław SmolińskiandClaude Opus 5.5 801b897ea0 Budgets and checks: PERF_BUDGETS / perfBudgets / overBudget, the reference gate (both bundlers), the doctor's performance group (static, live, deep)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 13:51:43 +01:00
Radosław SmolińskiandClaude Opus 5.5 21073d98d0 Client: no 'use client' on barrels, lazy lightbox viewer, rAF table of contents, Turnstile polling stops, reduced motion, Media eager, 404 placeholder option
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 13:51:39 +01:00
Radosław SmolińskiandClaude Opus 5.5 1d6108765c Fewer queries per render: resolveRoute and page metadata cached by value, select for slug-only reads, one Site integrations read
Home 43 -> 24 MongoDB queries per render, other pages -36 to -44 %.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 13:51:39 +01:00
Radosław SmolińskiandClaude Opus 5.5 f3be77b2bc Performance measurement: pnpm perf:measure and the lab helper (phone/desktop, vitals, bytes, queries per render)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 13:51:39 +01:00
Radosław SmolińskiandClaude Opus 5.5 c9d1f4b340 2FA: the first set-up is confirmed by e-mail (twoFactor.confirmByEmail, 1.18.0)
Security audit 2026-12, F0: inside an account's setup window its password alone
enrolled an authenticator of the caller's choosing; the owner was locked out.

- /setup-totp for an account without a factor: IAPL checks the code, keeps the
  secret pending (payload-kv), mails a single-use 30-min link to the account and
  ties it to the enrolling browser; the package's handler (and its -totp cookie)
  is never used for a first enrolment
- GET /api/iapl/two-factor/confirm = a page with one button; POST confirms
  (own origin, same browser), ends the account's sessions, signs nobody in
- notice mails on every enrolment, change, removal / reset (any path)
- mail not working: link to the server log, admin confirms on the account page
  (POST /api/iapl/two-factor/confirm-pending), doctor rule 2fa-enrolment-mail
- options and opt-out (confirmByEmail: false), building blocks exported
- tests: HTTP suite on SQLite, MongoDB, Postgres; built-site spec in e2e:built;
  closed doors and judged routes; docs, AGENT.md, skills, changelog

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 13:37:39 +01:00
Radosław SmolińskiandClaude Opus 5.5 2bf8502aae Reference site: import map regenerated (MaskedField moved by currentPassword), skill copies synced after the 1.18.0 merges
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 13:20:16 +01:00
Radosław SmolińskiandClaude Opus 5.5 84717804ae legacy:site: the same import-map entries in another order pass, and the old site is then built with its committed map
Payload writes import-map entries in the order it meets them; 1.18.0's currentPassword field moves MaskedField three
lines up. A new or a missing entry still fails. The typecheck and both builds run with the map the old site has,
which proves an unedited site works without generate:importmap (the 1.18.0 notes say so).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 13:03:32 +01:00
Radosław SmolińskiandClaude Opus 5.5 1ba191e580 Merge claude/security-a-118: a stranger cannot lock a staff account, staff sign-in only from the site's own origin, own e-mail and password changes ask for the current password
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 13:03:26 +01:00
Radosław SmolińskiandClaude Opus 5.5 8888a38c10 Lint: lockedAnswer suite after the merge
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 12:58:02 +01:00
Radosław SmolińskiandClaude Opus 5.5 1bc0ebca63 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]>
2026-12-01 12:57:52 +01:00
Radosław SmolińskiandClaude Opus 5.5 23215d91a8 Merge claude/security-b-118: plugin status written alone, access answers announced (strict in 1.19.0), drafts left out of related documents
Merged onto ee241de (the prepared 1.17.2). Conflicts kept both sides: AGENT.md rows (consent version; drafts, status, access answers), security.md sections (job queue, visitor accounts; access callbacks), src/index.ts (the jobs exports).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 12:53:59 +01:00
Radosław SmolińskiandClaude Opus 5.5 ee241deee0 1.17.2 upgrade notes
PROGRAMISTA §6 rows 84–87 (version history, sign-in and panel actions, REST submissions and jobs, consent version);
iapl-upgrade "→ 1.17.2, security"; reference skills, AGENTS.md and the reference index on 1.17.2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 12:11:56 +01:00
Radosław SmolińskiandClaude Opus 5.5 0709141cae 1.17.2
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 12:11:56 +01:00
Radosław SmolińskiandClaude Opus 5.5 0dffd377a7 Merge claude/cookie-button-bottom: the cookie button never moves; the footer keeps room under its last row (owner's option 3)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 12:08:57 +01:00
Radosław SmolińskiandClaude Fable 5.2 3821174be4 Cookie button never moves; the footer gets room under its last row while the button is shown
Owner, 2026-12-01, after the review of fb92b35: option 3, "miejsce pod stopką" — the button stays in its corner at
all times and covers nothing; the page gets room under its last row.

- Removed: the step up at the end of the page (`clear`, COOKIE_BUTTON_CLEAR, stepAbove; never released).
- New: while the button is shown, the last footer (`reserve`, COOKIE_BUTTON_RESERVE; no footer: <body>) gets bottom
  padding, measured: button height + offset + safe area + 8 px, minus what is already free under the lowest text or
  control in the button's column. The footer's own padding counts (no double space); an empty corner gets nothing.
  Not before a decision, not while the banner is open, gone with the button; `reserve={false}` turns it off,
  `--ipal-cookie-button-space` on the footer sets the amount (0 = none, per breakpoint).
- No layout shift: on a static page <CookieButton> renders an inline script that makes the room before the first
  paint for a visitor who already decided — in a constructed style sheet, so the server's markup is untouched and
  React hydrates without a mismatch; after hydration the same function moves it onto the element.
- consentDecidedScript: the shared start of the banner's and the button's pre-paint scripts.
- avoid={COOKIE_BUTTON_AVOID} is still the placement before 1.17.2 (no room then).

Tests: test/cookieButtonPlacement.test.ts rewritten (24); reference e2e on desktop, 390 px and 360 px phones, light
and dark, five pages: the corner at every scroll position, nothing under the button at the very end, every footer
link clickable, layout shift < 0.001, the room before hydration.
Docs: consent.md, AGENT.md, skills, PROGRAMISTA item 83, changelog draft 1.17.2.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-12-01 12:08:00 +01:00
Radosław SmolińskiandClaude Opus 5.5 9ac56bc794 Docs: SIGN_IN_RULES_MARK; reference types with the field's description
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 11:25:25 +01:00
Radosław SmolińskiandClaude Opus 5.5 7fca1a5883 Reference site: generated types with the virtual currentPassword field (1.18.0)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 11:18:28 +01:00
Radosław SmolińskiandClaude Opus 5.5 420fe40442 Sign-in rules: tests that change their own password send the current one; field labels en/pl; the hook carries a mark
Tests and the late-staff built-site spec that change an account's OWN
password now send currentPassword (the 1.18.0 rule). The Current password
field's label and description are plain { en, pl } (house style checked by
the wording test). The beforeOperation hook carries SIGN_IN_RULES_MARK so
the password-rule hook counts stay what they measure. The injected users
collection carries Payload's lock defaults (50, 1 h).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 11:18:21 +01:00
Radosław SmolińskiandClaude Opus 5.5 66afd5ea43 Merge claude/cookie-button-bottom: the cookie button stays in the bottom corner of the window
Conflicts in the 1.17.2 changelog draft and the upgrade skill: both sides kept (rewritten into one entry at release).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 11:17:59 +01:00
Radosław SmolińskiandClaude Opus 5.5 07ad2bde60 Merge claude/security-b-1172: the consent version only goes up
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 11:17:51 +01:00
Radosław SmolińskiandClaude Opus 5.5 529a766fb1 Merge claude/security-c-1172: form submissions over REST only for staff, the job queue for an admin or Bearer CRON_SECRET, doctor visitor-writes
Conflicts with security-a-1172 kept both sides: imports (adminSameOrigin, jobsAccess), the doctor status (originKnown and visitorWrites), its test, and the e2e:built line (A's sign-in answers spec with C's CRON_SECRET).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 11:17:51 +01:00
Radosław SmolińskiandClaude Opus 5.5 21ef0fdeb0 1.18.0 (owner's decisions Q3, Q4, Q5): writes that keep others' saves, access answers announced, drafts out of related documents
- Q3: the integration status (emailStatus, turnstileStatus) is written alone through the
  database adapter (writeGlobalFields, exported): a visitor's form submit no longer puts back an
  admin's SMTP or Turnstile change saved at the same moment. addToCookieList reads the list again
  right before writing and works the change out again when an editor's save changed it (up to 5
  times). Both races reproduced exactly in test/statusWrites.test.ts, on the three adapters.
- Q4: cookieScanner.access and the doctor's access go through accessAllowed: any truthy answer
  still allows, an answer that is not a boolean is reported once per option; strict (only true)
  is announced for 1.19.0.
- Q5: related documents that are drafts are left out of what the public helpers answer
  (resolveRoute, getSettings, getArchiveEntries, the 404 page, llms-full; Markdown and MCP through
  resolveRoute): null alone, removed from a list, value null in a polymorphic one. A preview keeps
  them; draftRelations: 'keep' keeps the old behaviour. withoutDraftRelations,
  applyDraftRelations exported.
- Docs: content.md, frontend.md, integrations.md, cookie-scanner.md, security.md, AGENT.md;
  iapl-nav and iapl-doctor skills.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 11:15:13 +01:00
Radosław SmolińskiandClaude Opus 5.5 52710021ef Staff sign-in rules: failures per IP and address, own origin, current password for own changes (1.18.0)
Q2 (IAWL idea 16): Payload locks a staff account after 5 wrong passwords
from anybody, so a stranger kept the owner out without a password. Failed
sign-ins are now counted per client IP and typed address (folded: NFKC,
lower case, trim): 5 in 15 min, then 429 for that IP and address only;
only failures count (a place taken before the compare, given back on
success or refusal; "try again in a moment" while others are being
checked). Payload's own lock stays as the net at 50 failures for an hour
where the project set none. The mail service's account-mail limit now
counts per address per visitor (5) with 20 per address in all, so one
stranger no longer blocks the owner's own reset mail.
Q3 (idea 7): staff login, forgot and reset password refuse a request a
browser marks as coming from another origin (403 before anything is
counted or sent); visitor collections untouched.
Q5 (idea 29): an account that changes its own e-mail, username or password
must send its current password (panel field on the account page via the
plugin's MaskedField, no import-map change; REST and GraphQL). Admins
changing others, server code and API keys are not asked; wrong ones count
like failed sign-ins.
Options accounts.signInLimit / signInSameOrigin / confirmOwnChanges, all
validated at start. Tests: 15 HTTP tests (2FA on/off, all off), fail
before on 1.17.1; built-site spec own-account.spec.ts in e2e:built.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 11:12:40 +01:00
Radosław SmolińskiandClaude Opus 5.5 35bc4f094a Consent version test: no direct buildConfig import (testConfig guard)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 11:07:46 +01:00
Radosław SmolińskiandClaude Opus 5.5 ac6151a0ba Merge claude/security-a-1172: a locked staff account answers like a wrong password, IPv6 counted per /64, panel actions only from the site's own origin
plugin.ts import conflict: withVersionReadRules (readPublished fix) and withLockedAnswer both kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 11:06:15 +01:00
Radosław SmolińskiandClaude Opus 5.5 b72327c252 Merge claude/read-published-versions-fix: readPublished on version history, readPublishedVersions, the documented form works
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 10:56:16 +01:00
Radosław SmolińskiandClaude Opus 5.5 27ddbc3b41 Consent version only goes up (owner's decision Q2, 1.17.2)
A stored consent counts only under the version it was given for, so a lower Cookies →
Consent version made consent given under an older policy valid again. A save through access
control (panel, REST, GraphQL) with a lower number is now refused with a message (English and
Polish); the same or a higher number and saves without it pass; the Local API with
overrideAccess may still lower it. iapl({ cookieSettings: { allowLowerPolicyVersion: true } })
keeps the old behaviour. Building blocks exported: policyVersionNeverDown,
buildCookieSettingsFields, buildCookieSettings. No schema change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 10:55:44 +01:00
Radosław SmolińskiandClaude Opus 5.5 910fbd75cf IPv6 grouping without node:net (the limiter also reaches non-Node bundles; webpack build); reference index entry; export order
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 10:52:25 +01:00
Radosław SmolińskiandClaude Fable 5.2 fb92b357e8 Consent-check skill: the cookie button step after the first-paint step
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-12-01 10:50:03 +01:00
Radosław SmolińskiandClaude Fable 5.2 1025446a28 Cookie button stays in the bottom corner of the window; it no longer climbs above the footer
Owner, 2026-12-01: by default the cookie button should go to the bottom of the page, not to the footer.
Until now the button (fixed, a child of <body>) moved up by the visible part of the footer: on a phone with a tall
footer it ended at the top of the screen over the header, on a short page in the middle of it.

- Default: fixed in the bottom corner on every page and scroll position; safe-area inset also on the side.
- Only at the very end of the page it steps just above a link, button or form field it would keep covered
  (`clear`, COOKIE_BUTTON_CLEAR, stepAbove); a transform, no layout shift.
- The placement before: avoid={COOKIE_BUTTON_AVOID}; avoid={false} still means never move; className as before.

Tests: test/cookieButtonPlacement.test.ts; reference e2e on desktop and phone (corner on long and short pages,
no covered control at the page end, no layout shift, keyboard reopen).
Docs: consent.md "Where the cookie button sits", AGENT.md, skills, PROGRAMISTA item 83, changelog draft 1.17.2.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-12-01 10:49:23 +01:00
Radosław SmolińskiandClaude Opus 5.5 0f67a6884c e2e:built: a locked staff account and the panel actions checked on the built site (both bundlers)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 10:46:42 +01:00
Radosław SmolińskiandClaude Opus 5.5 03f5cf1a8d Panel actions only from the site's own origin (adminSameOrigin); doctor reads serverURL from the running config
The plugin's panel actions (mail service connect / disconnect, test e-mail,
cookie scan, approval, crawl) act with the panel's login cookie and read a
text/plain body, which another origin sends without a CORS preflight; a
sibling subdomain is same-site and Payload's csrf list is empty without
serverURL. On 1.17.1 such a page reached connect with an admin's cookie
(it called the mail service). Now each refuses a request a browser marks as
coming from elsewhere (403 before anything is read), the rule of the 2FA
endpoints; only endpoints the plugin added; logged once per origin, naming
adminSameOrigin. adminSameOrigin: false / { origins } (owner's Q6).
iapl-doctor csrf-empty: the deep status reports originKnown (serverURL or
csrf in the running config, never the value) and it wins over the file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 10:46:05 +01:00
Radosław SmolińskiandClaude Opus 5.5 4e68b7e44a 1.17.2 (owner's Q1-Q3): form submissions over REST for staff only; Payload's job queue for an admin or Bearer CRON_SECRET; doctor visitor-writes; explicit write rules on the reference site
- form-submissions create: a staff account with its second factor (formSubmissionOverrides.access.create keeps the way back)
- jobsRunAccess (default on when the project writes no jobs.access.run): admin with the second factor or Bearer CRON_SECRET (16+); start-up note when the secret is missing; jobsRunAccess: false keeps Payload's default
- iapl-doctor deep rule visitor-writes: entities a visitor login account may write, asked by behaviour
- reference: Pages, Posts, CaseStudies, Media, Header, Footer, Company get adminOrEditor write rules
- closed doors: submissions, pages, media, header, company closed for customers; the fixture's job queue refused without the secret, run with it
- route snapshot reasons, docs, AGENT.md, skills, changelog draft 1.17.2

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 10:44:18 +01:00
Radosław SmolińskiandClaude Opus 5.5 97c62f21f0 Every plugin limiter counts IPv6 per /64 (setIpv6Grouping)
clientIp() returns the whole IPv6 address and every limiter keyed on it, so
one host with a /64 had 2^64 budgets: 50 addresses of one /64 against a
limit of 5 all passed (IAWL idea 9, owner's Q4). consumeRateLimit and
checkRateLimit now count an IPv6 key by its /64 (an IPv4-mapped address by
its IPv4); the mail service's per-visitor account-mail key too. A second
counter per /48 at 10x the limit is available and off by default
(setIpv6Grouping({ wide: 48 })); setIpv6Grouping({ prefix: 128 }) counts
per address as before. ipRateKey(ip) is exported for own limiters.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 10:42:02 +01:00
Radosław SmolińskiandClaude Opus 5.5 4b17254135 readPublished on version history: readPublishedVersions, and the documented form works (1.17.2)
readVersions: readPublished(), as access.md showed, answered every version read with 500 on
MongoDB, Postgres and SQLite: the rule returns the document's `_status` path, a version query
runs on the versions collection where the status is `version._status` (SQL: "Cannot find field
for path at _status"; MongoDB: TypeError in sanitizeQueryValue). Reported by a client project
upgrading to 1.17.1.

- readPublishedVersions(minimum): the version form, for readVersions.
- readPublished() carries a symbol mark (READ_PUBLISHED); iapl() swaps it on readVersions of the
  collections and globals it sees (withVersionReadRules, exported for plugins listed after it).
- Tests on the three adapters: the version list (REST, depth 0/2, Local API, GraphQL), one version
  by id, the count, a global, an explicit role; the 1.17.1 HTTP test now checks the status too.
- access.md says where each rule goes; AGENT.md, iapl-collection and iapl-audit skills.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 10:39:41 +01:00
Radosław SmolińskiandClaude Opus 5.5 15b5c6258d A locked staff account answers its login like a wrong password (accounts.lockedAnswer)
Payload checks the lock before the password, so after five wrong passwords
a staff address answered "This user is locked…" to any password while an
address with no account always answered "The email or password provided is
incorrect.": anybody could find out which addresses have a staff account
(IAWL idea 6, owner's Q1). A config-level afterError hook now answers
LockedAuth on a staff collection's login exactly like AuthenticationError:
REST status and body, GraphQL message and extensions.name. The lock is
unchanged; visitor collections keep Payload's answer.
accounts: { lockedAnswer: 'payload' } keeps Payload's message; any other
value stops the start. Building blocks lockedLooksWrong, withLockedAnswer,
graphqlLoginName.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 10:39:40 +01:00
Radosław SmolińskiandClaude Opus 5.5 fc70a34f3e 1.17.1 notes: the sending method (PROGRAMISTA 82, the upgrade skill's item number, one stray bold mark)
CI / check (push) Failing after 6m56s
CI / reference (push) Skipped
CI / reference-full (push) Skipped
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 23:27:59 +01:00
Radosław SmolińskiandClaude Opus 5.5 344b84f9fc Merge claude/mail-transport-choice: "Sending method" is an explicit choice in the panel (IWSN, own SMTP, Graph); nothing changes until another option is picked
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 23:27:36 +01:00
Radosław SmolińskiandClaude Fable 5.2 dc3e594d38 Sending method, the owner's answers: nothing changes until another option is picked; the panel warns before the save
- a save that sends the method already shown, while nothing is stored, stores nothing: the site keeps sending
  exactly as before and keeps following what is filled in, until somebody picks ANOTHER option
- the state block reads the form as it is edited and warns at once when "Own SMTP server" is picked with server,
  user name or password empty, or "Microsoft Graph" on a server without GRAPH_* (graphReady in the panel state);
  it reloads after every save
- texts, doctor's info finding, docs, skills, changelog; reference e2e checks the warning

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 23:15:42 +01:00
Radosław SmolińskiandClaude Fable 5.2 8c19391590 Sending method, review M-1 and M-2: the plugin's own status write never stores a choice; a non-method is refused
- M-1: the save rule of `emailMethod` ran after the early return for the plugin's status writes, so the first
  failed (or recovered) send stored the method the read showed as if an admin had chosen it. The rule is now a
  hook of its own that runs on every write: a write that does not name the method leaves what is stored, empty
  included.
- M-2: a sent value that is not null or one of the three methods (a number, a list, another word) is refused
  with a ValidationError (400) before it reaches the database.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 23:08:34 +01:00
Radosław SmolińskiandClaude Fable 5.2 f2da28e7cb Reference site: generated types with the field emailMethod
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 22:48:42 +01:00
Radosław SmolińskiandClaude Fable 5.2 ee8ea42956 E-mail: "Sending method" is an explicit choice - IWSN (built-in), Own SMTP server, Microsoft Graph (deprecated)
What is chosen is what is used. The choice is the stored field `emailMethod` of Site integrations (empty until
somebody chooses); `emailTransport` of 1.6 - 1.17.0 stays, hidden.

- no silent switch: a chosen method that cannot be used (SMTP incomplete, Graph without GRAPH_*) fails loudly
  - status smtp-incomplete / graph-not-set-up, state block, doctor mail-method - and nothing is sent another way
- upgrade writes nothing and loses no mail: until somebody chooses, the order of 1.17.0 applies and the field
  shows its result as selected; the first save of the panel's form stores the choice
- only the chosen method's fields are shown; the test e-mail names the method (Graph too)
- mail: { relay: false } does not offer "IWSN" (the stored values stay three: one SQL enum for every project)
- Postgres / SQLite: one migration (a column). Before it runs the plugin's readers read the global without the
  field, mail goes the old way, one loud log line and the doctor say what to do
- getMailMethod, setMailMethod, resolveMailMethod, readMailSettings, mailMethodColumnMissing exported
- tests on SQLite, Postgres and MongoDB, with and without the migration; docs, AGENT.md, skills, changelog

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 22:39:03 +01:00
Radosław SmolińskiandClaude Fable 5.2 c6841a1674 WIP: sending method as an explicit choice, kept in payload-kv (superseded: the choice moves to a stored field)
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 22:30:03 +01:00
Radosław SmolińskiandClaude Opus 5.5 726f028e9f 1.17.1 notes: the sign-in logo as 1.17.0 shows it (an SVG too, no plate)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 22:27:17 +01:00
Radosław SmolińskiandClaude Opus 5.5 1f65e1c97f Merge claude/login-page-whitelabel-616f3d: the sign-in logo as 1.17.0's login screen shows it (SVG as an image, no plate)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 22:26:57 +01:00
Radosław SmolińskiandClaude Fable 5.2 24ccc5dc8b Sign-in look: the logo is handled as the white label handled it in 1.17.0 (owner, 2026-11-26)
A logo that showed on a site's login screen shows on the new screens: any picture Site settings holds,
an SVG included, as <img>; svgLogo: false refuses SVG (off by default); the list of allowed types is
gone. The look at the file only avoids a broken picture: a file that is gone (404 / 410) or is no picture
gives the name; anything else (no answer, a redirect, another status, over 512 KB) believes the upload.
Redirects are still never followed by the server, and the body is read with the 512 KB cap. A test
checks twelve kinds of logo that 1.17.0 shows. No plate stays the default. Docs, skills, changelog draft.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 22:14:50 +01:00
Radosław SmolińskiandClaude Opus 5.5 68a2555277 1.17.1 upgrade notes
PROGRAMISTA §6 rows 79 (security: strict switches, write-only secrets out of queries), 80 (the sign-in look),
81 (the proxy matcher); iapl-upgrade "→ 1.17.1, security" and item numbers; reference skills, AGENTS.md and the
reference index on 1.17.1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 22:05:42 +01:00
Radosław SmolińskiandClaude Opus 5.5 38f1c012c4 1.17.1
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 22:05:42 +01:00
Radosław SmolińskiandClaude Opus 5.5 99073e24e9 routes.snapshot.json: admin-language in sorted place
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 22:04:35 +01:00
Radosław SmolińskiandClaude Opus 5.5 7159ec25de Merge claude/login-page-whitelabel-616f3d: the panel's sign-in look (whiteLabel.signIn), the client's logo, hardened brand image fetch
Conflicts kept both sides: the 2FA texts (twoFactorBusy from A, twoFactorCodeDigit here), the reference index rows,
and the e2e:built line (closed doors from C and the sign-in look here). routes.snapshot.json judges the new public
GET /api/ipal/admin-language.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 22:04:30 +01:00
Radosław SmolińskiandClaude Fable 5.2 aef1efac73 Public brand image fetch: the site's configured origin only, no redirect followed, a time and a byte limit
/api/ipal/admin-og resolved a relative logo address against the request's own host and fetched it with
Node's defaults (redirects followed, no timeout, no size cap); /api/ipal/admin-icon resolved the same way.
Both now resolve against serverURL / NEXT_PUBLIC_SERVER_URL (never the request) and fetch through
fetchPublicImage, which asks one address with redirect: 'manual' (a 3xx is no image), within
PUBLIC_IMAGE_TIMEOUT_MS, reading at most 512 KB. The renderer still draws PNG, JPEG, GIF (by their bytes)
and SVG (by its type, as before). Tests against local servers: hostile Host / X-Forwarded-Host, a 302 to an
internal host, an endless body, a hanging server, the normal logo. Docs say 1.17.1 instead of 1.18.0.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 22:03:52 +01:00
Radosław SmolińskiandClaude Fable 5.2 562bf5388d Sign-in look: the logo check never follows a redirect; the review pictures stay out of the package
checkLogoFile asks only the address the upload has (redirect: 'manual'); a redirecting logo counts as
unknown, so the server fetches nothing at an internal address. docs/dev/login-page/*.png is excluded
in package.json files (npm pack --dry-run: none of them packed).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 21:44:39 +01:00
Radosław SmolińskiandClaude Opus 5.5 7026254c25 Reference skills: copies synced after the security B merge
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 21:43:05 +01:00
Radosław SmolińskiandClaude Opus 5.5 df9f2f3de3 Merge claude/security-b-content-state-cc308e: sizes before work, one link rule, no stand-in locale, strict switches, write-only secrets cannot be queried
AGENT.md conflict: the 2FA rows from A, the stored-secrets row from B (its check answers 400 QueryError, not 403).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 21:43:03 +01:00
Radosław SmolińskiandClaude Opus 5.5 12bb6be76e Reference skills: copies synced after the security A and C merges
Branch A changed docs/agent/skills without its reference copies; iapl-doctor's skills-current warned on the reference
site.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 21:20:35 +01:00
Radosław SmolińskiandClaude Opus 5.5 eb2ad27787 Write-only secrets cannot be queried (review B-R1)
A where or sort on a write-only field answered by the stored value: as an admin,
where[version.smtpPassword][like]=Zq on Site integrations' versions gave a count, so the
secret could be read back one character at a time. writeOnlySecret now gives the field a
read rule, secretReadAccess (exported), that denies when Payload checks a query's fields
(no document) and allows a document read (masked as before). The panel's edit and create
views pass the document, so the field stays visible and editable there.

Covered: the global, its versions, a collection with and without versions, REST and
GraphQL, like / equals / exists / or / sort / count; reads still masked; panel
permissions; a save still stores the new value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 21:10:45 +01:00
Radosław SmolińskiandClaude Opus 5.5 dd8cc5ecbd Merge claude/security-c-files-jobs-tests-cfba70: resolved paths in the bins and starter, proxy matcher ends at /, closed doors on the built site, every public route judged
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:57:50 +01:00
Radosław SmolińskiandClaude Opus 5.5 675d0c1997 Merge claude/security-a-signin-limits-80f95e: 2FA verify limit counts wrong codes only, exempt by an admin-only field, 2FA reset only from the site's own origin
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:57:45 +01:00
Radosław SmolińskiandClaude Fable 5.2 939ab679c7 Sign-in look: the logo follows IAWL's rules; no plate by default; the brand fields are admin-only
Bitmaps only (JPEG, PNG, WebP, AVIF, GIF; SVG with svgLogo: true), the file fetched and checked by its
bytes before it is printed (checkLogo; 512 KB; ten-minute memory; an unreachable address is believed),
served from a generated size at least twice the shown width. logoPlate replaces logoMadeFor: no plate
unless asked. With the look on, the name, logo and icon of Site settings are changed by admins only
(brandAccess: 'editor' gives them back). Docs, skills, changelog draft, tests and pictures follow.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 20:52:41 +01:00
Radosław SmolińskiandClaude Fable 5.2 3ceeab8469 Sign-in look: screenshots (before, after, an unedited 1.16.7 site, IAWL for comparison) and the capture script
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 20:39:27 +01:00
Radosław SmolińskiandClaude Fable 5.2 b6c91a3a11 Sign-in look: the client's logo or the site's name on a dark panel beside the form (whiteLabel.signIn)
On by default with whiteLabel. The login screen and the 2FA screens get the look through AdminLogo and
SafeTotpView, which every site already has in its import map: an upgrade needs no edit. allScreens adds one
provider (SignInLook) for forgot / reset password, first user and logout; a production start leaves it out
when the import map on disk lacks it. Logo and name come from Site settings: no new field, no migration.
Language links through GET /api/ipal/admin-language (Payload's own cookie, back to an admin path only).
Options: accent, logoMadeFor, languages, svgLogo; whiteLabel.brandAccess 'admin'. The 2FA code boxes get
names for screen readers. Reference site and starter: allScreens on. Docs, agent guide, skills, tests.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 20:35:33 +01:00
Radosław SmolińskiandClaude Opus 5.5 8f443c9214 Lint: the new route inventory, its tests and the touched tests
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:33:04 +01:00
Radosław SmolińskiandClaude Opus 5.5 d4fe3bf4ba Agent reference: the route-check exports; reference index: the closed-doors and route-check files
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:29:47 +01:00
Radosław SmolińskiandClaude Opus 5.5 2468390538 Outside-in tests (IAWL ideas 33, 34): closed doors on the built site as anonymous, customer and editor; every public route judged
- reference/e2e/closed-doors.ts + closed-doors.spec.ts: one table of doors, asked by pnpm e2e:built in both bundlers;
  doors still open while the owner decides are asserted open (test.fail) with their question
- listPublicRoutes / listNextRouteFiles / compareRouteSnapshot / updateRouteSnapshot (main entry), runRouteCheck (/doctor)
- reference/e2e/routes.ts + routes.snapshot.json (395 routes, one reason each); pnpm routes:check [--update], first step of e2e:built
- create-test-admin.ts makes an editor test account
- docs: security.md sections, AGENT.md 8a, iapl-audit templates, iapl-upgrade 1.17.1, changelog draft

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:26:30 +01:00
Radosław SmolińskiandClaude Opus 5.5 ecf03c8dc0 IAWL ideas, group B: sizes before work, one link rule, no stand-in locale, strict switches
- Request bodies from strangers are read only up to a cap, declared length or not:
  mail-service confirm, CSP reports, page views, MCP (maxBytes, 413). readCappedBody moves
  to shared/ (the consent log keeps exporting it).
- searchContent / createSearchRoute / MCP search: queryLimit (default 200 characters,
  10 words) before the database; an unknown ?locale is the default locale throughout.
- Rich text: autolinks and links marked internal pass safeHref too; lexicalToMarkdown
  drops unsafe link targets.
- truncate() never returns more than its limit (summary / meta autofill after validation).
- resolveRoute answers null for a locale the site does not have (xx, all, *): no
  default-locale page under another code (page route past the proxy, /md/xx, MCP).
- A 404 page that is a draft is not shown (resolveNotFoundPage, getNotFoundPage).
- readPublished() access rule (exported); Site integrations readVersions: admin.
- Plugin switches, buildCsp, buildSecurityHeaders and the seed guard refuse nonsense
  values at start; an unknown role name is met by nobody, requireRole throws on one.
- Docs, AGENT.md, iapl-collection and iapl-audit skills.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:25:26 +01:00
Radosław SmolińskiandClaude Opus 5.5 b2fed3bf90 Turnstile docs: limit before asking Cloudflare; test and lint fixes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:22:21 +01:00
Radosław SmolińskiandClaude Opus 5.5 6ca0730c08 2FA reset endpoint: only from the site's own origin (twoFactor.sameOrigin)
POST /api/ipal/two-factor/reset reads a text/plain body, which another
origin can send without a CORS preflight; a sibling subdomain is same-site,
so the browser sends the admin's SameSite=Lax cookie, and Payload's csrf
list is empty without serverURL. Such a page could reset any account's
TOTP and end its sessions (reproduced on SQLite, Postgres, MongoDB). Now the
endpoint takes the same origin rule as verify and setup, before it reads
or changes anything; twoFactor.sameOrigin: false leaves it out, and
buildTwoFactorResetEndpoint takes ownOrigin for own wiring.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:18:57 +01:00
Radosław SmolińskiandClaude Opus 5.5 91770ec17f 2FA verify limit: a right code gives its place back; exempt by an admin-only field, not e-mail (docs)
The verify limit took a place for every attempt and kept it, so the sixth
correct login of one account within 10 minutes was refused (IAWL idea 27).
Now an attempt takes its place before the compare (a parallel burst still
cannot slip under the limit), a right code gives it back, an attempt refused
without a compare gives it back at once, and a new attempt held out only by
attempts still being checked gets 429 + Retry-After: 2 "try again in a
moment". buildVerifyLimit returns limit.settle(req, correct); the plugin's
guard calls it with the package's answer. No schema change: payload-kv keeps
{ count, resetAt }.

Docs: the exempt example keyed on e-mail, which every account may change
itself (shown over REST and GraphQL): now an admin-only checkbox, with a test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:15:51 +01:00
Radosław SmolińskiandClaude Opus 5.5 498b3dbf38 Files and paths (IAWL ideas 12, 13, 36): resolved --dest, starter refuses links and escaping paths, Office ZIP entries with trailing dots, proxy matcher ends api/admin/_next at /
- iapl-skills: --dest is compared with the project root after resolving links; a folder that is the root or holds it (.., /) is refused
- starter: collectBundle refuses symbolic links (their target would ship in the published bundle); writeFiles refuses absolute or escaping paths
- form files: a program inside a DOCX/XLSX is found with trailing dots or spaces (Windows drops them)
- proxy matcher: (?!(?:api|admin|_next)(?:/|$)|...) so /administracja, /apis get the proxy; doctor rule proxy-matcher reports the old literal
- pnpm: @swc/core in ignoredBuiltDependencies (its postinstall only checks the native binary, already installed)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:14:59 +01:00
Radosław SmolińskiandClaude Opus 5.5 e821d52d19 CLAUDE.md: the plugin is called IAPL (iapl-* skills, iapl-skills)
CI / check (push) Failing after 7m26s
CI / reference (push) Skipped
CI / reference-full (push) Skipped
Both rules keep their meaning word for word; only the names change. Not part of the npm package.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 14:45:26 +01:00
461 changed files with 26081 additions and 1430 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ Start with `.claude/skills/payload/SKILL.md` for a quick reference, then see `.c
## Main rule: the plugin helps projects, never limits them ## Main rule: the plugin helps projects, never limits them
ipal-kit is a plugin. Every change must leave the consuming project free to adapt it. IAPL (Intecion Advanced Payload Library, package `@intecion/ipal-kit`, formerly ipal-kit) is a plugin. Every change must leave the consuming project free to adapt it.
- Every module and feature can be turned off on its own. Turning one off never takes away anything the project still needs. - Every module and feature can be turned off on its own. Turning one off never takes away anything the project still needs.
- Every default can be overridden: access rules, fields, hooks, labels, routes, collections and globals. The project's own config is merged with the plugin's and wins. - Every default can be overridden: access rules, fields, hooks, labels, routes, collections and globals. The project's own config is merged with the plugin's and wins.
@@ -15,7 +15,7 @@ ipal-kit is a plugin. Every change must leave the consuming project free to adap
## Rule: an agent that adds the plugin gets the complete guide ## Rule: an agent that adds the plugin gets the complete guide
When an agent adds ipal-kit to a project, `docs/agent/AGENT.md` and the `ipal-*` skills (installed by `ipal-skills`) must tell it how to set up and use every function the plugin supports. When an agent adds IAPL to a project, `docs/agent/AGENT.md` and the `iapl-*` skills (installed by `iapl-skills`) must tell it how to set up and use every function the plugin supports.
- Every export, option, env var, route, middleware, layout component, admin import-map entry and hook a project must wire is documented, with steps and a way to verify it. - Every export, option, env var, route, middleware, layout component, admin import-map entry and hook a project must wire is documented, with steps and a way to verify it.
- A change that adds or alters a feature updates the agent guide and the matching skill in the same change. - A change that adds or alters a feature updates the agent guide and the matching skill in the same change.
+18 -4
View File
@@ -16,8 +16,8 @@
// text between the markers is ever rewritten; the project's own content stays as it is. // text between the markers is ever rewritten; the project's own content stays as it is.
import { createHash } from 'node:crypto' import { createHash } from 'node:crypto'
import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from 'node:fs' import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync } from 'node:fs'
import { dirname, join, relative, resolve } from 'node:path' import { basename, dirname, join, relative, resolve, sep } from 'node:path'
import { fileURLToPath } from 'node:url' import { fileURLToPath } from 'node:url'
const args = process.argv.slice(2) const args = process.argv.slice(2)
@@ -39,8 +39,22 @@ if (!destValue || destValue.startsWith('-')) {
process.exit(1) process.exit(1)
} }
const dest = resolve(process.cwd(), destValue) const dest = resolve(process.cwd(), destValue)
if (dest === resolve(process.cwd())) { // Compared AFTER resolving links: `--dest root-link` (a link to `.`), `..` or `/` would otherwise pass and lose
console.error('iapl-skills: --dest must be a subdirectory, not the project root') // the iapl-* folders of the project root, its parent or the filesystem root. A folder that does not exist yet is
// resolved through its nearest existing parent.
const real = (path) => {
const rest = []
let at = path
while (!existsSync(at) && dirname(at) !== at) {
rest.unshift(basename(at))
at = dirname(at)
}
return join(realpathSync(at), ...rest)
}
const realDest = real(dest)
const realRoot = real(resolve(process.cwd()))
if (realDest === realRoot || realRoot.startsWith(realDest.endsWith(sep) ? realDest : `${realDest}${sep}`)) {
console.error(`iapl-skills: --dest must be a folder inside the project or elsewhere, not the project root or a folder that holds it (${destValue} is ${realDest})`)
process.exit(1) process.exit(1)
} }
+21
View File
@@ -1,5 +1,26 @@
# Changelog of the wire contract # Changelog of the wire contract
## 1.8.0 — 2026-12-01 (not released; no tag yet)
A site is confirmed by a person of Intecion on the service's own page (§2.1). Additive: a client of 1.7 keeps
working — its sites enrol, are `pending`, and get `403 site-pending` until an operator confirms them by hand.
**Client: to let its own administrator start the confirmation, add what is marked.**
- **New route `POST /v1/connect`** (token and `X-Intecion-Site`, no body). For a pending site it answers
`{ ok, state: "pending", connectUrl, expiresAt }` — a link valid 15 minutes, for one confirmation, each call
replacing the earlier link; for an active site `{ ok, state: "active" }`. **Client: a panel button that asks
for the link from the server on the click and opens `connectUrl` in a new tab** (after checking that it
begins with the service's base address and `/connect?`). Schema `ConnectResponse`.
- **New code `503 connect-unavailable`** (not retryable): no confirmation page is set up. **Client: show "ask
Intecion to confirm this site".**
- **`/v1/status` of a pending site may carry `connectAvailable: true`.** **Client: show the button only then.**
- **How a site learns that it was confirmed:** it asks `/v1/status` (at most every 5 seconds for at most 10
minutes while the panel that opened the link is open, and on every panel load), or it simply sends. The
service does not call the site. **Client: add the polling.**
- `site-pending` now reads "not yet confirmed by Intecion"; its handling is unchanged.
- Examples: `connect-pending`, `connect-active`, `connect-suspended`, `connect-unavailable`,
`status-pending-connect`; `given.connect`.
## 1.7.1 — 2026-11-25 (not released; no tag yet) ## 1.7.1 — 2026-11-25 (not released; no tag yet)
Wording only; nothing for a client to change, and a copy of 1.7.0 need not be refreshed for it. Wording only; nothing for a client to change, and a copy of 1.7.0 need not be refreshed for it.
+10 -5
View File
@@ -1,12 +1,16 @@
3d5c4b7ed53fe6fe2c7c28826c0cf666f9c1d0b79f861b404503e7029728a61f README.md eabe3563e3ada8c4bb85ca03be33b259a38f80e49cc235603096e6efd74974a5 README.md
53da77d5dfff9948d68fca26b828563e21f83418245053d78b03a5aecac6c1d1 CHANGELOG.md af76187dbaf87e9ad8de8bf75f1066ec2f3120fb8d1de34feb2028d67f478f92 CHANGELOG.md
249182a01164b81a5f7af87e5c5cdbd3344a80a7a66dfca624cecfb1501b2420 VERSION 3eb1ef94b5890ca727158b106142685c8733b0ace5bcb4cf3f0ac14f9f0643f4 VERSION
2ff0ad5b6a245365c0fa8733fa17b7bbd3ab91d4825981709d0fd02b762b939f schema.json 9d1e429d266561d4b4baddee5fa8526c7fbce93dad0f16c32fe6e0999b5c9475 schema.json
9d8381d2e3465e97dc801a61f598fcf822e27e73a2c0729877744ec307097910 runner.mjs 8a15b61b862fb01c8cb928ef202ba0bb14cf77cbce1fd1bfe32be6873d67989b runner.mjs
7c46860adee597e570832c72bcdb418752a20b9f7d1b2d7a656ed065f9632b2a checksums.mjs 7c46860adee597e570832c72bcdb418752a20b9f7d1b2d7a656ed065f9632b2a checksums.mjs
df6015faf02a7cf7e9b5816b9e22b2e82968678ddd72a61c1f9665a8c0897ddf examples/callback-confirm-wordpress.json df6015faf02a7cf7e9b5816b9e22b2e82968678ddd72a61c1f9665a8c0897ddf examples/callback-confirm-wordpress.json
f5018ca4fb7d25794ee92168d715aaf47feeba3d907c0550651b16c10a691ceb examples/callback-confirm.json f5018ca4fb7d25794ee92168d715aaf47feeba3d907c0550651b16c10a691ceb examples/callback-confirm.json
27bd95712cc36a71519cddc52c03d857b1009c2c384940dbc052022d86bc4231 examples/callback-unknown-nonce.json 27bd95712cc36a71519cddc52c03d857b1009c2c384940dbc052022d86bc4231 examples/callback-unknown-nonce.json
4008be4ec65e46d6a43221e400acf8682162cb14d54c5d8a4ab20b49e9985821 examples/connect-active.json
9110ce20a6577b5884fa48a7ddb5d203f4671c863d56ef952a411907daaf45de examples/connect-pending.json
6658a53ffec104a45e00fe962801bdc1a2b47a3f9cb10647d5405e0ed0355fa6 examples/connect-suspended.json
394096063e2c135bb99622d4b37f65ad609cb276b610949fffdc26175cdb0dc9 examples/connect-unavailable.json
de693b060c10c3d0f88fb8edfcd38c491cf141628d747328beee1b50c700c19b examples/enrol-address-literal.json de693b060c10c3d0f88fb8edfcd38c491cf141628d747328beee1b50c700c19b examples/enrol-address-literal.json
7c4cf75eb9ab156a3031336ab2688e7c9dcd4cd266b7b7e5e4592285dcbd25ba examples/enrol-callback-no-content.json 7c4cf75eb9ab156a3031336ab2688e7c9dcd4cd266b7b7e5e4592285dcbd25ba examples/enrol-callback-no-content.json
64466afc5bf0fecfa36f986d973cd987bbe1f64867e01cdf35e0de40838eb0d1 examples/enrol-callback-not-found.json 64466afc5bf0fecfa36f986d973cd987bbe1f64867e01cdf35e0de40838eb0d1 examples/enrol-callback-not-found.json
@@ -60,5 +64,6 @@ ce4cbea2306f73bd5905249c10ab451a2599cb779e2386828971f40c97b8c591 examples/send-
28e05f3c53cab6433b6af4d425511fa6655d0673df2e840af1fed9d25294a123 examples/send-unknown-token.json 28e05f3c53cab6433b6af4d425511fa6655d0673df2e840af1fed9d25294a123 examples/send-unknown-token.json
f105c38ab11ab5fc508ba0ed3f23f69108c318765c2670029b230b5b9a83912a examples/status-active.json f105c38ab11ab5fc508ba0ed3f23f69108c318765c2670029b230b5b9a83912a examples/status-active.json
89009ee9ab8f38e9ec290fb5412f206e1be28ad10fce6a7071d4406ac52dd4f0 examples/status-no-site-header.json 89009ee9ab8f38e9ec290fb5412f206e1be28ad10fce6a7071d4406ac52dd4f0 examples/status-no-site-header.json
28eeab5dc50c26f452e438f5cceddf99635ee7b3897e44dfe4255eb49123cc0f examples/status-pending-connect.json
c9f49fa0dae1f0beacaacfe01660b467d06f990228c35a653307c8793f3c97a5 examples/status-pending.json c9f49fa0dae1f0beacaacfe01660b467d06f990228c35a653307c8793f3c97a5 examples/status-pending.json
afdb07ba8279479b6bbfdc4289efda657d4e5a9eccd94b8de165ec728b4a2386 examples/status-unknown-address.json afdb07ba8279479b6bbfdc4289efda657d4e5a9eccd94b8de165ec728b4a2386 examples/status-unknown-address.json
+71 -3
View File
@@ -1,6 +1,6 @@
# Intecion Notifications Webservice — wire contract # Intecion Notifications Webservice — wire contract
Version: see [`VERSION`](VERSION) (this text describes **1.7.1**). Path prefix of this major version: `/v1`. Version: see [`VERSION`](VERSION) (this text describes **1.8.0**). Path prefix of this major version: `/v1`.
This is the whole agreement between the Intecion Notifications Webservice ("the service" below) and a client (the mail transport built into a This is the whole agreement between the Intecion Notifications Webservice ("the service" below) and a client (the mail transport built into a
site's plugin). It names no product: nothing here says Payload, WordPress, IAPL or IAWL except the values of site's plugin). It names no product: nothing here says Payload, WordPress, IAPL or IAWL except the values of
@@ -63,7 +63,7 @@ Every refusal has the same body ([`Error`](schema.json)) — with one exception:
| 400 | `invalid-request` | Body, header or field is wrong; `field` names it | no | Report a bug | — | | 400 | `invalid-request` | Body, header or field is wrong; `field` names it | no | Report a bug | — |
| 401 | `invalid-token` | No token, or one the service does not know (unknown, expired, revoked) | no | Enrol again, then send once more (§2, "Which token") | — | | 401 | `invalid-token` | No token, or one the service does not know (unknown, expired, revoked) | no | Enrol again, then send once more (§2, "Which token") | — |
| 401 | `reverify` | The token is good but comes from a server address the service has not seen for this site | no | Enrol again (the same call-back), then send once more | — | | 401 | `reverify` | The token is good but comes from a server address the service has not seen for this site | no | Enrol again (the same call-back), then send once more | — |
| 403 | `site-pending` | Enrolled, waiting for approval by Intecion | no | Keep the token; show "waiting for approval" | `relay-pending` | | 403 | `site-pending` | Enrolled, not yet confirmed by Intecion (§2.1) | no | Keep the token; show "waiting for confirmation" with the connect button (§2.1) | `relay-pending` |
| 403 | `site-suspended` | Stopped by Intecion | no | Keep the token; show it; do not enrol again | `relay-suspended` | | 403 | `site-suspended` | Stopped by Intecion | no | Keep the token; show it; do not enrol again | `relay-suspended` |
| 403 | `host-not-allowed` | Enrolment: the host is not a public DNS name | no | Show it (a local or private site cannot use the service) | `relay-refused` | | 403 | `host-not-allowed` | Enrolment: the host is not a public DNS name | no | Show it (a local or private site cannot use the service) | `relay-refused` |
| 403 | `enrolment-closed` | Enrolment is closed for this product, or altogether | no | Show it | `relay-refused` | | 403 | `enrolment-closed` | Enrolment is closed for this product, or altogether | no | Show it | `relay-refused` |
@@ -85,6 +85,7 @@ Every refusal has the same body ([`Error`](schema.json)) — with one exception:
| 429 | `quota-exceeded` | A limit of the site (`limit`: `hour`, `day`, `recipient`, `new-recipients`, `alerts`) or of the whole service (`service`) | no | Show it; the message is not sent | `relay-quota` | | 429 | `quota-exceeded` | A limit of the site (`limit`: `hour`, `day`, `recipient`, `new-recipients`, `alerts`) or of the whole service (`service`) | no | Show it; the message is not sent | `relay-quota` |
| 502 | `backend-failed` | The mail back end failed, or refused this message | **as `retryable` says** | Retry with the same key when `retryable` is true | `relay-unreachable` if it persists | | 502 | `backend-failed` | The mail back end failed, or refused this message | **as `retryable` says** | Retry with the same key when `retryable` is true | `relay-unreachable` if it persists |
| 503 | `unavailable` | The service cannot work right now | **as `retryable` says** | Retry when `retryable` is true | `relay-unreachable` if it persists | | 503 | `unavailable` | The service cannot work right now | **as `retryable` says** | Retry when `retryable` is true | `relay-unreachable` if it persists |
| 503 | `connect-unavailable` | `/v1/connect` only: the service has no confirmation page set up right now | no | Show "ask Intecion to confirm this site"; do not retry by itself | `relay-pending` |
| 500 | `internal` | A fault in the service | **yes** | Retry | `relay-unreachable` if it persists | | 500 | `internal` | A fault in the service | **yes** | Retry | `relay-unreachable` if it persists |
A network error or a time-out is treated like `503`. The "suggested site status" column is advice, in the words A network error or a time-out is treated like `503`. The "suggested site status" column is advice, in the words
@@ -240,6 +241,66 @@ Rules a client must know:
site stores it the same way. site stores it the same way.
- Use the token only from the site's server. Never print it, never send it to a browser. - Use the token only from the site's server. Never print it, never send it to a browser.
### 2.1 Connecting a waiting site — `POST /v1/connect` (since 1.8.0)
An enrolment proves that a site is served at its host; it does not prove that the site is Intecion's. Under the
service's `connect` policy every newly enrolled site is therefore **`pending`** and sends nothing
(`403 site-pending`) until a person of Intecion confirms it on the service's own page, signed in with an
`@intecion.com` address. The site's part is to hand that person the link:
1. **The site enrols as always** (§2). The answer says `"state": "pending"`; the token is stored as always.
2. **An administrator of the site presses a button in the site's panel** ("Połącz z IWSN"). On that click — never
on page load, never by itself — the site's **server** calls
```
POST /v1/connect
Authorization: Bearer ims_…
X-Intecion-Site: example.com
```
with no body (or `{}`). If the site holds no token yet it enrols first, as before any other call. The answer
([`ConnectResponse`](schema.json)):
```json
{ "ok": true, "state": "pending",
"connectUrl": "https://webservices.intecion.net/mail/connect?ref=…",
"expiresAt": "2026-12-01T10:15:00.000Z" }
```
| Answer | Meaning | The panel |
|---|---|---|
| `200`, `state: "pending"`, `connectUrl`, `expiresAt` | A link for this host, valid **15 minutes**, usable for **one** confirmation. Each call makes a new link and the earlier one stops working | Opens `connectUrl` in a **new browser tab** |
| `200`, `state: "active"` (no `connectUrl`) | The site is confirmed already | Shows "connected"; opens nothing |
| `403 site-suspended` | Stopped by Intecion | As everywhere |
| `503 connect-unavailable` | The service has no confirmation page right now | "Ask Intecion to confirm this site" (an operator can do it by hand) |
| `429 rate-limited` | More than 10 links for this site within an hour | Wait `retryAfter` |
| `401` / `403 host-mismatch` | As for every route with a token (§8) | Enrol again / forget the token, as there |
3. **The browser opens `connectUrl`** as a top-level navigation in a new tab
(`target="_blank" rel="noopener noreferrer"`, or the equivalent after the click). The client
- takes the address from the answer as it is and adds nothing to it;
- opens it only if it begins with the service's base address followed by `/connect?` — anything else is a
fault, shown as such;
- never fetches it from the server, never puts it in a frame, never stores it and never writes it to a log.
It is not a secret — it authorises nothing by itself, the person's sign-in does — but it is of use only
for those fifteen minutes.
4. **On the service's page** the person signs in (Cloudflare Access: a one-time code sent to their
`@intecion.com` address), sees the host, and presses "Potwierdź". Nothing of this passes through the site.
5. **The site learns that it is active by asking** — the service never calls the site for this:
- `GET /v1/status` answers `"state": "active"`. While the panel that opened the link is open, the client
asks **at most every 5 seconds, for at most 10 minutes**, then stops and shows "not confirmed yet" with
the button again. It also asks whenever the panel is loaded.
- Or simply by sending: the first `/v1/send` after the confirmation is accepted. Mail refused with
`site-pending` before that was **not sent and is not kept by the service**; what a client does with it is
what it does for any refusal that is not retryable.
**States a panel shows.** `pending` with `connectAvailable: true` in `/v1/status` (§4): "waiting for
confirmation" and the button. `pending` without it: "waiting for approval by Intecion", no button. `active`:
connected. `suspended`: stopped by Intecion.
A pending site that nobody confirms is forgotten 14 days after it first enrolled; it then enrols again by itself
on its next send and is pending again.
## 3. Sending — `POST /v1/send` ## 3. Sending — `POST /v1/send`
Headers (`Bearer` in any case; one space; then the token exactly): Headers (`Bearer` in any case; one space; then the token exactly):
@@ -360,7 +421,7 @@ not go out ([`StatusResponse`](schema.json)):
```json ```json
{ "ok": true, "state": "active", "host": "example.com", "product": "iapl", { "ok": true, "state": "active", "host": "example.com", "product": "iapl",
"service": { "name": "Intecion Notifications Webservice", "version": "1.0.0", "contract": "1.7.1" }, "service": { "name": "Intecion Notifications Webservice", "version": "1.0.0", "contract": "1.8.0" },
"sender": { "address": "[email protected]" }, "sender": { "address": "[email protected]" },
"limits": { "messagesPerHour": 30, "messagesPerDay": 200, "recipientsPerMessage": 10, "limits": { "messagesPerHour": 30, "messagesPerDay": 200, "recipientsPerMessage": 10,
"perRecipientPerDay": 10, "newRecipientsPerDay": 50, "perRecipientPerDay": 10, "newRecipientsPerDay": 50,
@@ -372,6 +433,9 @@ not go out ([`StatusResponse`](schema.json)):
A client takes its attachment limit from `limits.maxAttachmentBytes`, never from a constant of its own. A client takes its attachment limit from `limits.maxAttachmentBytes`, never from a constant of its own.
Since 1.8.0 the answer for a **pending** site may carry `"connectAvailable": true`: the site can be confirmed
through `/v1/connect` (§2.1) and a panel shows the button. The field is left out otherwise.
## 5. Rotation — `POST /v1/rotate` ## 5. Rotation — `POST /v1/rotate`
`Authorization: Bearer ims_…`, no body. When `token.rotateAfter` has passed (90 days after issue), the client `Authorization: Bearer ims_…`, no body. When `token.rotateAfter` has passed (90 days after issue), the client
@@ -474,6 +538,7 @@ Each file in `examples/` is one case:
| `quota` | `fresh`, `hour-exhausted`, `day-exhausted`, `recipient-exhausted`, `hour-share-used` | The site's counters. `recipient-exhausted`: `{{recipient}}` got the day's maximum of form confirmations. `hour-share-used`: mail other than `account` has used its four fifths of the hour | | `quota` | `fresh`, `hour-exhausted`, `day-exhausted`, `recipient-exhausted`, `hour-share-used` | The site's counters. `recipient-exhausted`: `{{recipient}}` got the day's maximum of form confirmations. `hour-share-used`: mail other than `account` has used its four fifths of the hour |
| `idempotency` | `fresh`, `sent-same`, `sent-other` | Whether `{{idempotencyKey}}` was already used: for this very body, or for another | | `idempotency` | `fresh`, `sent-same`, `sent-other` | Whether `{{idempotencyKey}}` was already used: for this very body, or for another |
| `backend` | `ok`, `recipient-suppressed`, `failure` | How the mail back end answers | | `backend` | `ok`, `recipient-suppressed`, `failure` | How the mail back end answers |
| `connect` | `available`, `unavailable` | Whether the service's confirmation page is set up (§2.1). `available` when left out |
Variables: `{{host}}`, `{{token}}`, `{{nonce}}`, `{{idempotencyKey}}`, `{{recipient}}`, and — read from the Variables: `{{host}}`, `{{token}}`, `{{nonce}}`, `{{idempotencyKey}}`, `{{recipient}}`, and — read from the
service — `{{senderAddress}}`, `{{alertRecipient}}`. service — `{{senderAddress}}`, `{{alertRecipient}}`.
@@ -536,5 +601,8 @@ Checklist for a client:
7. Strip from the subject what §3 does not allow (line breaks, control characters, direction marks and other 7. Strip from the subject what §3 does not allow (line breaks, control characters, direction marks and other
invisible characters — not only line breaks); bare addresses only; the right `kind` for each mail. invisible characters — not only line breaks); bare addresses only; the right `kind` for each mail.
8. Read limits from `/v1/status`; rotate after `token.rotateAfter`. 8. Read limits from `/v1/status`; rotate after `token.rotateAfter`.
8a. **Connect (§2.1):** a button for an administrator that asks `/v1/connect` from the server on the click and
opens the answered `connectUrl` in a new tab after checking its beginning; `/v1/status` every 5 seconds for
at most 10 minutes while that panel is open; the four states shown. No link is asked for on page load.
9. Run the examples: the `client` block of each against canned answers, and the whole set against your local 9. Run the examples: the `client` block of each against canned answers, and the whole set against your local
stand-in. stand-in.
+1 -1
View File
@@ -1 +1 @@
1.7.1 1.8.0
@@ -0,0 +1,31 @@
{
"id": "connect-active",
"title": "A site that is confirmed already gets no link",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/connect",
"headers": {
"authorization": "Bearer {{token}}",
"x-intecion-site": "{{host}}"
}
},
"response": {
"status": 200,
"schema": "ConnectResponse",
"body": {
"ok": true,
"state": "active"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
},
"then": {
"mails": 0
}
}
@@ -0,0 +1,31 @@
{
"id": "connect-pending",
"title": "A waiting site asks for the link a person of Intecion confirms it with",
"given": {
"site": "pending"
},
"request": {
"method": "POST",
"path": "/v1/connect",
"headers": {
"authorization": "Bearer {{token}}",
"x-intecion-site": "{{host}}"
}
},
"response": {
"status": 200,
"schema": "ConnectResponse",
"body": {
"ok": true,
"state": "pending"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-pending"
},
"then": {
"mails": 0
}
}
@@ -0,0 +1,32 @@
{
"id": "connect-suspended",
"title": "A suspended site cannot be connected",
"given": {
"site": "suspended"
},
"request": {
"method": "POST",
"path": "/v1/connect",
"headers": {
"authorization": "Bearer {{token}}",
"x-intecion-site": "{{host}}"
}
},
"response": {
"status": 403,
"schema": "Error",
"body": {
"ok": false,
"code": "site-suspended",
"retryable": false
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-suspended"
},
"then": {
"mails": 0
}
}
@@ -0,0 +1,33 @@
{
"id": "connect-unavailable",
"title": "The service has no confirmation page set up: the site stays waiting and says whom to ask",
"given": {
"site": "pending",
"connect": "unavailable"
},
"request": {
"method": "POST",
"path": "/v1/connect",
"headers": {
"authorization": "Bearer {{token}}",
"x-intecion-site": "{{host}}"
}
},
"response": {
"status": 503,
"schema": "Error",
"body": {
"ok": false,
"code": "connect-unavailable",
"retryable": false
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-pending"
},
"then": {
"mails": 0
}
}
@@ -0,0 +1,29 @@
{
"id": "status-pending-connect",
"title": "Status of a waiting site says that it can be confirmed through /v1/connect",
"given": {
"site": "pending"
},
"request": {
"method": "GET",
"path": "/v1/status",
"headers": {
"authorization": "Bearer {{token}}",
"x-intecion-site": "{{host}}"
}
},
"response": {
"status": 200,
"schema": "StatusResponse",
"body": {
"ok": true,
"state": "pending",
"connectAvailable": true
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-pending"
}
}
+1 -1
View File
@@ -2,7 +2,7 @@
// No dependency. Works in Node 20+ and in the Workers runtime (uses only WebCrypto, btoa and TextEncoder). // No dependency. Works in Node 20+ and in the Workers runtime (uses only WebCrypto, btoa and TextEncoder).
// How to use it: README.md, "The examples and the runner". // How to use it: README.md, "The examples and the runner".
export const CONTRACT_VERSION = '1.7.1' export const CONTRACT_VERSION = '1.8.0'
export class ContractError extends Error { export class ContractError extends Error {
constructor(exampleId, message) { constructor(exampleId, message) {
+63 -1
View File
@@ -497,6 +497,10 @@
"senderName": { "senderName": {
"description": "The name the last mail left under, when there was one.", "description": "The name the last mail left under, when there was one.",
"type": "string" "type": "string"
},
"connectAvailable": {
"description": "Only for a pending site, and only when true: the site can be confirmed through /v1/connect (contract 2.1).",
"const": true
} }
} }
}, },
@@ -572,7 +576,8 @@
"quota-exceeded", "quota-exceeded",
"backend-failed", "backend-failed",
"unavailable", "unavailable",
"internal" "internal",
"connect-unavailable"
], ],
"description": "The codes the service answers with today. The list grows with minor versions; that is why Error.code is an open string." "description": "The codes the service answers with today. The list grows with minor versions; that is why Error.code is an open string."
}, },
@@ -619,6 +624,63 @@
"type": "string" "type": "string"
} }
} }
},
"ConnectResponse": {
"description": "Answer of POST /v1/connect. For a pending site: a link for a person of Intecion, valid until expiresAt, usable for one confirmation. For an active site: no link.",
"type": "object",
"required": [
"ok",
"state"
],
"properties": {
"ok": {
"const": true
},
"state": {
"enum": [
"pending",
"active"
]
},
"connectUrl": {
"type": "string",
"pattern": "^https?://[^/?#\\s]+(/[A-Za-z0-9._~-]+)*/connect\\?ref=[A-Za-z0-9_-]{43}$",
"description": "Opened by a person's browser as a top-level navigation. Never fetched by the site's server."
},
"expiresAt": {
"type": "string",
"format": "date-time"
}
},
"if": {
"properties": {
"state": {
"const": "pending"
}
}
},
"then": {
"required": [
"connectUrl",
"expiresAt"
]
},
"else": {
"not": {
"anyOf": [
{
"required": [
"connectUrl"
]
},
{
"required": [
"expiresAt"
]
}
]
}
}
} }
} }
} }
+542
View File
@@ -9,6 +9,548 @@ versions at once, go through every "Requires project changes" section in order,
version you have. A new release = a new section at the top; we remove the oldest ones only version you have. A new release = a new section at the top; we remove the oldest ones only
once there are more than 20. once there are more than 20.
## 1.18.0 (2026-12-02) — first two-step set-up confirmed by e-mail, staff sign-in protection, speed and growth, security audit fixes, IWSN connect
> **Read before upgrading — what changes for an existing site, most important first.** 1.17.2 was never released on
> its own: its changes are part of this release ("From 1.17.2" at the end of this entry). **No migration** on any
> database and no schema change for Postgres / SQLite (MongoDB: a hidden date on two log collections, "Speed and
> growth" point 2). **Import map:** `pnpm generate:importmap` moves one existing line (`MaskedField`, because of the new
> "Current password" field); the committed map works too. Regenerate it when you turn on `unusedMedia`.
>
> 1. **The first two-step set-up ends with an e-mail** to the account's own address, opened in the same browser.
> Mail must work, or an administrator confirms from the account page. Tell the staff before the upgrade.
> → "Two-step verification".
> 2. **Staff sign-in:** pin `IAPL_IP_HEADER` in production (failed sign-ins are counted per client IP and address);
> Payload's per-account lock becomes 50 failures for an hour; staff sign-in only from the site's own origin; an
> account's own e-mail / password change asks for the current password. → "Staff sign-in".
> 3. **Every site on IWSN needs one "Połącz z IWSN"** confirmed by a person of Intecion; until then its e-mails are
> refused. SMTP and Graph sites see no change. → "IWSN".
> 4. **`iapl-doctor` can fail where it passed:** the performance rules are errors, the minimum Next.js is 16.4.6, and
> `transitive-min` warns on `ws`, `cross-spawn` and (Postgres) `esbuild` below their fixes. → "Speed and growth" 9,
> "Security audit" 8–9.
> 5. **Outside callers get less:** public REST / GraphQL lists are capped at 100, an operator name in `?sort=` is a
> 400, document locks are for staff only, access callbacks allow only on a literal `true`. → "Security audit".
> 6. **Drafts as related documents are left out** of what the content helpers answer (a menu link to an unpublished
> page disappears from the site). → "Content and plugin writes".
> 7. **Uploads and logs:** JPEG / PNG metadata is removed on upload, MongoDB deletes expired consent records and
> statistics by itself, versioned plugin entities keep 20 versions. → "Speed and growth".
> 8. **From 1.17.2:** a cron calling `/api/payload-jobs/run` needs `CRON_SECRET`; customer accounts no longer create
> form submissions over REST; a locked staff account hears "incorrect"; the consent version only goes up.
>
> **Known:** the time of a failed sign-in still differs between an existing and an unknown address (Payload hashes the
> password only for an existing one), so timing can still tell which accounts exist.
### Staff sign-in (docs/access.md)
> **What changes for an existing site** (no schema change, no migration; each with its opt-out):
>
> 1. **A stranger can no longer lock a staff account out** (`accounts.signInLimit`). Failed sign-ins to a staff
> collection are counted per client IP and typed address: after 5 failures in 15 minutes that IP gets `429` for
> that address, and the owner signs in from anywhere else. Payload's own per-account lock stays as the net against
> many IPs, at **50 failures for an hour** (only where the project set no `auth.maxLoginAttempts` / `lockTime`).
> **Pin `IAPL_IP_HEADER`** in production; without it every visitor shares one bucket (20× the limit). Adapt:
> `signInLimit: { perAddress, windowMinutes, accountLock }`; Payload's behaviour back: `signInLimit: false`.
> 2. **Staff sign-in only from the site's own origin** (`accounts.signInSameOrigin`): login, "forgot password" and
> "reset password" of a staff collection answer `403` to a request a browser marks as coming from elsewhere.
> Customer logins are not touched. A panel or front end on another domain:
> `signInSameOrigin: { origins: [...] }`; behind a proxy that rewrites `Host`, set `serverURL`. Off: `false`.
> 3. **Changing one's own e-mail, username or password asks for the current password** (`accounts.confirmOwnChanges`):
> a "Current password" field on the account page, `currentPassword` over REST / GraphQL. Not asked: an
> administrator changing another account, server code, API keys, the reset flow. **Scripts that change their own
> password add `currentPassword`.** Off: `confirmOwnChanges: false`.
>
> Note for the owner: with 50 failures an hour, many different clients (an IPv6 /48 holds 65,536 /64s) can still keep
> a staff account out for an hour at a time; `accounts.signInLimit.accountLock` sets the numbers.
### Content and plugin writes (docs/content.md, docs/integrations.md)
> **What changes for an existing site** (no schema change):
>
> 1. **Drafts as related documents are left out.** A block, a menu or a System pages link that points at a page never
> published no longer brings its title, slug or text into the content helpers' answers (pages, Site settings,
> archive entries, the 404 page, Markdown, MCP, llms-full): a single relationship becomes `null`, a draft is removed
> from a list, a polymorphic one gets `value: null`. A preview keeps them. Old behaviour:
> `createContentHelpers({ draftRelations: 'keep' })` (also per helper). Building blocks: `withoutDraftRelations`,
> `applyDraftRelations`, type `DraftRelations`.
> 2. **The plugin's status writes keep others' saves.** The e-mail and Turnstile status is written alone
> (`writeGlobalFields`): a save an editor makes to Site integrations at the same moment is no longer
> overwritten by a status update, and no version is made for it. Nothing to do.
> 3. **Access callbacks that answer something other than `true` / `false`** are named once in the server log (and,
> since this release, refused: "Security audit" point 6).
### IWSN: "Połącz z IWSN" — a person of Intecion connects the site (docs/email.md, contract 1.8.0)
> **What changes for an existing site:** nothing for a site whose "Sending method" is SMTP or Microsoft Graph, and
> nothing for a site already active on IWSN. A site on IWSN that is new or still waits now shows **"Połącz z IWSN"**
> on Site integrations → E-mail sending: pressing it opens the service's confirmation page in a new tab, where a
> person of Intecion signs in with an `@intecion.com` address and presses "Potwierdź"; the panel then shows
> "Connected to IWSN" by itself. Until then the site's e-mails are refused (`relay-pending`), the dashboard alert says
> so, and `iapl-doctor --deep` reports an **error** (`mail-relay-connect`). No schema change, no import-map change.
- **The button** (state block on the e-mail tab, method IWSN): shown while the service offers the confirmation page
(`connectAvailable` in `/v1/status`) or before the site has enrolled. A click asks the site's server for the link
(`POST /api/iapl/mail-relay/connect-link`, admin only, from the site's own origin, enrolling first when there
is no token); the server asks the
service (`POST /v1/connect`), checks that the link begins with the service's own `{base}/connect?`, and hands it
over without storing or logging it; the browser opens it with `noopener noreferrer`. The panel then asks
`/v1/status` every 5 seconds for at most 10 minutes; every load of the panel asks too while the site waits.
- **States shown:** "Waiting for confirmation" (with the button), "waiting for approval" (no button: no confirmation
page), "Connected to IWSN", stopped. "The confirmation page is not available now" for `503 connect-unavailable`; a
wait in minutes for more than 10 links an hour.
- **Dashboard alert** for a waiting site (live, no call to the service); the text of `relay-pending` now speaks of
confirmation.
- **Doctor:** `mail-relay-connect` (error, deep) — the method is IWSN and the site is not connected or not confirmed.
`mail-relay-state` no longer reports "waiting for approval" (warning) or "not enrolled yet" (info): both are this error.
- **Opt-out:** `mail: { relay: { connectButton: false } }` — no button, no route.
- **Building blocks:** `requestRelayConnectLink(payload, options?)` (`ConnectLinkResult`), `isRelayConnectUrl(url, base)`,
`RELAY_CONNECT_LINK_PATH`, `RelayStatus.connectAvailable`; `relayPanelEndpoints(own, { connectLink })`. The stand-in:
`createFakeRelay({ connect: 'available' | 'unavailable' })`, `relay.confirmConnect(connectUrl)`, `connectAvailable` in
its `/v1/status`, `/v1/connect`.
- The contract copy is 1.8.0 (`RELAY_CONTRACT_VERSION`); additive, every other route unchanged.
### Two-step verification: the first set-up is confirmed by e-mail (docs/security.md)
> **Read before upgrading — what changes for an existing site, most important first:**
>
> 1. **Setting up two-step verification now ends with an e-mail.** Whoever sets it up for the first time (a new
> account, an account whose setup was reset or reopened, every account that never finished it) scans the code as
> before, then gets a link at the **account's own e-mail address**; the factor is on only after that link is opened
> **in the same browser** within 30 minutes, and then they sign in again with password and code. Accounts that
> already have two-step verification are not affected. Tell the staff before the upgrade.
> 2. **E-mail must work before that.** Check Site integrations → E-mail sending → "Send a test e-mail". Where it does
> not work, nobody is locked out: the link is written to the server log (Coolify → Logs) and an administrator can
> choose "Confirm the waiting set-up" on the account page; `iapl-doctor --deep` reports it as an error
> (`2fa-enrolment-mail`).
> 3. **Notice mails:** the account's address now gets a mail when its two-step verification is turned on, changed,
> removed or reset.
> 4. `serverURL` must be set (it is, from `NEXT_PUBLIC_SERVER_URL`, on every site made with `iapl create`): the link is
> made from it, never from the request.
>
> Why: with the password of an account inside its setup window, anybody could enrol their own authenticator and lock
> the owner out (security audit 2026-12, F0; every release since 1.16.6 within the window, earlier without one). No
> schema change, no migration, no import-map change. Turn off: `twoFactor: { confirmByEmail: false }`; adapt:
> `confirmByEmail: { linkMinutes, sameBrowser, adminConfirm, logLinkWhenMailFails, notices, maxMailsPerHour }`
> (security.md "Set-up confirmed by e-mail").
### Speed and growth (docs/performance.md)
> **What changes for an existing site** (no edit needed unless a line says so; each with its opt-out):
>
> 1. **Metadata is removed from JPEG and PNG uploads** (camera, date, GPS position, comments) — without
> re-encoding: the pixels stay byte for byte, the colour profile stays. A photo whose EXIF says "rotate" is turned
> once (JPEG quality 92) so it does not show sideways. Only new uploads; stored files are not touched.
> Off: `buildOptimizeUploadHook({ stripMetadata: false })`.
> 2. **MongoDB: TTL indexes delete old consent records and statistics by themselves** — the records the daily purge
> already deleted (older than `retentionDays`: 1095 days for the consent log, 90 for statistics), now also on a
> quiet site where no new record starts the purge. At the first start the plugin adds a hidden date
> (`iaplTtlFrom`) to every existing record and creates the index `iapl_ttl`; **records older than the retention
> are deleted by MongoDB within a minute of that start** (they were due already). Off: `consentLog: { ttlIndex:
> false }`, `stats: { ttlIndex: false }` (the index is dropped at the next start; the purge stays). Postgres /
> SQLite: nothing changes (no field, no migration).
> 3. **A versioned plugin collection or global keeps 20 versions per document** (Site settings, Site integrations,
> the forms…) when a project turned its versions on without a limit — Payload's default is 100. **The oldest
> versions above 20 are removed when such a document is saved next.** Keep more: set `max` / `maxPerDoc` in your
> override. The plugin itself turns versions on nowhere.
> 4. **Forms load their code only on pages that show a form.** `BuilderForm` and `Turnstile` from
> `@intecion/ipal-kit/client` are now lazy wrappers with the same props; the server renders the whole form as
> before. On other pages 6–9 KB less JavaScript (gzip; reference site: webpack −8.8 KB, Turbopack −6.1 KB). The eager components: `@intecion/ipal-kit/client/eager`
> (`<RenderForm Form={BuilderForm}>`).
> 5. **The Turnstile widget's height is kept free before Cloudflare draws it** (73 px): the form no longer jumps when
> it appears. For an invisible widget: `turnstileReserveHeight={0}` on `RenderForm` / `BuilderForm`
> (`reserveHeight={0}` on `Turnstile`).
> 6. **A background video stops for visitors who asked for less motion** (`prefers-reduced-motion`), after
> hydration; everyone else sees no change. Off: `<Media pauseForReducedMotion={false}>`.
> 7. **Card hover** (`Card interactive`, the library's link cards) fades a shadow layer instead of animating the
> card's shadow: the same lift, drawn by the compositor. The 1.17 class: `CARD_INTERACTIVE_SHADOW_CLASS`.
> 8. **Fewer database queries per page render** (36–44 %), the lightbox viewer loads on first open, the `/client`
> barrels are no longer one client boundary, the table of contents measures once per frame, Turnstile stops
> polling once drawn, the cookie banner honours reduced motion. Nothing to do.
>
> 9. **`iapl-doctor` can now fail on the performance rules** (`perf-*`: images config, fonts, render-blocking,
> embeds, animations, a budget test; `--url`: uncompressed HTML, blocking scripts, more than four font preloads, a
> lazy first image, HTML over 150 KB; `--deep`: stored images over 1.5 MB / 2560 px) — they are **errors**, so a
> plain run exits 1 on them and `--strict` too. None measures time: the same site gives the same answer every run.
> A site with Playwright and no budget test gets `perf-budgets` (copy the `iapl-performance` skill's template).
> Lower one with a reason: `iapl-doctor.json` → `"rules": { "perf-fonts": { "severity": "warning", "reason": "…" } }`;
> silence one: `{ "off": true, "reason": "…", "until": "2027-03-01" }` (docs/doctor.md). The `growth-*` rules stay
> warnings and infos.
>
> 10. **Helpers from `@intecion/ipal-kit/client` are plain values in a server component.** The `/client` barrels have
> no `'use client'` any more, so a helper without its own directive (`pushDataLayer`, the role predicates, …)
> imported into a server component is now the function itself, not a client reference. Only a project that passed
> such a function from a server component to a client component as a prop notices it (Next: "Functions cannot be
> passed directly to Client Components"): import it inside the client component instead.
> 11. **MongoDB: the generated types gain `iaplTtlFrom`** on consent records and statistics visits (the hidden TTL
> date, point 2) after `payload generate:types`. Nothing to change in code.
>
> **New, off until a project turns it on:** `iapl({ unusedMedia: true })` — above the Media list, how many files no
> page, entry or setting uses, with a link to Payload's list filtered to them (deleting stays manual; **run
> `pnpm generate:importmap`** after turning it on); `forms: { submissionRetentionDays }`; `Media eager` (a logo
> above the fold, no high priority); `createNotFoundPage({ load, placeholder })` (the reference site keeps its 404
> height: CLS 0).
> **Doctor:** the `performance` group (errors, point 9) and the `growth` group (warnings and infos;
> `growth-versions-config` is a hint), thresholds in `iapl-doctor.json` → `growth`. **Agents:** the `iapl-performance` skill (`pnpm exec iapl-skills`) and the budget
> gate template. **Recommended for projects:** `index: true` on `slugHistory.slug`; the heading font with
> `preload: false` (the starter's default now); a placeholder of the 404 content's height.
### Security audit 2026-12: fixes and suites (docs/security.md)
> **What changes for an existing site** (no migration, no import-map change; each with its opt-out):
>
> 1. **Public lists are capped at 100** (`listLimit`, finding F4). A REST / GraphQL list (`find`, versions, distinct
> values) asked by a caller that is not staff gets at most 100 documents; `pagination=false` and `limit=0` become one
> page of 100. Before, one anonymous `GET /api/posts?limit=100000` read a whole collection with its relations.
> Staff accounts, the panel, the Local API (the frontend, seeds) and server code that reads with
> `overrideAccess: true` while passing a request on (the cookie scanner's scheduled crawl) are not capped. **A client-side script that reads
> more than 100 documents anonymously now gets the first 100 and `hasNextPage: true`** — page through, or adapt:
> `listLimit: { max: 500 }`, `{ exclude: ['products'] }`, `{ staff: true }`; off: `listLimit: false`.
> 2. **An operator name in `?sort=` answers 400** (`refuseOperatorSort`, F5): `$where`, `-$natural`, `title.$ne` —
> for everyone, staff too — instead of reaching MongoDB and ending in a 500 with a stack trace in the log. Logged as
> one `info` line (`RefusedSortError`; `loggingLevels: { RefusedSortError: false }` hides it). Off:
> `refuseOperatorSort: false`. Reported to Payload upstream.
> 3. **Payload's document locks are for staff only** (`lockedDocuments`). `payload-locked-documents` ("who edits
> what") ran on Payload's default, any signed-in account — a visitor account of a login collection for customers
> could read who edits which document and write or delete locks. Now staff accounts with the second factor; the
> panel works as before. Off: `lockedDocuments: false`; your own rule: `lockedDocuments: { access: { read } }`.
> 4. **The Markdown negotiated at a page URL is never cached as the page** (F3). `createProxy({ markdown: true })`
> marks the rewrite, the Markdown route answers `cache-control: private, no-store` with `Vary: Accept`, and the
> HTML pages keep their caching and Next's own `Vary` (ISR unchanged). Before, a CDN that caches HTML (Cloudflare "Cache Everything",
> Varnish) could store the Markdown copy after one anonymous `Accept: text/markdown` request and serve it to every
> visitor of that page. `/md/…` keeps its public caching. A proxy of your own that rewrites to `/md/…` copies the
> headers (`MARKDOWN_NEGOTIATED_HEADER`, `NEGOTIATED_CACHE_CONTROL`, `appendVary`; content.md). Off:
> `markdown: { negotiate: false }` (Markdown only at `/md/…`).
> 5. **CSP report log lines change shape** (F1): `blocked=` is the origin (`https://cdn.example`, or `inline` /
> `eval`), `page=` the path without its query, `src=` origin and path; control characters are removed and each
> value is cut at 128 characters, so a posted report can no longer write a forged line into the Coolify log. One
> request handles at most 10 violations (was 50), one client at most 60 requests a minute (the answer stays `204`).
> **A log parser that read full URLs must adapt.** Your own `onReport` still gets the raw values. Adapt:
> `createCspReportRoute({ maxReports: 50, rateLimit: false | { max, windowMs } })`; the line: `cspLogLine`.
> 6. **Access callbacks allow only on a literal `true`** (`cookieScanner.access`, the doctor's `access`). A callback
> that returns `req.user` — `cookieScanner: { access: ({ req }) => req.user }` — returned an account object, which
> let the request in; **now it is refused (`403`)**, and so are `1`, `'yes'`, `{}` and a Promise that was not
> awaited. The server log names the option once: `[iapl] cookieScanner.access returned an object, not true or
> false, so the request was refused …`. Fix: `({ req }) => Boolean(req.user)` (or a role check such as
> `isAdmin(req.user, req.payload)`). The old reading back: `iapl({ strictAccessAnswers: false })`. New exports:
> `strictAccessAnswers(req)`, type `AccessAnswerOptions`; `accessAllowed(option, answer, { strict })`.
> 7. **New doctor findings the first time** (the suites below): `iapl-doctor --only security` reads the project's own
> code and configs. Judge each; a correct place gets `// iapl-security-ok: <why>`.
>
> 8. **The minimum safe Next.js is 16.4.6** (was 16.4.5): a site on 16.4.5 now gets a `next-min` error from
> `iapl-doctor`. Fix: `pnpm add [email protected] [email protected]`, `rm -rf .next`, build, redeploy. 16.4.6 is
> the version the plugin, the reference site and the starter are tested with, and its React copy carries the fix for
> React's RSC advisory GHSA-xqc2-xf4c-x3h3 (checked in the code, AGENT.md §4 item 11). Silence with a reason in
> `iapl-doctor.json` → `rules.next-min` if an upgrade must wait.
>
> 9. **`ws` below 8.23.0 and `cross-spawn` below 7.1.0 are reported** (GHSA-37g9-w4hg-h9qr, high: memory exhaustion through unbounded automatic pong
> responses, published 2026-12-01). It comes with `payload` (`^8.16.0`); a lockfile made earlier keeps 8.21 / 8.22.
> `iapl-doctor` (`transitive-min`) warns and `pnpm audit --prod` shows it as high. Fix: add
> `"ws@>=8 <8.23.0": "^8.23.0"` to `pnpm.overrides` (AGENT.md §4 item 12), `pnpm install`, commit the lockfile,
> redeploy. The plugin, the reference site and new sites from `iapl create` carry it. The same for `cross-spawn`
> below 7.1.0 (GHSA-ghv9-86vm-4v8m, critical, command injection when spawning batch files — Windows only; comes
> with `cross-env` and `eslint`): `"cross-spawn@>=7 <7.1.0": "^7.1.2"`.
> **Postgres sites:** `esbuild` below 0.25 (GHSA-67mh-4wv8-2f99, moderate) comes with `@payloadcms/db-postgres` →
> `drizzle-kit`; `transitive-min` warns, fix `"esbuild@<0.25.0": "^0.25.12"`. The plugin's own dev tooling is clean
> too now (`eslint` 9.39.4 and `minimatch` 11.0.10 through overrides); AGENT.md §4 item 12 lists them for a project
> that uses `@payloadcms/eslint-config`.
>
> **Recommended for projects:** a text field of your own whose value goes into `href` (social profiles, a website)
> becomes `buildUrlField()` and its render goes through `safeHref()` (F2) — no schema change, it stays a text column.
> The reference site and every new site from `iapl create` do it for Company → Profiles (also in the `sameAs` of the
> JSON-LD). Not exploitable as the reference site wrote it (`target="_blank"`), but a copy without it would run an
> editor's `javascript:` link as the admin who clicks it.
>
> **New checks a project can run on its own site:**
>
> - **Static security rules** in the doctor: `iapl-doctor --only security` now also reads the project's own code
> (`code-patterns`: unescaped HTML / JSON-LD, `overrideAccess: true` and a Local API `user` without
> `overrideAccess: false` where a request reaches, a `where` from the request, `eval`, `NEXT_PUBLIC_` secrets,
> redirects and fetches to an address from the request) and its configs (`config-dangerous`).
> - **Attack probes**: `iapl-doctor --url https://<domain> --only live-probes` (requests that change nothing) and the
> Playwright template `iapl-audit/resources/attack-probes.spec.template.ts`. Exported: `ATTACK_PROBES`,
> `runAttackProbes`, `createProbeContext`, `scanCode`, `scanConfigs` (`@intecion/ipal-kit/doctor`). A site on the
> 1.18.0 defaults passes every probe; `markdown-vary`, `unbounded-list` or `sort-operator` mean a fix above is off.
> - **For the plugin's own release:** `pnpm security:gate` (in `prepublishOnly`): `pnpm audit` with no moderate, high
> or critical advisory in the production tree **and the dev tooling** (lows reported; `--audit-level high` or
> `--prod-only` for the looser rule), the static-rule gate and the per-class tests; `--zap <url>` adds an optional OWASP ZAP baseline scan.
>
> **New exports:** `buildQueryGuardHook`, `applyQueryGuard`, `capListLimit`, `isOperatorSort`, `isStaffRequest`,
> `RefusedSortError`, `DEFAULT_LIST_LIMIT`, `isQueryGuardHook`, `QUERY_GUARD_MARK`, `applyLockedDocumentsAccess`,
> `staffOnlyLocks`, `LOCKED_DOCUMENTS_SLUG` (types `ListLimitOptions`, `LockedDocumentsAccess`); `buildUrlField`,
> `isAllowedUrl` (types `BuildUrlFieldOptions`, `UrlScheme`); `cspLogLine`, `CSP_LOG_VALUE_MAX`;
> `MARKDOWN_NEGOTIATED_HEADER`, `NEGOTIATED_CACHE_CONTROL`, `appendVary`. New options: `listLimit`,
> `refuseOperatorSort`, `lockedDocuments`; `createProxy({ markdown: { prefix, negotiate } })`;
> `createCspReportRoute({ maxReports, rateLimit })`; `markdownResponse(md, { negotiated })`.
>
> **GHSA-xqc2-xf4c-x3h3 (React RSC, critical) and Next:** Next 16.4.6 vendors a React copy labelled
> `19.3.0-canary-278794d7-20261002`; its code carries the fix (React commit 0c9913ae: the new backing-store reads,
> the `"S"` stream key and error 612 "Cannot transport a detached buffer"). No watch remains; AGENT.md §4 item 11 says
> how to check after a Next upgrade.
### From 1.17.2 (never released on its own)
> **Read before upgrading.** No schema change, no migration on any database, no import-map change. What changes for
> an existing site, most important first:
>
> 1. **Fix: `readPublished()` on version history.** The form 1.17.1 documented, `readVersions: readPublished()`,
> answered every version read by a visitor or a plain account with **500** (MongoDB, Postgres and SQLite alike).
> It now works by itself: iapl() gives that `readVersions` the new `readPublishedVersions()` with the same role.
> Visitors see published versions only; a draft version by id is `403`; staff see everything, as before. A
> `readVersions` of your own that **wraps** `readPublished()` is not changed: use `readPublishedVersions()` inside it.
> 2. **A locked staff account is told "The email or password provided is incorrect."** (REST, GraphQL, the panel),
> so five wrong passwords no longer tell a stranger that an address has a staff account. A locked editor with the
> right password sees "incorrect" too until the lock ends (10 minutes); an admin can unlock it. Payload's message
> back: `accounts: { lockedAnswer: 'payload' }`. Known: the answer's **time** still differs for an existing
> account (Payload hashes only then); see "Known" at the top of 1.18.0.
> 3. **The plugin's panel actions refuse other origins** (mail service Connect / Disconnect, Send test e-mail, cookie
> scan, approval, site check): `403` for a request a browser marks as coming from elsewhere. The panel's buttons
> work. **Behind a proxy that rewrites `Host` and sends no `X-Forwarded-Host`, set `serverURL`**, or those buttons
> are refused too (the log says so once; `iapl-doctor` warns). Off: `adminSameOrigin: false`.
> 4. **A customer account can no longer create form submissions over REST / GraphQL** (staff only). The site's own
> forms (`submitForm`, `createSubmitAction`, the file endpoint) are not affected. Way back:
> `forms.formSubmissionOverrides.access.create`.
> 5. **Payload's job queue over HTTP: only an admin or `Authorization: Bearer <CRON_SECRET>`** (16+ characters), when
> the project wrote no `jobs.access.run`. **A cron that calls `/api/payload-jobs/run` must set `CRON_SECRET` and
> send the header**, or it gets `401`. In-process runs and a project's own rule are not affected;
> `jobsRunAccess: false` keeps Payload's default.
> 6. **The cookie button stays in the bottom corner and never moves**; while it is shown the footer gets a little
> room under its last row (about 43 px on the reference site) so the button covers nothing. No layout shift.
> No room: `<CookieButton reserve={false} />`; the placement before: `<CookieButton avoid={COOKIE_BUTTON_AVOID} />`.
> 7. **The consent version only goes up** through the panel, REST and GraphQL (a lower number would make old consent
> count again). The Local API with `overrideAccess` may still lower it; `cookieSettings: { allowLowerPolicyVersion: true }`
> restores the old freedom.
> 8. **IPv6 visitors are counted per /64** by every plugin rate limit (one home network shares a budget, as an
> IPv4 home behind one router always did). Per address: `setIpv6Grouping({ prefix: 128 })`.
#### Security
- **Version history with `readPublished()`** (point 1): new `readPublishedVersions(minimum)` for `readVersions`;
`withVersionReadRules(entities)` swaps a marked `readPublished()` on `readVersions` (iapl() runs it on the
collections and globals it sees; a plugin listed after iapl() uses `readPublishedVersions()` itself).
- **Locked staff accounts answer like a wrong password** (point 2): `lockedLooksWrong`, `withLockedAnswer`,
`graphqlLoginName`; type `LockedAnswerOption`.
- **Panel actions from the site's own origin only** (point 3): `requireOwnOrigin`, `guardAdminEndpoints`,
`ADMIN_POST_ENDPOINTS`; type `AdminSameOriginOption`; `reportRefusedOrigin(req, origins?, context?)` takes a third
argument; `iapl-doctor` warns (`csrf-empty`) without `serverURL` or `csrf`.
- **A customer account can no longer create submissions over REST.** `POST /api/form-submissions` (and GraphQL
`createFormSubmission`) needed only a signed-in account of any login collection, so a customer of a visitor
collection could skip the rate limit, Turnstile, the consent tick and the validation, and the form's e-mails went
out. Now: a staff account with its second factor. The site's own forms (`submitForm`, `createSubmitAction`, the file
endpoint) are not affected. Way back: `forms.formSubmissionOverrides.access.create`.
- **Payload's job queue over HTTP: only an admin or the cron secret.** When the project writes no
`jobs.access.run`, `/api/payload-jobs/run` and `/handle-schedules` now answer only an admin signed in with the second
factor (an admin's API key counts) or `Authorization: Bearer <CRON_SECRET>` (16+ characters); before, any signed-in
account of any login collection. **A site whose cron calls the run route:** set `CRON_SECRET` in the app's
environment and send the header; the start log says so when it is missing. In-process runs (`jobs.autoRun`,
`payload jobs:run`) and a project's own rule are not affected; `iapl({ jobsRunAccess: false })` keeps Payload's
default (security.md "Payload's job queue").
- **The consent version only goes up** (point 7): `policyVersionNeverDown`, `buildCookieSettingsFields`,
`buildCookieSettings(options)`; type `CookieSettingsFieldOptions`.
- **IPv6 per network** (point 8): `setIpv6Grouping`, `ipRateKey`; type `Ipv6Grouping`. A second counter per /48 is
available (`wide: 48`), off by default.
#### Added
- `iapl-doctor` deep rule **`visitor-writes`** (warning): on a site with a visitor login collection, every collection
and global whose write rule lets such an account in, Payload's default included.
- `jobsRunAccess`, `withJobsRunAccess`, `jobsRunNotice`, `cronSecretMatches`, `CRON_SECRET_ENV`,
`CRON_SECRET_MIN_LENGTH`; option `jobsRunAccess`; env `CRON_SECRET`.
- `CookieButton` prop `reserve` (the block that gets the room; `false` = off); `COOKIE_BUTTON_RESERVE`,
`COOKIE_BUTTON_SPACE_ATTRIBUTE`, `reserveCookieButtonSpace` (`/client`, type `CookieButtonSpaceOptions`);
`consentDecidedScript` (root); the token `--ipal-cookie-button-space`.
#### Changed
- **What an existing site's visitors see: the "cookie settings" button stays in the bottom corner of the window and
never moves; the footer is a little taller while it is shown**
([consent.md → Where the cookie button sits](./consent.md#where-the-cookie-button-sits-1180)). Until now the button
moved up by the visible part of the footer: on a phone with a tall footer it ended at the top of the screen (over
the header), on a short page in the middle of it. Now it is in the same corner on every page and at every scroll
position. So that it covers nothing at the very end of a page, the footer gets bottom padding while the button is
shown — just enough for its last row to end above the button (measured: the footer's own padding counts, an empty
corner gets nothing; on the reference site 42–43 px on phones and desktop). Not before a decision, not while the
banner is open. No layout shift: for a returning visitor the room is made before the first paint. Same look,
keyboard and screen-reader access unchanged; the side inset now adds the device's safe-area inset.
**Nothing to do; an existing site gets it by updating.** No room: `<CookieButton reserve={false} />`; an amount of
your own: `--ipal-cookie-button-space` on the footer (`0` = none, also per breakpoint); the placement before:
`<CookieButton avoid={COOKIE_BUTTON_AVOID} />` (on `SiteProviders`: `cookieButton={…}`). A site that passes a
selector in `avoid` keeps its behaviour. A project e2e test that expects the button above the footer, or an exact
footer height after a decision, needs an update.
- The reference site (and every new site from `iapl create`): `Pages`, `Posts`, `CaseStudies`, `Media` and the
`Header`, `Footer`, `Company` globals have their own write rules (`adminOrEditor`) instead of Payload's default.
Existing sites: nothing changes; the doctor's `visitor-writes` names what to add where it matters.
- Not built (owner's Q3 answer (a), planned for 2.0): a plugin-wide default for the project's own entities and for
Payload's `payload-locked-documents`.
## 1.17.1 — security fixes from the IAWL review; the panel's sign-in look; the sending method is chosen
> **Read before upgrading.** **MongoDB: no migration. Postgres / SQLite: one migration** — a new column for the
> sending method (point 5). In this order:
>
> **1. A write-only secret could be read back (fixed).** On 1.17.0 an **admin** could recover the SMTP password or
> the Turnstile secret key character by character through a query that names the field
> (`/api/globals/site-integrations/versions?where[version.smtpPassword][like]=…`, REST or GraphQL), **only on a site
> whose project had turned versions on** for Site integrations (off by default), or for its own collection with a
> `writeOnlySecret` field. An editor or a plain account could not (their query on the field was refused); visitors
> never. Now no query can name a write-only field (`where` / `sort` answer `400 QueryError`); reads still show
> `********`. Nothing to do. If such a site is yours and an admin account may have been misused, change the SMTP
> password and the Turnstile key.
>
> **2. What can stop a site at start.** A config value the plugin does not understand now stops the start with the
> option's name, instead of being read as off or open — for example `accounts: 0`, `stats: 'false'`,
> `consentLog: { retentionDays: null }`, `dashboardAlerts.integrations: 'Admin'`, `buildCsp({ dev: 'false' })`,
> `buildSecurityHeaders({ hsts: null })`, seed `guard: 0`, a `developmentHosts` list that is not one. Role names
> outside `user`, `editor`, `admin` in `requireRole` / `requireRoleField` throw. Real values start as before.
> **Check before deploying:** `pnpm build` (the error names the option; security.md → "Switches are read strictly").
>
> **3. What people see change.**
> - **Sites with `whiteLabel`: the panel's sign-in page has a new look** — a dark panel with the client's logo
> (Site settings → Logo) or the site's name beside the form, on login and the 2FA screens. **Editors can no longer
> change the site's name, logo and icon** in Site settings (admins can; `whiteLabel: { brandAccess: 'editor' }`
> gives it back). **Every logo that showed on the login screen before shows on the new screens**, an SVG too (as a
> picture). No plate under the logo: a logo with dark letters needs `signIn: { logoPlate: true }`. The old screens: `whiteLabel: { signIn: false }`.
> Forgot / reset password, first user and logout get the look with **one config line**,
> `whiteLabel: { signIn: { allScreens: true } }`, and `pnpm payload generate:importmap`.
> - **2FA:** correct codes are never refused any more (only wrong ones count towards the limit); several attempts at
> once may be told "try again in a moment". The admin's 2FA reset works only from the site's own pages.
> - **Visitors:** `/md/<a language the site does not have>` is a 404; a never-published page assigned as the 404
> page is not shown; a search longer than 10 words or 200 characters is searched by its first words.
> - **A site without `serverURL` and without `NEXT_PUBLIC_SERVER_URL`** loses the logo in its panel link preview.
>
> **4. One line in each project:** the proxy matcher (`src/proxy.ts`) —
> `'/((?!(?:api|admin|_next)(?:/|$)|.*\\..*).*)'`; `iapl-doctor` warns `proxy-matcher` until it is changed. Without it
> pages whose names only start with `api` / `admin` / `_next` skip the proxy, as before.
>
> **5. E-mail — nothing to do, one thing to know.** "Sending method" in Site integrations → E-mail sending is a
> choice again: IWSN (built-in), Own SMTP server, Microsoft Graph (deprecated). **Upgrading writes nothing and
> loses no mail:** the field shows the method the site sends through today as selected (no SMTP server → IWSN; an
> SMTP server → Own SMTP server; `GRAPH_*` → Microsoft Graph), and the site keeps sending that way. **Nothing changes
> until somebody picks another option:** saving the page with the method shown stores no choice. A different option
> picked and saved is stored, and from then on the site sends that way only. If the chosen method cannot
> be used — "Own SMTP server" without server, user name and password, "Microsoft Graph" on a server without
> `GRAPH_*` — e-mails **fail and the panel says so; they are not sent another way** (in 1.17.0 they would have gone
> through SMTP or IWSN). The panel warns while the option is being picked, before the save.
> **Postgres / SQLite projects: create and apply one migration** (`pnpm payload migrate:create`; the new field
> `emailMethod` is a column) in the same deploy. Without it the site still sends its mail the old way and one loud
> log line says so, but the Site integrations page of the panel does not open. MongoDB: nothing.
> A seed or script that set `emailTransport` keeps working (it leaves the site on the old order); to choose, it
> writes `emailMethod`.
### Security
- **Write-only secrets cannot be named in a query** (point 1 above). `secretReadAccess`, the field read rule behind
it, is exported; `writeOnlySecret` sets it.
- **The proxy matcher skipped pages that only start with `api`, `admin` or `_next`.** The documented literal
`'/((?!api|admin|_next|.*\\..*).*)'` did not end those names at "/", so `/administracja`, `/admin-guide` or `/apis`
skipped the proxy: no locale redirect, and on a single-locale site with `createProxy({ csp })` no CSP. The
literal is now `'/((?!(?:api|admin|_next)(?:/|$)|.*\\..*).*)'` (`DEFAULT_PROXY_MATCHER`, the reference site, the
starter, the docs). **Requires a project change:** Next reads the matcher from each site's `proxy.ts`, so paste
the new literal there; `iapl-doctor` reports the old one (`proxy-matcher`, warning).
- **Form files: a program inside a DOCX / XLSX named `setup.exe.` or `setup.exe ` passed** (Windows drops the
trailing dot or space when the file is extracted). Trailing dots and spaces are ignored now.
- **`iapl-skills --dest` compared the paths before resolving links**: `--dest <a link to .>`, `..` or `/` passed
the "not the project root" rule and lost the `iapl-*` folders there. The paths are resolved first; a folder that
is the project root or holds it is refused. A folder elsewhere (shared skills) still works.
- **The starter bundle followed symbolic links**: a link committed under `reference/` would have shipped its
target's content in the published bundle (none existed). Links are refused; `iapl create` also refuses a bundle
path that leaves the new folder.
- **2FA verify limit counts wrong codes only.** Before, every attempt counted, so the sixth correct login of one
account within 10 minutes (an office sharing a login, several devices) was refused for 10 minutes. Five wrong
codes still lock the account for the window. Several attempts of one account at the same moment: one may be told
"being checked right now, try again in a moment" (`429`, `Retry-After: 2`). A project that wires
`buildVerifyLimit` into its own endpoint calls `limit.settle(req, correct)` after its check.
- **`POST /api/ipal/two-factor/reset` refuses a request a browser marks as coming from another origin** (`403`), like
verify and setup since 1.16.7: a page on a sibling subdomain could reset any account's 2FA with an admin's cookie
when `serverURL` was not set. `twoFactor.sameOrigin: false` turns it off.
- **Request bodies from strangers are read only up to their cap**, also without a `content-length`: the mail-service
confirm call, CSP reports, page views (stats) and MCP (`maxBytes`, 64 KiB).
- **Rich-text links:** one check for every stored URL (`autolink`, links marked internal, the Markdown output).
- **Strict switches** (point 2 above): `hasMinimumRole` / `userMeetsRole` answer `false` for an unknown role name;
before, every staff account met it.
- **Site integrations versions** (when a project turns them on): only admins list them (`readVersions`).
- **Unknown locales:** `resolveRoute` returns nothing for a code the site does not have (`isSiteLocale`); `/md/xx`,
MCP `get_page` and the search route no longer fall back to the default language's page.
- **The 404 page:** a never-published page assigned in System pages is not rendered.
- **The public preview-image endpoint could be made to fetch from a host named in the request.**
`GET /api/ipal/admin-og` resolved a site-relative logo address against the request's own host and fetched it with
redirects followed, no timeout and no size limit; `GET /api/ipal/admin-icon` resolved the same way. Both now
resolve against the site's configured origin only (`serverURL`, else `NEXT_PUBLIC_SERVER_URL`), ask one address,
never follow a redirect, give up after 5 s and stop reading at 512 KB. `fetchPublicImage` (exported) behaves so
for every caller and takes `{ timeoutMs }`; new export `PUBLIC_IMAGE_TIMEOUT_MS`. **For a project:** nothing to do
when `serverURL` is set (the starter sets it). A site without `serverURL` and without `NEXT_PUBLIC_SERVER_URL`
loses the logo in its panel link preview (the site name is drawn) and the icon endpoint redirects to the media
file — set `serverURL`. A logo or icon whose address answers with a redirect is no longer fetched by the server.
### Added
- **Sign-in look (`whiteLabel.signIn`, on with `whiteLabel`).** A dark panel with the label "Administration panel",
the client's logo (Site settings → Logo) or the site's name, and the panel's languages as links;
the form beside it, in both admin themes; a band above the form on a phone. Logo and name come from Site settings:
no env var, **no new field, no schema change** (MongoDB, Postgres, SQLite alike). With nothing set the panel shows
the label and the site's host — no Payload or Intecion mark. The logo on a white plate is an option; the default is no plate.
- **`signIn: { allScreens: true }`** — the same look on forgot / reset password, create first user, logout and
"unauthorized". Adds the provider `SignInLook` (one import-map entry: `pnpm payload generate:importmap`). The
project starter writes it for new sites. A production start that does not find the entry in `importMap.js`
leaves the provider out and logs what to run; the panel keeps working.
- **The logo:** whatever Site settings → Logo holds, an SVG too, as an `<img>`; fits 240 × 72 (it was up to
420 × 120), served from a generated size at least twice as wide when the media collection has one; alternative
text = the site's name. Its file is asked once before it is printed (no redirect followed, 4 s, 512 KB): a file
that is gone, or is no picture, gives the site's name instead of a broken picture; in any doubt the upload is
believed.
- **Options:** `signIn.accent` (hex colour of the button, links and focus ring), `signIn.logoPlate` (a white plate),
`signIn.svgLogo: false` (refuse an SVG logo), `signIn.checkLogo: false`, `signIn.languages: false`,
`whiteLabel.brandAccess` (`'admin'` with the look, `'editor'` as before; field-level access, no schema change).
CSS variables `--iapl-signin-*` for a project's `custom.scss`.
- **Language links before sign-in:** `GET /api/ipal/admin-language?lng=<code>` writes Payload's language cookie for
a supported language and returns to the admin page it was opened from (public; 400 for an unknown language;
never redirects off the admin route). Registered only with the sign-in look and `languages !== false`.
- **The 2FA code boxes have names** for screen readers ("Digit 2 of 6") and ask a phone for the numeric keyboard
(with the sign-in look).
- Exports: `SignInPanel`, `SignInLook` (`/admin`); `resolveSignInLook`, `loadSignInBrand`, `signInLogo`,
`signInName`, `checkLogoFile`, `fitLogo`, `isSvgUpload`, `languageLinks`, `LANGUAGE_NAMES`, `signInCss`, `isHexColour`,
`signInProviderActive`, `buildAdminLanguageEndpoint`, `adminPathFromReferer`, `SIGN_IN_LOOK`, `SIGN_IN_STYLE_ID`,
`SIGN_IN_LOGO_BOX`, `SIGN_IN_NAME_MAX`, `ADMIN_LANGUAGE_PATH` and their types.
- **`routes:check`** — every public route (REST, GraphQL, Next route files) against a committed snapshot with one
reason per entry; fails on a route nobody has judged. `listPublicRoutes`, `listNextRouteFiles`,
`compareRouteSnapshot`, `updateRouteSnapshot` (`@intecion/ipal-kit`), `runRouteCheck` (`@intecion/ipal-kit/doctor`);
a template in the `iapl-audit` skill (security.md "Routes nobody has judged").
- **Closed doors from outside** — a Playwright template that asks every door that must stay closed as an anonymous
visitor, a customer and an editor on a production build (security.md "Closed doors from outside"); in this
repository part of `pnpm e2e:built`, in both bundlers.
- `iapl-doctor` rule **`proxy-matcher`** (above).
- `readPublished(minimum)` — read rule for a collection with drafts: visitors get published documents only (by id,
list, `?draft=true`, GraphQL). `isSiteLocale`, `limitQuery`, `SEARCH_QUERY_LIMIT`,
`searchContent` / `createSearchRoute({ queryLimit })`, `createMcpRoute({ maxBytes })`, `assertPluginSwitches`.
- Docs: decide `twoFactor.requireSetup.exempt` from a field only admins can write (an admin-only checkbox), not from
the e-mail — every account may change its own e-mail (security.md).
### Changed
- **E-mail: "Sending method" is an explicit choice again** — "IWSN (built-in)", "Own SMTP server", "Microsoft
Graph (deprecated)" — and what is chosen is what is used (point 5 above). Only the chosen method's fields are
shown; the state block and the test e-mail name it ("through IWSN" / "through your SMTP server" / "through
Microsoft Graph"). A chosen method that cannot be used fails loudly — status `smtp-incomplete` /
`graph-not-set-up`, doctor `mail-method` — and the mail is not sent another way; in 1.17.0 "Automatic" picked
the transport from which fields were filled in. Stored in a new field of Site integrations, `emailMethod`
(`relay` / `smtp` / `graph`, empty until somebody chooses); `emailTransport` stays, hidden.
New exports: `getMailMethod`, `setMailMethod`, `resolveMailMethod`, `readMailSettings`, `isMailMethod`,
`MAIL_METHODS`, `STORED_MAIL_METHOD_CONTEXT`, `mailMethodColumnMissing`, types `MailMethod`, `ResolvedMailMethod`,
`MailMethodProblem`. `pnpm payload generate:types`
gives a diff (the new field): run it and commit.
- `AdminLogo` prints the sign-in panel when the plugin gives it `signIn` (the default with `whiteLabel`); wired by
hand without that prop it is the plain logo as before. The logo on the login screen is now shown inside
240 × 72 px (it was up to 420 × 120).
- The credit line under the login form: full-strength muted colour and a hairline above it (it was 60 % opacity).
- The reference site and the starter use `whiteLabel: { signIn: { allScreens: true } }`.
- The plugin's own `package.json` declares `@swc/core` in `pnpm.ignoredBuiltDependencies`: its install script only
checks the native binary, which the build already has. pnpm no longer asks about it (repository only; no effect on
projects).
- `truncate` (summaries, meta descriptions) never returns more than its limit.
### Requires project changes
- **Postgres / SQLite projects: one migration**, in the same deploy — the new field `emailMethod` of Site
integrations is a column (`pnpm payload migrate:create`, commit, apply at container start). MongoDB projects:
nothing. Until it runs: mail keeps going the old way, the Site integrations page does not open,
`iapl-doctor --deep` reports `mail-method` (point 5 above).
- **The proxy matcher**, one line (point 4 above).
- **A config value the plugin does not understand** stops the start (point 2): `pnpm build` before deploying.
- **Recommended with `whiteLabel`:** `signIn: { allScreens: true }` + `pnpm payload generate:importmap`; look at a
project's own login CSS after the update.
- `serverURL` (or `NEXT_PUBLIC_SERVER_URL`) set, as the starter does, for the panel's link-preview logo.
## 1.17.0 — the plugin is called IAPL; mail works with no setup ## 1.17.0 — the plugin is called IAPL; mail works with no setup
> **Read before upgrading.** In this order: the security follow-ups prepared as 1.16.8 (never released on their > **Read before upgrading.** In this order: the security follow-ups prepared as 1.16.8 (never released on their
+1
View File
@@ -50,6 +50,7 @@ API details — one file per module:
| Rich text, table of contents | [richtext.md](./richtext.md) | | Rich text, table of contents | [richtext.md](./richtext.md) |
| Headers, CSP, 2FA | [security.md](./security.md) | | Headers, CSP, 2FA | [security.md](./security.md) |
| SEO, metadata, sitemap, JSON-LD, llms.txt | [seo.md](./seo.md) | | SEO, metadata, sitemap, JSON-LD, llms.txt | [seo.md](./seo.md) |
| Speed: what the plugin does, what the project does, budgets, measuring, the doctor's performance group | [performance.md](./performance.md) |
| Stats in the admin panel (no cookies; visitor history with consent) | [stats.md](./stats.md) | | Stats in the admin panel (no cookies; visitor history with consent) | [stats.md](./stats.md) |
| Auto-slug | [slug.md](./slug.md) | | Auto-slug | [slug.md](./slug.md) |
| Light / dark theme, switcher | [theme.md](./theme.md) | | Light / dark theme, switcher | [theme.md](./theme.md) |
+118 -2
View File
@@ -169,7 +169,7 @@ They fail closed: where the staff collections are not known, nobody is staff, an
### Collection-level (return boolean | Where) ### Collection-level (return boolean | Where)
```ts ```ts
import { adminOnly, adminOrEditor, adminOrSelf, adminOrSelfIn, requireRole, authenticated } from '@intecion/ipal-kit' import { adminOnly, adminOrEditor, adminOrSelf, adminOrSelfIn, readPublished, requireRole, authenticated } from '@intecion/ipal-kit'
export const Articles = { export const Articles = {
slug: 'articles', slug: 'articles',
@@ -191,8 +191,35 @@ access: { read: adminOrSelf } // fine with a single auth collection
// any minimum threshold // any minimum threshold
access: { update: requireRole('editor') } access: { update: requireRole('editor') }
// a collection with drafts: editors (or the role you name) read everything; visitors, plain `user` accounts and a
// session that still owes its second factor read published documents only — by id, in lists, with ?draft=true and
// over GraphQL. Payload's open `read: () => true` answers ?draft=true with the draft itself (1.17.1).
// Version history asks for the status at another path: readPublishedVersions() goes on readVersions (1.18.0).
access: { read: readPublished(), readVersions: readPublishedVersions() }
access: { read: readPublished('admin'), readVersions: readPublishedVersions('admin') }
``` ```
**Where each rule may be used.**
| Rule | Where | What a visitor gets |
|---|---|---|
| `readPublished()` | `access.read` of a collection or global with `versions: { drafts: true }` | published documents: by id, lists, `?draft=true`, GraphQL |
| `readPublishedVersions()` | `access.readVersions` of the same collection or global | published versions: the version list, one version by id (a draft one: `403`), the count, GraphQL, the panel's version view |
The two answer with different paths: a document has `_status`, a version has `version._status`. In 1.17.1,
`readVersions: readPublished()` (the form these docs showed) answered every version read with **500** on MongoDB,
Postgres and SQLite. Since 1.18.0, iapl() swaps a `readPublished()` it finds on `readVersions` of a collection or
global for `readPublishedVersions()` with the same role, so that form works too. A collection added by a plugin
listed **after** iapl() is not seen: use `readPublishedVersions()` there, or `withVersionReadRules(collections)`.
Neither rule belongs on a collection without drafts (no `_status`: every read would fail). Check: without a session,
`GET /api/<slug>/versions?limit=10` → `200` with published versions only, never `500`.
A role name the plugin does not know (`requireRole('Admin')`, `readPublished('superadmin')`) throws where the rule
is written; `hasMinimumRole` / `userMeetsRole` answer `false` for it (before 1.17.1 every staff account met it).
`readPublished` with `?draft=true` on a page whose newest version is a draft answers a visitor `404` (Payload applies
the rule to that version), never the draft.
### Field-level (return boolean) ### Field-level (return boolean)
```ts ```ts
@@ -239,6 +266,10 @@ iapl({
// accounts: { firstUserRoute: 'all' }, // Payload's first-user route for every empty auth collection // accounts: { firstUserRoute: 'all' }, // Payload's first-user route for every empty auth collection
// accounts: { firstUserRoute: ['users', 'partners'] }, // accounts: { firstUserRoute: ['users', 'partners'] },
// accounts: { password: { minLength: 16 } }, // or password: false // accounts: { password: { minLength: 16 } }, // or password: false
// accounts: { lockedAnswer: 'payload' }, // a locked staff account is told it is locked (Payload's answer)
// accounts: { signInLimit: { perAddress: 10, windowMinutes: 15 } }, // or signInLimit: false (Payload's lock as before)
// accounts: { signInSameOrigin: { origins: ['https://panel.example.com'] } }, // or signInSameOrigin: false
// accounts: { confirmOwnChanges: false }, // own e-mail / password without the current password (as before)
// accounts: false, // none of the rules // accounts: false, // none of the rules
}) })
``` ```
@@ -466,10 +497,95 @@ characters."; texts `passwordTooShort`, `passwordIsEmail` in `i18n.translations.
`DEFAULT_PASSWORD_MIN_LENGTH`. `DEFAULT_PASSWORD_MIN_LENGTH`.
- **Check:** create an account with an 11-character password → "The password must have at least 12 characters.". - **Check:** create an account with an 11-character password → "The password must have at least 12 characters.".
### A locked staff account answers like a wrong password (`accounts.lockedAnswer`, 1.18.0)
Payload locks an account after `maxLoginAttempts` wrong passwords (5 by default; on staff collections 50 for an hour
since 1.18.0, `signInLimit` below) for `lockTime` (10 minutes by default), and
it checks the lock **before** the password: the locked account then gets `401 "This user is locked due to having too
many failed login attempts."` for any password, while an address with no account always gets `401 "The email or
password provided is incorrect."`. Five wrong guesses told anybody, without a password, whether an address has a
staff account. Now a staff collection's login answers a locked account exactly like a wrong password — the same
status, body and GraphQL `extensions.name` (`AuthenticationError`) — over REST, GraphQL and the panel's sign-in
form. The lock itself is unchanged: the owner's correct password is still refused until it ends, and the owner is
then told "wrong e-mail or password" (an administrator sees `lockUntil` on the account and can unlock it). Visitor
collections (not staff) keep Payload's answer.
- **Turn off:** `accounts: { lockedAnswer: 'payload' }` (Payload's message), or `accounts: false`. Any other value
stops the start.
- **Building blocks:** `lockedLooksWrong` (the config-level `afterError` hook), `withLockedAnswer(config)`,
`graphqlLoginName(collection)` (`login<SingularName>`, as GraphQL names the mutation).
- **Check:** five wrong passwords for an admin's address, then `POST /api/users/login` with the right one → the same
`401` body as for `nobody@example.com`; GraphQL `loginUser` → `extensions.name: "AuthenticationError"`.
### A stranger cannot lock a staff account out (`accounts.signInLimit`, 1.18.0)
Payload locks an account after `maxLoginAttempts` wrong passwords (5) for `lockTime` (10 minutes) — wrong passwords
from **anybody**: five posts with no password at all kept the owner out, again and again. Now failed sign-ins to a
staff collection are counted **per client IP and typed address**: after **5 failures in 15 minutes** from one IP for
one address, that IP gets `429` ("Too many failed sign-ins to this address from here. Try again in N min.") for that
address; the owner, from anywhere else, signs in. Payload's own per-account lock stays as the net against a spray
from many IPs, at **50 failures, locked for an hour** — set only where the project did not set
`auth.maxLoginAttempts` / `auth.lockTime` itself (a value you wrote stays; no schema change).
- **Only failures count.** A sign-in takes its place before the password is compared (a burst cannot slip under the
limit) and gives it back when it worked, or when it was refused without a compare. Several correct sign-ins at once
from one place may hear "try again in a moment" — nothing is locked.
- **One count for every spelling** of an address: the typed address is folded like the database that folds the most
(case, full-width and compatibility forms — NFKC — and spaces), so `OWNER@…`, `owner@…` and `owner@…` share it.
The "too many" answer is the same for a real and an invented address.
- **The client IP** is `clientIp()` — pin `IAPL_IP_HEADER` in production ([forms.md](./forms.md)). Requests without
an address share one bucket at 20× the limit (`setUnknownIpFactor`). Server code (the Local API) is never limited.
- **Options:** `signInLimit: { perAddress, windowMinutes, accountLock: { maxLoginAttempts, lockTime } }`;
`accountLock: false` = Payload's lock (5, 10 min) beside the per-IP count; `signInLimit: false` = no per-IP count
and Payload's lock as before. Values that make no sense (`0`, `'false'`) stop the start.
- **Check:** five wrong passwords for an editor with `X-Forwarded-For: 198.51.100.1` (behind one proxy, with
`IAPL_IP_HEADER=x-forwarded-for`), then the right one from there → `429`; from `203.0.113.1` → `200`.
- A staff collection a plugin listed after `iapl` adds is not covered (its config is built after these rules).
### Staff sign-in only from the site's own origin (`accounts.signInSameOrigin`, 1.18.0)
Login, "forgot password" and "reset password" of a staff collection refuse (`403`, before anything is counted or sent)
a request a browser marks as coming from another origin (`Origin`, else `Sec-Fetch-Site`) — over REST and GraphQL.
A foreign page could otherwise sign a visitor's browser into an account of the attacker's choosing (login CSRF), or
make visitors' browsers ask for reset mails. Own origins: the request's host (`Host`, `X-Forwarded-Host`),
`serverURL`, Payload's `csrf` and `cors` lists, and `signInSameOrigin.origins`. A request with neither header (a
script, `curl`, a server) passes. Visitor collections (not staff) are not touched — a shop front end on another
domain keeps signing its customers in. The first refusal of each origin is logged with the ways to allow it.
- **A panel or front end that signs staff in from another origin:** `signInSameOrigin: { origins: ['https://…'] }`.
**Behind a proxy that rewrites `Host`** without `serverURL`: set `serverURL` (or the site's own sign-in is refused).
- **Off:** `signInSameOrigin: false`.
- **Check:** `curl -X POST <site>/api/users/login -H 'Origin: https://other.example' -H 'Content-Type: application/json'
-d '{"email":"a@b.c","password":"x"}'` → `403`.
### Changing one's own e-mail or password asks for the current password (`accounts.confirmOwnChanges`, 1.18.0)
A stolen session alone could take an account over: change the e-mail, then "forgot password". Now an account that
changes its **own** e-mail address, username or password must send its current password — in the panel a
**Current password** field on the account's own page (the plugin's `MaskedField`, already in every site's import
map: no `generate:importmap`), over REST / GraphQL `currentPassword` in the body / `data`. Without it: `400` on the
`currentPassword` field ("Enter your current password…"); wrong: `400` ("The current password is not right."). Wrong
current passwords count like failed sign-ins (`signInLimit`). The field is virtual: never stored, never read back.
- **Not asked:** an administrator changing **another** account; other fields of one's own account; server code
(`overrideAccess`); a request with an API key; "forgot password" / "reset password" (the token is the proof).
- **Scripts that change their own password** add `"currentPassword": "<the old one>"` to the body.
- **Off:** `confirmOwnChanges: false`. A project with its own `currentPassword` field keeps its field and its value (the
rule reads the value from it and does not take it out of the save).
- The check uses Payload's stored hash formats (PBKDF2-SHA256 at 600,000 / 100,000 iterations, and the older
25,000-iteration hashes); a hash format a later Payload adds is refused until IAPL knows it (fail closed — the
user then changes the password through "forgot password").
- **Check:** as an editor, `PATCH /api/users/<own id>` with `{ "email": "new@…" }` → `400`; with `"currentPassword"`
→ `200`. In the panel: Account → the new e-mail and "Current password" → saved.
- **Building blocks** of the three rules: `applySignInRules(collection, accounts)`, `buildSignInBeforeOperation`,
`releaseSignInPlace` (`afterLogin`), `settleFailedSignIn` (config `afterError`), `buildCurrentPasswordField`,
`resolveSignInRules`, `foldSignInName`, `passwordMatches`, `CURRENT_PASSWORD_FIELD`, `SIGN_IN_RULES_MARK` (on the hook); `releaseRateLimit` (gives a
place of `consumeRateLimit` back — for limiters that count failures only).
## Turn off, override, extend ## Turn off, override, extend
- **Account rules:** `accounts: false`, or one by one — `panelRole`, `adminOnlyCreate`, `adminOnlyWrite`, - **Account rules:** `accounts: false`, or one by one — `panelRole`, `adminOnlyCreate`, `adminOnlyWrite`,
`staffOnlyRead`, `firstUserRoute`, `password` (above). `staffOnlyRead`, `firstUserRoute`, `password`, `lockedAnswer`, `signInLimit`, `signInSameOrigin`, `confirmOwnChanges` (above).
- **Turn off:** leave out `access` — no `roles` field, the auth collection keeps Payload's rules - **Turn off:** leave out `access` — no `roles` field, the auth collection keeps Payload's rules
(or yours). `access.firstUserAdmin: false` stops giving admin to the first account. (or yours). `access.firstUserAdmin: false` stops giving admin to the first account.
- **Override:** `access.staffCollections` (who is staff), `access.authAccess` (injected collection), your own auth collection (wins whole), - **Override:** `access.staffCollections` (who is staff), `access.authAccess` (injected collection), your own auth collection (wins whole),
+137 -40
View File
@@ -240,14 +240,14 @@ site), **P** = a test in the panel. Full code: PROGRAMISTA.md §2.
| 3a | **Search Console / Bing** | recommended: **domain verification via DNS** (TXT record, deployment.md §6) — the plugin does nothing, the verification fields stay empty; only for URL-prefix verification: code in **Site settings → Search engines** (Google, Bing, Yandex), `generatePageMetadata` adds the `<meta>` itself; sitemap `https://<domain>/sitemap.xml` submitted in GSC and Bing | panel (optional), `verificationFrom` | P | | 3a | **Search Console / Bing** | recommended: **domain verification via DNS** (TXT record, deployment.md §6) — the plugin does nothing, the verification fields stay empty; only for URL-prefix verification: code in **Site settings → Search engines** (Google, Bing, Yandex), `generatePageMetadata` adds the `<meta>` itself; sitemap `https://<domain>/sitemap.xml` submitted in GSC and Bing | panel (optional), `verificationFrom` | P |
| 4 | **SEO** — structured data | layout: `<SiteProviders shell={…}>` gives `WebSite` + `Organization` (`sameAs`) from Site settings; local business → `createContentHelpers({ siteJsonLd })` with `buildLocalBusinessJsonLd` (`type`, hours → `formatOpeningHours`); navigation: `<SiteProviders jsonLd={[buildNavigationJsonLd(…)]}>`; page: `createPageRoute` adds `getPageJsonLd` (WebPage/BlogPosting, breadcrumbs, FAQ — `pageJsonLd: { faq }`) | `getSiteShell`, `SiteProviders`, `build*JsonLd`, `getPageJsonLd` | A, S | | 4 | **SEO** — structured data | layout: `<SiteProviders shell={…}>` gives `WebSite` + `Organization` (`sameAs`) from Site settings; local business → `createContentHelpers({ siteJsonLd })` with `buildLocalBusinessJsonLd` (`type`, hours → `formatOpeningHours`); navigation: `<SiteProviders jsonLd={[buildNavigationJsonLd(…)]}>`; page: `createPageRoute` adds `getPageJsonLd` (WebPage/BlogPosting, breadcrumbs, FAQ — `pageJsonLd: { faq }`) | `getSiteShell`, `SiteProviders`, `build*JsonLd`, `getPageJsonLd` | A, S |
| 5 | **GEO** — llms | `src/app/llms.txt/route.ts` (`llmsRoute`) and `src/app/llms-full.txt/route.ts` (`llmsFullRoute`) from `lib/content`; the `buildSummaryField()` field in Pages, `summaryField: 'aiSummary'` in `createContentHelpers` | `llmsRoute`, `llmsFullRoute`, `buildSummaryField` | A, S | | 5 | **GEO** — llms | `src/app/llms.txt/route.ts` (`llmsRoute`) and `src/app/llms-full.txt/route.ts` (`llmsFullRoute`) from `lib/content`; the `buildSummaryField()` field in Pages, `summaryField: 'aiSummary'` in `createContentHelpers` | `llmsRoute`, `llmsFullRoute`, `buildSummaryField` | A, S |
| 6 | **GEO** — Markdown | `src/app/md/[locale]/[[...slug]]/route.ts` (single-language: `src/app/md/[[...slug]]/route.ts`) = `export { markdownRoute as GET } from '@/lib/content'`; `createContentHelpers({ markdownAlternate: true })` (link in `<head>`); `createProxy(…, { NextResponse, markdown: true })` (without it `/md/…` gets redirected to a language) | `markdownRoute`, `markdownAlternate`, `createProxy({ markdown })` | A, S | | 6 | **GEO** — Markdown | `src/app/md/[locale]/[[...slug]]/route.ts` (single-language: `src/app/md/[[...slug]]/route.ts`) = `export { markdownRoute as GET } from '@/lib/content'`; `createContentHelpers({ markdownAlternate: true })` (link in `<head>`); `createProxy(…, { NextResponse, markdown: true })` (without it `/md/…` gets redirected to a language; the `Accept: text/markdown` answer at a page URL is `private, no-store` + `Vary: Accept` since 1.18.0 — check: `curl -sD- -o/dev/null -H 'Accept: text/markdown' localhost:3000/pl \| grep -i cache-control` → `private, no-store`) | `markdownRoute`, `markdownAlternate`, `createProxy({ markdown })`, `markdown: { negotiate: false }` | A, S |
| 7 | **GEO** — MCP | `src/app/api/mcp/route.ts` = `export { mcpGET as GET, mcpPOST as POST } from '@/lib/content'` (public — AI browses the site: `get_site_info`, `list_pages`, `search_content`, `get_page`); name: `createContentHelpers({ mcp: { serverName } })` | `mcpGET`, `mcpPOST` | A, S | | 7 | **GEO** — MCP | `src/app/api/mcp/route.ts` = `export { mcpGET as GET, mcpPOST as POST } from '@/lib/content'` (public — AI browses the site: `get_site_info`, `list_pages`, `search_content`, `get_page`); name: `createContentHelpers({ mcp: { serverName } })` | `mcpGET`, `mcpPOST` | A, S |
| 8 | **GEO** — AI bots + IndexNow | robots **lets in** AI bots (default `aiBots: 'allow'`; block only on a client decision); AI bot policy and per-bot exceptions — Site settings → Search engines → AI assistants (works only with `getRobots`); `iapl({ indexNow: true })` + `src/app/indexnow-key.txt/route.ts` (`indexNowKeyRoute`; publishing → Bing/ChatGPT Search within minutes; IndexNow sends nothing with `IAPL_NOINDEX=1`) | `buildRobots`, `getRobots`, `indexNowKeyRoute` | A, S | | 8 | **GEO** — AI bots + IndexNow | robots **lets in** AI bots (default `aiBots: 'allow'`; block only on a client decision); AI bot policy and per-bot exceptions — Site settings → Search engines → AI assistants (works only with `getRobots`); `iapl({ indexNow: true })` + `src/app/indexnow-key.txt/route.ts` (`indexNowKeyRoute`; publishing → Bing/ChatGPT Search within minutes; IndexNow sends nothing with `IAPL_NOINDEX=1`) | `buildRobots`, `getRobots`, `indexNowKeyRoute` | A, S |
| 9 | **Media / R2 / speed** | `Media` with `focalPoint`, `normalizeFilenameHook`, `buildOptimizeUploadHook`, `buildMediaPlaceholderHook` + field; **always** `buildR2Storage(['media'], { s3Storage })` + `@payloadcms/storage-s3`; `R2_*` in `.env.example`; `<MediaPreconnect/>`; `images: buildImagesConfig()` and `buildUploadSecurityHeaders()` in `next.config.ts`; the project's `<Media>` via `mediaImageProps`/`videoProps` (§6.11b) | `buildR2Storage`, `mediaImageProps`, `videoProps`, `buildImagesConfig` | A, S | | 9 | **Media / R2 / speed** | `Media` with `focalPoint`, `normalizeFilenameHook`, `buildOptimizeUploadHook`, `buildMediaPlaceholderHook` + field; **always** `buildR2Storage(['media'], { s3Storage })` + `@payloadcms/storage-s3`; `R2_*` in `.env.example`; `<MediaPreconnect/>`; `images: buildImagesConfig()` and `buildUploadSecurityHeaders()` in `next.config.ts`; the project's `<Media>` via `mediaImageProps`/`videoProps` (§6.11b) | `buildR2Storage`, `mediaImageProps`, `videoProps`, `buildImagesConfig` | A, S |
| 10 | **Forms** | every form from a **seed** (`scripts/seed-form-*.ts`: fields, confirmation, mail to the company **and** confirmation to the customer, every language); a block with `<RenderForm>` + `formClasses.ts` (look, once); `actions.ts` = `createSubmitAction({ getCachedPayload, headers })`; `forms: {…}` in `iapl`; `email: mailAdapter()` | `RenderForm` (`/rsc`), `createSubmitAction`, `mailAdapter` | A, P | | 10 | **Forms** | every form from a **seed** (`scripts/seed-form-*.ts`: fields, confirmation, mail to the company **and** confirmation to the customer, every language); a block with `<RenderForm>` + `formClasses.ts` (look, once); `actions.ts` = `createSubmitAction({ getCachedPayload, headers })`; `forms: {…}` in `iapl`; `email: mailAdapter()` | `RenderForm` (`/rsc`), `createSubmitAction`, `mailAdapter` | A, P |
| 11 | **Turnstile** | `<SiteProviders>` in `[locale]/layout.tsx` (wires `TurnstileProvider` with the key from the panel); `RenderForm` renders the widget; keys in Site integrations | `SiteProviders`, `getTurnstileConfig`, `TurnstileProvider` | A, P | | 11 | **Turnstile** | `<SiteProviders>` in `[locale]/layout.tsx` (wires `TurnstileProvider` with the key from the panel); `RenderForm` renders the widget; keys in Site integrations | `SiteProviders`, `getTurnstileConfig`, `TurnstileProvider` | A, P |
| 12 | Consent + analytics | Consent Mode: `'advanced'` (default — the Google tag loads at once with every signal `denied`) or `'basic'` (`<SiteProviders analytics={{ consentMode: 'basic' }}>` — no request to Google before consent; a client who wants zero requests), the choice goes to "Project decisions"; the consent log is on by default since 1.17.0 (`consentLog: false` turns it off; **Postgres / SQLite: `pnpm payload migrate:create consent-log` and apply it in the same deploy**, doctor `consent-log-migration`) + `<SiteProviders banner={<CookieBanner settings="detailed" />}>` (posts every decision to the log by itself; "Reject" is as prominent as "Accept all" by default — `equalChoice`; Global Privacy Control honoured by default — `gpc`, consent.md → "Global Privacy Control"; ConsentProvider, banner, CookieButton, Analytics in the right order; the banner is in the server HTML and painted with the page — pages stay static, an inline script decides before the first paint; with a nonce CSP pass `nonce` to `SiteProviders`; never wrap the banner in a "mounted" guard or `dynamic(…, { ssr: false })`, never read the consent cookie in the layout unless the site is dynamic anyway: `consentCookie`, consent.md → "First paint"); settings window mode (`settings`: `inline` / `modal` / `detailed`) per the design, brief is silent → `detailed`, the decision goes to "Project decisions"; tool IDs in the panel; the cookie list from a scan (`cookieScanner: true` → *Cookie review* → **Scan cookies** → *Approve cookies* → **Approve and add**; or cookie-scan → import) — feeds `<CookieTable>` on the policy page **and** the lists in the `detailed` window; Cookies → Settings window → Cookie list headings in every language | consent.md, analytics.md | A, `iapl-consent-check` | | 12 | Consent + analytics | Consent Mode: `'advanced'` (default — the Google tag loads at once with every signal `denied`) or `'basic'` (`<SiteProviders analytics={{ consentMode: 'basic' }}>` — no request to Google before consent; a client who wants zero requests), the choice goes to "Project decisions"; the consent log is on by default since 1.17.0 (`consentLog: false` turns it off; **Postgres / SQLite: `pnpm payload migrate:create consent-log` and apply it in the same deploy**, doctor `consent-log-migration`) + `<SiteProviders banner={<CookieBanner settings="detailed" />}>` (posts every decision to the log by itself; "Reject" is as prominent as "Accept all" by default — `equalChoice`; Global Privacy Control honoured by default — `gpc`, consent.md → "Global Privacy Control"; ConsentProvider, banner, CookieButton, Analytics in the right order; the banner is in the server HTML and painted with the page — pages stay static, an inline script decides before the first paint; with a nonce CSP pass `nonce` to `SiteProviders`; never wrap the banner in a "mounted" guard or `dynamic(…, { ssr: false })`, never read the consent cookie in the layout unless the site is dynamic anyway: `consentCookie`, consent.md → "First paint"); settings window mode (`settings`: `inline` / `modal` / `detailed`) per the design, brief is silent → `detailed`, the decision goes to "Project decisions"; tool IDs in the panel; the cookie list from a scan (`cookieScanner: true` → *Cookie review* → **Scan cookies** → *Approve cookies* → **Approve and add**; or cookie-scan → import) — feeds `<CookieTable>` on the policy page **and** the lists in the `detailed` window; Cookies → Settings window → Cookie list headings in every language | consent.md, analytics.md | A, `iapl-consent-check` |
| 13 | Security | `buildSecurityHeaders` in `next.config.ts`; `withSecurityConfig(withPayload(nextConfig))` — this order (no `X-Powered-By`; Payload's colour-scheme client hints for `/admin` only, check: `curl -sI localhost:3000/pl \| grep -i critical-ch` → nothing); CSP: `buildSecurityHeaders({ csp: { mode: 'report-only', reportUri: '/api/csp-report', … } })` + `buildAdminCspHeaders` on `/admin/:path*` + `src/app/api/csp-report/route.ts` (`createCspReportRoute`) → read the reports → `mode: 'enforce'`; `twoFactor: { issuer, plugin: payloadTotp }` + `generate:importmap` (`TotpRedirectProvider`, `SafeTotpView`; check: a new admin lands on `/admin/setup-totp?back=%2Fadmin` with the QR, no reloading; a login with the password only gets `403` from `/api/globals/site-integrations` and `/api/form-submissions` — security.md "What the second factor covers"); own endpoints: `secondFactorPassed(req)` / `userMeetsRole(req, role)`; **an account without 2FA can only set it up** (`twoFactor.requireSetup`, default: nothing else answers, 72 h from creation or an admin's reset, then blocked until an admin chooses "Reopen setup" on the account) — so set 2FA up right after creating an account; `iapl-doctor --url` must report 0 accounts without 2FA; Postgres/SQLite: migration for `totpSetupFrom`; `IAPL_IP_HEADER` in production | security.md, forms.md | A | | 13 | Security | `buildSecurityHeaders` in `next.config.ts`; `withSecurityConfig(withPayload(nextConfig))` — this order (no `X-Powered-By`; Payload's colour-scheme client hints for `/admin` only, check: `curl -sI localhost:3000/pl \| grep -i critical-ch` → nothing); CSP: `buildSecurityHeaders({ csp: { mode: 'report-only', reportUri: '/api/csp-report', … } })` + `buildAdminCspHeaders` on `/admin/:path*` + `src/app/api/csp-report/route.ts` (`createCspReportRoute`) → read the reports → `mode: 'enforce'`; `twoFactor: { issuer, plugin: payloadTotp }` + `generate:importmap` (`TotpRedirectProvider`, `SafeTotpView`; check: a new admin lands on `/admin/setup-totp?back=%2Fadmin` with the QR, no reloading; a login with the password only gets `403` from `/api/globals/site-integrations` and `/api/form-submissions` — security.md "What the second factor covers"); own endpoints: `secondFactorPassed(req)` / `userMeetsRole(req, role)`; **an account without 2FA can only set it up** (`twoFactor.requireSetup`, default: nothing else answers, 72 h from creation or an admin's reset, then blocked until an admin chooses "Reopen setup" on the account) — so set 2FA up right after creating an account; **the first set-up ends with a link sent to the account's e-mail** (`twoFactor.confirmByEmail`, 1.18.0): e-mail must work first (Site integrations → "Send a test e-mail"; without it the link is only in the server log and an admin confirms on the account page; `iapl-doctor --deep` rule `2fa-enrolment-mail`), `serverURL` must be set (the link is made from it), check: a new editor scans the code → the screen names `e…@…`, `/api/globals/site-integrations` stays `403` until the link is opened in the same browser; `iapl-doctor --url` must report 0 accounts without 2FA; Postgres/SQLite: migration for `totpSetupFrom`; `IAPL_IP_HEADER` in production | security.md, forms.md | A |
| 14 | Operations | `src/app/api/health/route.ts` (`healthRoute`); `src/instrumentation.ts` with `assertEnv(iaplEnvRules({ storage: true, ipHeader: true }))`; staging with `IAPL_NOINDEX=1`; smoke tests (§8a) | `healthRoute`, `assertEnv`, `iaplEnvRules` | A | | 14 | Operations | `src/app/api/health/route.ts` (`healthRoute`); `src/instrumentation.ts` with `assertEnv(iaplEnvRules({ storage: true, ipHeader: true }))`; staging with `IAPL_NOINDEX=1`; smoke tests (§8a) | `healthRoute`, `assertEnv`, `iaplEnvRules` | A |
| 15 | System pages | Site settings → System pages: homepage, 404, privacy policy, cookies; legal links in the footer by role (`getSystemLinks(locale)`) | `getSystemLinks`, `getSystemPagePath`, `getNotFoundPage` | P | | 15 | System pages | Site settings → System pages: homepage, 404, privacy policy, cookies; legal links in the footer by role (`getSystemLinks(locale)`) | `getSystemLinks`, `getSystemPagePath`, `getNotFoundPage` | P |
| 16 | **Nothing hardcoded** | every text, link, image, file, company data from the panel; domains and keys from `.env` (§2) | — | A, P | | 16 | **Nothing hardcoded** | every text, link, image, file, company data from the panel; domains and keys from `.env` (§2) | — | A, P |
@@ -528,7 +528,7 @@ No abbreviations (`HeroSection`, not `HeroSec`). Do not create `lib/pages.ts`,
1. **`proxy.ts`, never `middleware.ts`.** middleware.ts exists → delete it. Proxy: 1. **`proxy.ts`, never `middleware.ts`.** middleware.ts exists → delete it. Proxy:
`export const proxy = createProxy(i18nConfig, { NextResponse, markdown: true })`, the matcher `export const proxy = createProxy(i18nConfig, { NextResponse, markdown: true })`, the matcher
as an **inline literal** (`['/((?!api|admin|_next|.*\\..*).*)']`), not an import. as an **inline literal** (`['/((?!(?:api|admin|_next)(?:/|$)|.*\\..*).*)']`), not an import.
2. **No explicit `<head>` in the layout.** It pushes metadata into `<body>`. 2. **No explicit `<head>` in the layout.** It pushes metadata into `<body>`.
`<MediaPreconnect/>` in `<body>` (React 19 hoists it). `<MediaPreconnect/>` in `<body>` (React 19 hoists it).
3. **ISR:** `export const revalidate = 3600` in `page.tsx`. Refresh after save: 3. **ISR:** `export const revalidate = 3600` in `page.tsx`. Refresh after save:
@@ -553,26 +553,50 @@ No abbreviations (`HeroSection`, not `HeroSec`). Do not create `lib/pages.ts`,
9. **RSC by default.** `'use client'` only for state/interaction, in a separate file; 9. **RSC by default.** `'use client'` only for state/interaction, in a separate file;
the section stays a server component and passes data to it. Secrets: `import 'server-only'`. the section stays a server component and passes data to it. Secrets: `import 'server-only'`.
10. **Blocks do not import `lib/*`** (cycle). Server-side data → `enhanceProps`. 10. **Blocks do not import `lib/*`** (cycle). Server-side data → `enhanceProps`.
11. **Next.js 16.4.5 or later** (minimum safe version; the plugin, the reference site and the starter use 16.4.6). 11. **Next.js 16.4.6 or later** (minimum safe version since 1.18.0; the plugin, the reference site and the starter use 16.4.6).
16.0.0–16.4.0 have unauthenticated RCE and DoS advisories (GHSA-2464-fhr4-w9xw, GHSA-673q-mjm6-r5xr, 16.0.0–16.4.0 have unauthenticated RCE and DoS advisories (GHSA-2464-fhr4-w9xw, GHSA-673q-mjm6-r5xr,
GHSA-p3m5-59mp-jv5r); 16.3.0–16.4.4 have GHSA-mfr8-8qww-v76h (information disclosure across root params when a GHSA-p3m5-59mp-jv5r); 16.3.0–16.4.4 have GHSA-mfr8-8qww-v76h (information disclosure across root params when a
`'use cache'` function is called through `unstable_cache()`, moderate; fixed in 16.4.5). Payload supports no `'use cache'` function is called through `unstable_cache()`, moderate; fixed in 16.4.5). 16.4.6 is the tested
patched 15.x line. Pin `next` and `eslint-config-next` to the same 16.4.x (≥ 16.4.5): version; its React copy carries the fix for React's RSC advisory GHSA-xqc2-xf4c-x3h3 (critical, fixed in
`react-server-dom-*` 19.3.1). Payload supports no patched 15.x line. Pin `next` and `eslint-config-next` to the
same 16.4.x (≥ 16.4.6):
`pnpm add [email protected] [email protected]`, and make sure `sharp` resolves to 0.35.5 or later `pnpm add [email protected] [email protected]`, and make sure `sharp` resolves to 0.35.5 or later
(`pnpm why sharp`). The plugin's peer range stays open (`next >=15`) — the minimum is yours to keep. (`pnpm why sharp`). The plugin's peer range stays open (`next >=15`) — the minimum is yours to keep.
**Check:** `pnpm ls next sharp` → next ≥ 16.4.5, sharp ≥ 0.35.5; `pnpm exec iapl-doctor` → no `next-min` **Check:** `pnpm ls next sharp` → next ≥ 16.4.6, sharp ≥ 0.35.5; `pnpm exec iapl-doctor` → no `next-min`
finding; `pnpm dev` prints no security-upgrade warning. finding; `pnpm dev` prints no security-upgrade warning.
**GHSA-xqc2-xf4c-x3h3 in Next (security audit 2026-12, O1, settled):** Next vendors its own React copy
(`next/dist/compiled/react-server-dom-{webpack,turbopack}`), labelled `19.3.0-canary-278794d7-20261002`. That
label is older than the fix, but the code carries it: compared with React's fix commit 0c9913ae (#37846), the
vendored server has the new backing-store reads (`getBackingBlob`), stream chunks under their own `"S"` key, and
the fix's new error 612 ("Cannot transport a detached buffer"), and none of the old helpers. `pnpm audit` does not
flag `next` for it (the advisory names `react-server-dom-*`, not `next`). After a Next upgrade, check the same way:
`grep -c "detached buffer" node_modules/next/dist/compiled/react-server-dom-webpack/cjs/*server.node.production.js` → 1.
12. **No open production advisories.** Node.js 20 or later for the plugin itself (its `nodemailer` 10 requires it); 12. **No open production advisories.** Node.js 20 or later for the plugin itself (its `nodemailer` 10 requires it);
**Payload 3.94 needs Node.js 22.23.5 or later** on the 22 line (`engines`: `">=22.23.5 <23"`, `.nvmrc` `22`), locally, **Payload 3.94 needs Node.js 22.23.5 or later** on the 22 line (`engines`: `">=22.23.5 <23"`, `.nvmrc` `22`), locally,
in CI and in Coolify (Nixpacks takes the major from `engines` / `.nvmrc` and the patch from its own release: check in CI and in Coolify (Nixpacks takes the major from `engines` / `.nvmrc` and the patch from its own release: check
`node -v` in the app's Terminal; below 22.23.5, update Coolify before moving to Payload 3.94). Run `node -v` in the app's Terminal; below 22.23.5, update Coolify before moving to Payload 3.94). Run
`pnpm audit --prod`. The plugin's own dependencies are clean; what remains comes from Payload's tree, which only `pnpm audit --prod`. The plugin's own dependencies are clean; what remains comes from Payload's tree, which only
the project's lockfile can fix. With `payload` **3.94.x** two packages are still pinned below a fix and need the project's lockfile can fix. With `payload` **3.94.x** four packages are still below a fix in a lockfile and
`pnpm.overrides` next to the `@payloadcms/*` ones: need `pnpm.overrides` next to the `@payloadcms/*` ones:
```json ```json
"cross-spawn@>=7 <7.1.0": "^7.1.2",
"dompurify@<3.4.17": "^3.4.17", "dompurify@<3.4.17": "^3.4.17",
"happy-dom@<21.0.4": "^21.0.4" "happy-dom@<21.0.4": "^21.0.4",
"ws@>=8 <8.23.0": "^8.23.0"
``` ```
`ws` comes from `payload` (`^8.16.0`): GHSA-37g9-w4hg-h9qr (high, memory exhaustion through unbounded automatic
pong responses, published 2026-12-01) is fixed in 8.23.0. Payload's range allows it, but a lockfile made earlier
keeps 8.21 / 8.22 until it is updated; the override lifts it in every lockfile and does nothing once it resolves
8.23 or later. `iapl-doctor` (`transitive-min`) warns while an older one is installed. `cross-spawn` comes with `cross-env` (the
site's scripts) and `eslint`: GHSA-ghv9-86vm-4v8m (critical, command injection when spawning batch files, Windows
only, published 2026-12-01) is fixed in 7.1.0; Coolify runs Linux, but `pnpm audit --prod` reports it as critical.
**Postgres sites** also add `"esbuild@<0.25.0": "^0.25.12"`: `@payloadcms/db-postgres` → `drizzle-kit` →
`@esbuild-kit/*` brings esbuild 0.18 (GHSA-67mh-4wv8-2f99, moderate: esbuild's own dev server answers any origin;
drizzle-kit never starts that server, but `pnpm audit --prod` lists it). The plugin's own tests run the Postgres
adapter on 0.25 with this override. A project that runs `@payloadcms/eslint-config` also adds
`"eslint@>=9 <9.39.4": "^9.39.4"` and `"minimatch@>=7 <11.0.8": "^11.0.10"` (dev tooling: GHSA-xffm-g5w8-qvg7 in
`@eslint/plugin-kit` 0.2, GHSA-g3hv-75wg-m249 and GHSA-c859-jr93-m5j4 in `minimatch` 9 / 10; the plugin's lint
gives the same results with them).
`happy-dom` comes from `@payloadcms/richtext-lexical` → `@lexical/headless` 0.50 (`^20.9.0`, still so in 3.94.1); `happy-dom` comes from `@payloadcms/richtext-lexical` → `@lexical/headless` 0.50 (`^20.9.0`, still so in 3.94.1);
every 20.x has GHSA-c8p4-j97h-3vg8 (high, SSRF when parsing untrusted HTML, fixed in 21.0.0) and every 20.x has GHSA-c8p4-j97h-3vg8 (high, SSRF when parsing untrusted HTML, fixed in 21.0.0) and
GHSA-834v-8h66-3h79 (high, host code execution, fixed in 21.0.4). 21 is a major, but only GHSA-834v-8h66-3h79 (high, host code execution, fixed in 21.0.4). 21 is a major, but only
@@ -636,12 +660,20 @@ for visitors. Then, all four:
`access.staffCollections` is for a second collection of STAFF (access.md → "Who is staff"). `access.staffCollections` is for a second collection of STAFF (access.md → "Who is staff").
3. In every auth collection use `adminOrSelfIn('<its slug>')`, not `adminOrSelf`, for "only my own record". 3. In every auth collection use `adminOrSelfIn('<its slug>')`, not `adminOrSelf`, for "only my own record".
4. Payload's default for a collection or global without `access` is "any logged-in account" — a customer too. 4. Payload's default for a collection or global without `access` is "any logged-in account" — a customer too.
Give every collection and global explicit `access`. 2FA covers the panel's collection only. Give every collection and global explicit `access` (writes: `adminOrEditor`, as the reference site's collections
and globals do since 1.18.0). Verify with `iapl-doctor --url …` (deep): no `visitor-writes` finding. 2FA covers
the panel's collection only. Payload's document locks (`payload-locked-documents`) are staff only since 1.18.0
(`lockedDocuments`), and lists from outside are capped at 100 for non-staff (`listLimit`) — security.md
"Lists and sorting".
5. Never let a sign-up write a field that grants rights (`roles`, `isAdmin`, …): give such a field 5. Never let a sign-up write a field that grants rights (`roles`, `isAdmin`, …): give such a field
`access: { create: adminOnlyField, update: adminOnlyField }`. `access: { create: adminOnlyField, update: adminOnlyField }`.
6. Check: log in as such an account (`POST /api/customers/login`), then `GET /api/globals/site-integrations`, 6. Check: log in as such an account (`POST /api/customers/login`), then `GET /api/globals/site-integrations`,
`GET /api/form-submissions` and `GET /api/users` with its token must answer `403`, and so must `GET /api/form-submissions` and `GET /api/users` with its token must answer `403`, and so must
`POST /api/setup-totp`. `POST /api/setup-totp`, `POST /api/form-submissions` and (a site with Payload jobs) `GET /api/payload-jobs/run`
(`401`).
7. Payload jobs run over HTTP: since 1.18.0 only an admin or `Authorization: Bearer <CRON_SECRET>` (when the project
writes no `jobs.access.run`). A Coolify scheduled task that calls `/api/payload-jobs/run` sends that header;
`CRON_SECRET` goes into the app's environment (security.md "Payload's job queue").
**NEVER:** a second `media`, `daneFirmy`/`settings`/ **NEVER:** a second `media`, `daneFirmy`/`settings`/
`navigation`/`footer` as collections (they are globals), FAQ/hero/features as collections `navigation`/`footer` as collections (they are globals), FAQ/hero/features as collections
@@ -1035,22 +1067,31 @@ Example `styles.css`: [section-code.md](./skills/iapl-block/resources/section-co
125 % and 150 % zoom at 1366 (common on Windows). No horizontal scroll, no clipped text, 125 % and 150 % zoom at 1366 (common on Windows). No horizontal scroll, no clipped text,
the menu works, the hero CTA is visible. the menu works, the hero CTA is visible.
### 6.11b Speed (Core Web Vitals) ### 6.11b Speed (Core Web Vitals) — the handbook is [performance.md](../performance.md), the skill `iapl-performance`
| What | How | Forbidden | | What | How | Forbidden |
|---|---|---| |---|---|---|
| LCP image (the first visible one, usually the hero) | `<Media priority>` — exactly one per page | `priority` on many images, the hero as a CSS `background-image` | | LCP image (the first visible one, usually the hero) | `<Media priority>` — exactly one per page (preload + `fetchpriority="high"`) | `priority` on many images, the hero as a CSS `background-image`, a lazy hero |
| every other image | `<Media sizes={MEDIA_SIZES.third}>` — `sizes` = the width on screen | no `sizes` (downloads the full width), `<img>` | | above the fold, not the LCP (header logo) | `<Media eager>` — loads at once, no high priority, no preload | `priority` on the logo (it competes with the hero) |
| every other image | `<Media sizes={MEDIA_SIZES.third}>` — `sizes` = the width on screen; lazy by default | no `sizes` (downloads the full width), `<img>` |
| placeholder | `buildMediaPlaceholderHook` + a field in Media (blur + color) | empty boxes that "jump in" while loading | | placeholder | `buildMediaPlaceholderHook` + a field in Media (blur + color) | empty boxes that "jump in" while loading |
| background video | `videoMode="background"`, MP4 H.264 ≤ 20 MB, no sound, with a poster | a video as the hero without a poster, `autoplay` with sound | | uploads | `buildOptimizeUploadHook` (stops images over 1.5 MB / 2560 px, converts on request, removes JPEG/PNG metadata — GPS, camera — without re-encoding; `stripMetadata: false` keeps it); `iapl-doctor --deep` counts stored images over the limits | 8 MB phone photos in the library |
| background video | `videoMode="background"`, MP4 H.264 ≤ 20 MB, no sound, with a poster; paused for "reduce motion" by itself (`pauseForReducedMotion={false}` turns that off) | a video as the hero without a poster, `autoplay` with sound |
| video with content | `videoMode="player"` (loads after a click) | `preload="auto"` | | video with content | `videoMode="player"` (loads after a click) | `preload="auto"` |
| YouTube | `<YouTubeEmbed>` from `/client` (the iframe only after a click) | a bare `<iframe src="youtube.com/embed…">` | | YouTube, maps, widgets | `<YouTubeEmbed>` from `/client` (the iframe only after a click); a map behind a click (a picture + a button) | a bare `<iframe>` that loads with the page |
| next.config | `images: { ...buildImagesConfig() }` (AVIF/WebP, R2) | no `remotePatterns` → images from R2 without optimization | | next.config | `images: buildImagesConfig()` (AVIF/WebP, R2, 31-day cache) | no `remotePatterns` → images from R2 without optimization |
| fonts | `next/font`, max 2 families × 2–3 weights, `subsets: ['latin', 'latin-ext']` (PL), `display: 'swap'` | a `<link>` to Google Fonts, 6 weights "just in case" | | fonts | `next/font`, max 2 families, variable, `subsets: ['latin', 'latin-ext']` (PL), `display: 'swap'`; the heading font `preload: false` (the starter's default: the stylesheet and the hero load first) | a `<link>` to Google Fonts, `display: 'block'`, 6 weights "just in case" |
| third-party scripts | `Analytics` (via `SiteProviders`, `analytics={{ defer: true }}`) / `ConsentScript` from the plugin | chat/map widgets loaded at start | | third-party scripts | `Analytics` (via `SiteProviders`, `analytics={{ defer: true }}`) / `ConsentScript` from the plugin; `next/script` for anything else | `<script src>` without `async` in the layout, chat/map widgets loaded at start |
| client components | small, interaction only (§6.9) | a whole section `'use client'` | | animations | `transform` / `opacity` only (the library's card hover fades a shadow layer), the token durations (`duration-fast`, reduced motion built in) or `motion-reduce:`; IntersectionObserver for "is it on screen" | animating `height` / `top` / `margin`, `transition-all`, a `scroll` listener doing work per event |
| client components | small, interaction only (§6.9); import from `@intecion/ipal-kit/client` freely — a page ships only what it renders; `BuilderForm` and `Turnstile` there load their code only where a form is shown (`/client/eager` for the eager ones, `RenderForm Form={…}`); the Turnstile widget's 73 px are kept free (`turnstileReserveHeight={0}` for an invisible widget) | a whole section `'use client'`; an empty box that a widget fills later |
| 404 | `createNotFoundPage({ load, placeholder })` with a block as tall as the 404 content (reference `not-found.tsx`) | a lazy 404 that moves the footer |
| data | the cached helpers of `lib/content` (`getSettings`, `resolveRoute`, `getSiteShell`…), `depth` as low as the page needs, `select` when you need one field, `cache()` around your own getters | `findGlobal` in a component without `cache()`, `depth: 2` "to be safe", a query per list item |
| what grows | logs with a retention (consent log 1095 days, statistics 90 — on MongoDB a TTL index deletes them by itself, `ttlIndex: false` turns it off; `forms: { submissionRetentionDays }` on the client's decision), `versions: { maxPerDoc: 20 }` where you turn versions on (the plugin's own entities get 20 by themselves), unused media reviewed in the panel (`iapl({ unusedMedia: true })`, then `pnpm generate:importmap`); `iapl-doctor --deep --only growth` ([performance.md](../performance.md) §6) | `maxPerDoc: 0`, submissions kept forever without a decision, a persistent volume on `.next` |
| budgets | `e2e/performance.spec.ts` from the `iapl-performance` skill (`perfBudgets()` from `/doctor`): fails when a page gets slower | "it felt fast on my machine" |
Target on the built site (mobile, Lighthouse/PageSpeed): LCP < 2.5 s, CLS < 0.1, INP < 200 ms. Target on the built site (mobile, Lighthouse/PageSpeed): LCP < 2.5 s, CLS < 0.1, INP < 200 ms — the plugin's default
Checks: `iapl-audit` (img/video outside Media, many `priority`, `h-screen`, fixed widths, budgets (`PERF_BUDGETS`). Checks: `iapl-doctor --only performance` — **errors** since 1.18.0, an accepted exception lowered or silenced with a reason in `iapl-doctor.json` (images config, fonts, render-blocking, embeds,
animations, a budget test; `--url`: compression, blocking scripts, preloads, a lazy first image, HTML size; `--deep`:
stored images over the limits), `iapl-audit` (img/video outside Media, many `priority`, `h-screen`, fixed widths,
YouTube `<iframe>`) and `iapl-seo-check` (images without dimensions, LCP image without priority). YouTube `<iframe>`) and `iapl-seo-check` (images without dimensions, LCP image without priority).
### 6.12 Exports and imports ### 6.12 Exports and imports
@@ -1103,7 +1144,7 @@ project → **plugin gap**, not a copy.
| ISR after save, old slug → 308, images across languages | `buildRevalidateHook`, `trackSlugHistoryHook`, `buildCrossLocaleFieldSync` | hooks.md | | ISR after save, old slug → 308, images across languages | `buildRevalidateHook`, `trackSlugHistoryHook`, `buildCrossLocaleFieldSync` | hooks.md |
| ISR after a global is saved | plugin globals: `iapl({ revalidatePath })`; your own globals: `buildGlobalRevalidateHook({ revalidatePath })` | hooks.md | | ISR after a global is saved | plugin globals: `iapl({ revalidatePath })`; your own globals: `buildGlobalRevalidateHook({ revalidatePath })` | hooks.md |
| Change a plugin global (access, hooks, fields) | `iapl({ globalOverrides })` | access.md | | Change a plugin global (access, hooks, fields) | `iapl({ globalOverrides })` | access.md |
| Roles and access | `adminOnly`, `adminOrEditor`, `adminOrSelf`, `adminOrSelfIn(slug)` (several auth collections), `authenticated`, `requireRole`, `hasMinimumRole` (+ `…Field`); staff checks: `userMeetsRole(req, role)`, `isAdmin(req.user, req.payload)` (roles count only for accounts of a staff collection; in a client component `isAdmin(user, config)` with `useConfig()`, imported from **`@intecion/ipal-kit/client`** (the main entry does not build there with webpack), in middleware `isAdmin(user, { staffCollections: ['users'] })` — without the last argument there it is always `false`), `staffCollectionSlugs(payload)`, `access.staffCollections`; second factor in your own code: `secondFactorPassed(req)`, `requireSecondFactor(access)`; injected `users`: `access.authAccess`, first user = admin (`access.firstUserAdmin`) | access.md, security.md | | Roles and access | `adminOnly`, `adminOrEditor`, `adminOrSelf`, `adminOrSelfIn(slug)` (several auth collections), `authenticated`, `requireRole`, `hasMinimumRole` (+ `…Field`); a collection or global with drafts: `access: { read: readPublished(), readVersions: readPublishedVersions() }` (editors read drafts and every version, everybody else published only — Payload's open `read: () => true` answers `?draft=true` with the draft; `readPublished` is for `read` only, `readPublishedVersions` for `readVersions` only — `readVersions: readPublished()` answered 500 in 1.17.1 and is swapped for you since 1.18.0 on entities iapl() sees, `withVersionReadRules(entities)` for a plugin listed after it, `READ_PUBLISHED` marks the rule; neither on a collection without drafts; verify: without a session `GET /api/<slug>/<draft id>?draft=true` → 404 and `GET /api/<slug>/versions?limit=10` → 200, published only); an unknown role name throws where the rule is written; staff checks: `userMeetsRole(req, role)`, `isAdmin(req.user, req.payload)` (roles count only for accounts of a staff collection; in a client component `isAdmin(user, config)` with `useConfig()`, imported from **`@intecion/ipal-kit/client`** (the main entry does not build there with webpack), in middleware `isAdmin(user, { staffCollections: ['users'] })` — without the last argument there it is always `false`), `staffCollectionSlugs(payload)`, `access.staffCollections`; second factor in your own code: `secondFactorPassed(req)`, `requireSecondFactor(access)`; injected `users`: `access.authAccess`, first user = admin (`access.firstUserAdmin`) | access.md, security.md |
| Data from globals | `getGlobal`, `getSiteSettings`, `getSiteIntegrations` | payload-helpers.md | | Data from globals | `getGlobal`, `getSiteSettings`, `getSiteIntegrations` | payload-helpers.md |
**Links and navigation** **Links and navigation**
@@ -1114,7 +1155,9 @@ project → **plugin gap**, not a copy.
| Legal links in the footer (href + page title) | `getSystemLinks(locale)` / `resolveSystemLinks` | links.md | | Legal links in the footer (href + page title) | `getSystemLinks(locale)` / `resolveSystemLinks` | links.md |
| Highlighted item, button variant | `buildLinkField({ appearances: [...] })` — the project's names | links.md | | Highlighted item, button variant | `buildLinkField({ appearances: [...] })` — the project's names | links.md |
| Language paths, switcher, hreflang | `getLocalizedSlugs`, `switchLocalePath`, `LanguageSwitcher`, `buildLocalizedPath` | i18n.md | | Language paths, switcher, hreflang | `getLocalizedSlugs`, `switchLocalePath`, `LanguageSwitcher`, `buildLocalizedPath` | i18n.md |
| Safe URL (no `javascript:`) | `safeHref` | links.md | | Safe URL (no `javascript:`) | `safeHref`; a text field for an address rendered into `href`: `buildUrlField({ schemes })`, `isAllowedUrl`, types `BuildUrlFieldOptions`, `UrlScheme` (security.md "Addresses rendered into `href`") | links.md, security.md |
| Lists and sorting from outside | `listLimit`, `refuseOperatorSort`, `lockedDocuments` (options); `buildQueryGuardHook`, `applyQueryGuard`, `capListLimit`, `isOperatorSort`, `isStaffRequest`, `isQueryGuardHook`, `QUERY_GUARD_MARK`, `RefusedSortError`, `DEFAULT_LIST_LIMIT`, `applyLockedDocumentsAccess`, `staffOnlyLocks`, `LOCKED_DOCUMENTS_SLUG`; types `ListLimitOptions`, `LockedDocumentsAccess` | security.md |
| Markdown negotiation, cache-safe | `MARKDOWN_NEGOTIATED_HEADER`, `NEGOTIATED_CACHE_CONTROL`, `appendVary`, `markdownResponse(md, { negotiated })` | content.md |
**Forms** **Forms**
| Need | Use | Doc | | Need | Use | Doc |
@@ -1141,7 +1184,7 @@ project → **plugin gap**, not a copy.
| Product / category JSON-LD (an entry that is not an article) | `pageJsonLd.entries` + `buildProductJsonLd` | seo.md | | Product / category JSON-LD (an entry that is not an article) | `pageJsonLd.entries` + `buildProductJsonLd` | seo.md |
| llms.txt / llms-full / Markdown / MCP | `llmsRoute`, `llmsFullRoute`, `markdownRoute`, `mcpGET`/`mcpPOST`; `markdownAlternate: true`; `createProxy({ markdown: true })` | seo.md, content.md, mcp.md | | llms.txt / llms-full / Markdown / MCP | `llmsRoute`, `llmsFullRoute`, `markdownRoute`, `mcpGET`/`mcpPOST`; `markdownAlternate: true`; `createProxy({ markdown: true })` | seo.md, content.md, mcp.md |
| IndexNow | `iapl({ indexNow: true })` + `indexNowKeyRoute` | seo.md | | IndexNow | `iapl({ indexNow: true })` + `indexNowKeyRoute` | seo.md |
| Search | `createSearchRoute({ …, isPathVisible })` | content.md | | Search | `createSearchRoute({ …, isPathVisible })`; `queryLimit` (default `SEARCH_QUERY_LIMIT` = `{ length: 200, words: 10 }`, `limitQuery(query, limit)` shows the cut — a longer query is cut before the database; `false` = whole query); an unknown `?locale` is the default locale | content.md |
**Media, look, speed** **Media, look, speed**
| Need | Use | Doc | | Need | Use | Doc |
@@ -1151,7 +1194,7 @@ project → **plugin gap**, not a copy.
| Enlarge an image (card, gallery, product, rich text) | `<SiteProviders lightbox>` + `<LightboxTrigger group image={lightboxImage(media, { size })}>` (`/client`), `RenderRichText lightbox`, `useLightbox`; labels: `iapl({ lightbox: true })` → Form messages → Image viewer | lightbox.md | | Enlarge an image (card, gallery, product, rich text) | `<SiteProviders lightbox>` + `<LightboxTrigger group image={lightboxImage(media, { size })}>` (`/client`), `RenderRichText lightbox`, `useLightbox`; labels: `iapl({ lightbox: true })` → Form messages → Image viewer | lightbox.md |
| YouTube without cookies before a click | `<YouTubeEmbed poster={…}>` (`/client`) — always pass an uploaded poster (without it the thumbnail comes from Google before any choice; a development warning says so) | storage.md | | YouTube without cookies before a click | `<YouTubeEmbed poster={…}>` (`/client`) — always pass an uploaded poster (without it the thumbnail comes from Google before any choice; a development warning says so) | storage.md |
| `next.config` | `buildImagesConfig`, `buildSecurityHeaders` (`csp`), `buildCsp`, `buildCspHeaders`, `buildAdminCsp` / `buildAdminCspHeaders`, `buildUploadSecurityHeaders`, `withSecurityConfig` (the OUTER wrapper: hides `X-Powered-By`, keeps Payload's `Accept-CH` / `Critical-CH` / `Vary` colour-scheme hints on the admin only; `adminClientHints: { route, sources } \| false`), `scopeColorSchemeClientHints`, `adminClientHintSources`, `COLOR_SCHEME_CLIENT_HINT` | storage.md, security.md | | `next.config` | `buildImagesConfig`, `buildSecurityHeaders` (`csp`), `buildCsp`, `buildCspHeaders`, `buildAdminCsp` / `buildAdminCspHeaders`, `buildUploadSecurityHeaders`, `withSecurityConfig` (the OUTER wrapper: hides `X-Powered-By`, keeps Payload's `Accept-CH` / `Critical-CH` / `Vary` colour-scheme hints on the admin only; `adminClientHints: { route, sources } \| false`), `scopeColorSchemeClientHints`, `adminClientHintSources`, `COLOR_SCHEME_CLIENT_HINT` | storage.md, security.md |
| CSP reports, nonces | `createCspReportRoute` (`parseCspReports`, type `CspViolation`), `createProxy({ csp })` + `<SiteProviders nonce>` (dynamic pages only), `createCspNonce`, `CSP_NONCE_HEADER`, `buildReportingEndpoints`, `cspHeaderKey`, `DEFAULT_CSP_REPORT_GROUP`; types `BuildAdminCspArgs`, `CspDirective`, `CspSources`, `CreateCspReportRouteArgs`, `WithSecurityConfigOptions` | security.md | | CSP reports, nonces | `createCspReportRoute` (`parseCspReports`, `cspLogLine`, `CSP_LOG_VALUE_MAX`, type `CspViolation`), `createProxy({ csp })` + `<SiteProviders nonce>` (dynamic pages only), `createCspNonce`, `CSP_NONCE_HEADER`, `buildReportingEndpoints`, `cspHeaderKey`, `DEFAULT_CSP_REPORT_GROUP`; types `BuildAdminCspArgs`, `CspDirective`, `CspSources`, `CreateCspReportRouteArgs`, `WithSecurityConfigOptions` | security.md |
| Fluid typography and spacing | `fluid.css` / `fluid-wide.css` (`--ipal-*` variables); your own sizes: `fluidClamp`, `FLUID_SCALE`, `FLUID_RANGES` | design-tokens.md | | Fluid typography and spacing | `fluid.css` / `fluid-wide.css` (`--ipal-*` variables); your own sizes: `fluidClamp`, `FLUID_SCALE`, `FLUID_RANGES` | design-tokens.md |
| Brand colours, fonts, radii, motion, dark mode | `tokens.css` + `tailwind.css`, `src/design/tokens.ts` (`defineTokens`, types `TokensInput`, `ColorInput`, `ColorRole`), `pnpm exec iapl-tokens` (`--check`, `--report`, `--warn-only`); building blocks `tokensToCss`, `defaultTokensCss`, `contrastReport` (`ContrastRow`), `contrastRatio`, `parseColor`, `resolveColors`, `IAPL_TOKENS`, `iaplVar`, `IaplTokenName`, `IAPL_BREAKPOINTS`, `COLOR_DEFAULTS`, `STATIC_DEFAULTS`, `FLUID_TOKENS`, `INVERSE_SCOPE`, `LEGACY_DARK_ROLES`, `LIGHT_SELECTOR`, `DARK_SELECTOR`, `INVERSE_SELECTOR`, `RemValue`, `FluidRange` | design-tokens.md | | Brand colours, fonts, radii, motion, dark mode | `tokens.css` + `tailwind.css`, `src/design/tokens.ts` (`defineTokens`, types `TokensInput`, `ColorInput`, `ColorRole`), `pnpm exec iapl-tokens` (`--check`, `--report`, `--warn-only`); building blocks `tokensToCss`, `defaultTokensCss`, `contrastReport` (`ContrastRow`), `contrastRatio`, `parseColor`, `resolveColors`, `IAPL_TOKENS`, `iaplVar`, `IaplTokenName`, `IAPL_BREAKPOINTS`, `COLOR_DEFAULTS`, `STATIC_DEFAULTS`, `FLUID_TOKENS`, `INVERSE_SCOPE`, `LEGACY_DARK_ROLES`, `LIGHT_SELECTOR`, `DARK_SELECTOR`, `INVERSE_SELECTOR`, `RemValue`, `FluidRange` | design-tokens.md |
| Accessibility widget CSS | `@intecion/ipal-kit/a11y.css` (works through the tokens) | accessibility.md | | Accessibility widget CSS | `@intecion/ipal-kit/a11y.css` (works through the tokens) | accessibility.md |
@@ -1161,6 +1204,7 @@ project → **plugin gap**, not a copy.
|---|---|---| |---|---|---|
| Banner, settings, cookie button | `<SiteProviders banner={<CookieBanner …/>}>`, `CookieButton`, `useConsent` | consent.md | | Banner, settings, cookie button | `<SiteProviders banner={<CookieBanner …/>}>`, `CookieButton`, `useConsent` | consent.md |
| Compliance defaults (1.17.0): Global Privacy Control honoured (no banner, no tracker request, opt-in from the cookie button wins), "Reject" like "Accept all", consent log on, withdrawal tells Meta / TikTok / Clarity and clears listed storage keys | built in; opt-outs: `SiteProviders gpc="ask"` / `gpc={false}`, `CookieBanner equalChoice={false}`, `iapl({ consentLog: false })` / `logEndpoint={false}`, `maxAgeDays` (re-ask, default 180); building blocks `resolveConsent`, `gpcFromHeaders`, `gpcFromNavigator`, `GPC_CATEGORIES`, `GPC_HEADER`, `CONSENT_LOG_PATH`, `gpcWellKnown` (`/.well-known/gpc.json`), `readEffectiveConsent`, `signalVendors`, `clarityConsent` (`/client`). Check: `iapl-consent-check` (5 runs incl. GPC, equal prominence, withdrawal), `iapl-doctor` (`consent-banner`, `consent-log-migration`) | consent.md → "Compliance defaults", consent-behaviour-spec.md | | Compliance defaults (1.17.0): Global Privacy Control honoured (no banner, no tracker request, opt-in from the cookie button wins), "Reject" like "Accept all", consent log on, withdrawal tells Meta / TikTok / Clarity and clears listed storage keys | built in; opt-outs: `SiteProviders gpc="ask"` / `gpc={false}`, `CookieBanner equalChoice={false}`, `iapl({ consentLog: false })` / `logEndpoint={false}`, `maxAgeDays` (re-ask, default 180); building blocks `resolveConsent`, `gpcFromHeaders`, `gpcFromNavigator`, `GPC_CATEGORIES`, `GPC_HEADER`, `CONSENT_LOG_PATH`, `gpcWellKnown` (`/.well-known/gpc.json`), `readEffectiveConsent`, `signalVendors`, `clarityConsent` (`/client`). Check: `iapl-consent-check` (5 runs incl. GPC, equal prominence, withdrawal), `iapl-doctor` (`consent-banner`, `consent-log-migration`) | consent.md → "Compliance defaults", consent-behaviour-spec.md |
| Cookie button placement | built in: bottom corner of the window on every page, never moves, never in or above the footer; the footer gets room under its last row while the button is shown, so nothing is covered at the page end. `CookieButton side` / `reserve` (`false` = no room) / `avoid` (`avoid={COOKIE_BUTTON_AVOID}` = above the footer, as before 1.18.0), tokens `--ipal-cookie-button-offset` / `-inset`, amount by hand `--ipal-cookie-button-space` on the footer. Do not render the button inside the footer, write a scroll handler for it, or add bottom padding for it by hand | consent.md → "Where the cookie button sits" |
| Banner at first paint (not after hydration; LCP) | built in: `CookieBanner firstPaint` (default on), `SiteProviders nonce` under a nonce CSP; off: `firstPaint={false}`; server-exact HTML on a dynamic site: `SiteProviders consentCookie` / `ConsentProvider cookieValue`; your own banner: `consentBannerScript`. Check: `curl -s <page> \| grep -c 'data-ipal="banner-script"'` → 1 and the response still has `s-maxage` | consent.md → "First paint" | | Banner at first paint (not after hydration; LCP) | built in: `CookieBanner firstPaint` (default on), `SiteProviders nonce` under a nonce CSP; off: `firstPaint={false}`; server-exact HTML on a dynamic site: `SiteProviders consentCookie` / `ConsentProvider cookieValue`; your own banner: `consentBannerScript`. Check: `curl -s <page> \| grep -c 'data-ipal="banner-script"'` → 1 and the response still has `s-maxage` | consent.md → "First paint" |
| Settings window: in the bar / small / large with cookie details | `<CookieBanner settings="inline" \| "modal" \| "detailed">` — do not build your own window or cookie list | consent.md → "Large window with details" | | Settings window: in the bar / small / large with cookie details | `<CookieBanner settings="inline" \| "modal" \| "detailed">` — do not build your own window or cookie list | consent.md → "Large window with details" |
| A consent-dependent script | `ConsentScript` | consent.md | | A consent-dependent script | `ConsentScript` | consent.md |
@@ -1171,6 +1215,7 @@ project → **plugin gap**, not a copy.
| Mail | `email: mailAdapter()` + `serverURL` — mail works with no other setup, through the Intecion mail service; SMTP in the panel only when the client asks; your own mail: `payload.sendEmail` (`withMailKind` when it is account mail); never a second transport in the project. §7.2 | email.md | | Mail | `email: mailAdapter()` + `serverURL` — mail works with no other setup, through the Intecion mail service; SMTP in the panel only when the client asks; your own mail: `payload.sendEmail` (`withMailKind` when it is account mail); never a second transport in the project. §7.2 | email.md |
| Env validation, health | `assertEnv(iaplEnvRules({…}))` (`/env`), `healthRoute` | env.md | | Env validation, health | `assertEnv(iaplEnvRules({…}))` (`/env`), `healthRoute` | env.md |
| 2FA, white-label, headers | `twoFactor: { issuer, plugin: payloadTotp }`, `whiteLabel`, `buildSecurityHeaders` | security.md, white-label.md | | 2FA, white-label, headers | `twoFactor: { issuer, plugin: payloadTotp }`, `whiteLabel`, `buildSecurityHeaders` | security.md, white-label.md |
| Sign-in screens (login, forgot / reset password, first user, logout, the 2FA screens): a dark panel with the client's logo or the site's name beside the form, language links, both themes, phone | on with `whiteLabel` (`signIn`); a NEW site: `whiteLabel: { signIn: { allScreens: true } }` + `pnpm payload generate:importmap` (adds the provider `SignInLook`; without it only login and the 2FA screens get the look, through `AdminLogo` / `SafeTotpView`). Logo and name come from Site settings (no env var, no new field, no migration). The logo is whatever Site settings → Logo holds, an SVG too, as `<img>` — the same as on the login screen before (`svgLogo: false` refuses SVG); a file that is gone gives the name instead of a broken picture (`checkLogo`); no plate (`logoPlate: true` for a logo with dark letters). Options: `accent` (hex), `languages: false`; `signIn: false` = Payload's screens. Name / logo / icon are admin-only with the look (`brandAccess: 'editor'` = as before). Never build a login page, a custom `graphics.Logo` or login CSS by hand. Check: `curl -s $URL/admin/login \| grep -c iapl-signin__label` ≥ 1; `curl -si "$URL/api/ipal/admin-language?lng=xx"` → 400 | white-label.md → "The sign-in screens" |
| Panel link preview + noindex (site name, description, preview image, technology support credit) | on by default (`adminMeta`, `agency`) — do not hand-write `admin.meta` for it; override single keys in `admin.meta` or `adminMeta: { … }` | white-label.md | | Panel link preview + noindex (site name, description, preview image, technology support credit) | on by default (`adminMeta`, `agency`) — do not hand-write `admin.meta` for it; override single keys in `admin.meta` or `adminMeta: { … }` | white-label.md |
| Rate limit (forms, MCP, search) | built in; IP from `IAPL_IP_HEADER`; several instances → `setRateLimitStore` | forms.md | | Rate limit (forms, MCP, search) | built in; IP from `IAPL_IP_HEADER`; several instances → `setRateLimitStore` | forms.md |
@@ -1211,6 +1256,15 @@ add missing hosts with flags / `extra`; (3) change `mode` to `'enforce'` in both
| Text written in one language fills the empty languages (cookie list, cookie review), never over a language's own text | `fillEmptyLocales: false` | `fillEmptyLocales: { 'cookie-settings': [...], 'cookie-review': [...] }`; `buildFillEmptyLocalesGlobalHook` / `…CollectionHook` for your own globals and collections | | Text written in one language fills the empty languages (cookie list, cookie review), never over a language's own text | `fillEmptyLocales: false` | `fillEmptyLocales: { 'cookie-settings': [...], 'cookie-review': [...] }`; `buildFillEmptyLocalesGlobalHook` / `…CollectionHook` for your own globals and collections |
| Cookie approval: one summary + **Approve and add** (editor+), unknown cookies approved as `marketing` + "Needs description", dashboard reminder while cookies wait; nothing reaches the cookie banner before approval | `cookieScanner.approval: false` (per-entry review) | `approval.unknownCategory`, `approval.dashboard: false`; building blocks `approveCookies`, `loadCookieApproval`, `countPendingCookies`, `flagGoneEntries`, `sameCookie` | | Cookie approval: one summary + **Approve and add** (editor+), unknown cookies approved as `marketing` + "Needs description", dashboard reminder while cookies wait; nothing reaches the cookie banner before approval | `cookieScanner.approval: false` (per-entry review) | `approval.unknownCategory`, `approval.dashboard: false`; building blocks `approveCookies`, `loadCookieApproval`, `countPendingCookies`, `flagGoneEntries`, `sameCookie` |
| Cookie review: scan + review editor+, delete admin; Open Cookie Database "Functional" → `functional` | omit `cookieScanner` | `cookieScanner.access`, `collectionOverrides`, `databaseCategories`, `integrations`, `declarations`, `labels`, `syncAccepted: false`; building blocks `runCookieScan`, `collectCookieFindings`, `applyCookieFindings` | | Cookie review: scan + review editor+, delete admin; Open Cookie Database "Functional" → `functional` | omit `cookieScanner` | `cookieScanner.access`, `collectionOverrides`, `databaseCategories`, `integrations`, `declarations`, `labels`, `syncAccepted: false`; building blocks `runCookieScan`, `collectCookieFindings`, `applyCookieFindings` |
| Plugin switches read strictly (1.17.1): a nonsense value (`accounts: 0`, `stats: 'false'`, `consentLog: { retentionDays: null }`, `dashboardAlerts.integrations: 'Admin'`, a 0 window in `mail.relay`, `storageNames: 'IAPL'`, …) stops the start with the option's name; `buildSecurityHeaders` / `buildCsp` likewise (`extra` values are arrays) | — (pass a real value: `true` / `false`, an object, a number in range) | security.md "Switches are read strictly"; verify: `pnpm build` starts, or the error names the option |
| Request bodies from strangers are read only up to a cap, declared length or not (1.17.1): consent log 4 KiB, page views 4 KiB, mail-service confirm 2 KiB, CSP reports `maxBytes` 16 KiB, MCP `maxBytes` 64 KiB → `413` | — | `createMcpRoute({ maxBytes })`, `createCspReportRoute({ maxBytes })`, `readCappedBody(request, max)` |
| Rich-text links: one rule for every stored URL — `link`, `autolink` (also marked internal) and the Markdown output (`lexicalToMarkdown`) drop `javascript:` / `data:` targets | `safeLinks={false}` (trusted content only) | `sanitizeRichTextLinks`, `safeHref` |
| Locales: no stand-in — `resolveRoute` (page route, `/md/…`, MCP `get_page`) answers `null` for a locale the site does not have (`xx`, `all`); a 404 page that is a draft is not shown (built-in view instead) | — | `isSiteLocale(payload, locale)`; verify: `curl -i <site>/md/xx` → 404 |
| Site integrations versions (when a project turns them on) are read by admins only (`readVersions`) | — | `globalOverrides: { 'site-integrations': { access: { readVersions } } }` |
| Consent version only goes up (1.18.0): a save through access control with a lower Cookies → *Consent version* is refused with a message (old consent would count again); the Local API with `overrideAccess` may still | `iapl({ cookieSettings: { allowLowerPolicyVersion: true } })` | `policyVersionNeverDown`, `buildCookieSettingsFields` (type `CookieSettingsFieldOptions`), `buildCookieSettings(options)`; verify: lower it in the panel → the error under the field |
| Drafts as related documents are left out (1.18.0): a block, menu or System pages link pointing at a page never published no longer brings its title, slug or text into the helpers' answers (`null` alone, removed from a list, `value: null` in a polymorphic one) — pages, Site settings, archive entries, the 404 page, Markdown, MCP, llms-full; a preview keeps them | `createContentHelpers({ draftRelations: 'keep' })`; `draftRelations: 'keep'` on `resolveRoute` / `getArchiveEntries` / `resolveNotFoundPage` / `collectSiteIndex` / `buildLlmsTxt` | `withoutDraftRelations`, `applyDraftRelations`, type `DraftRelations`; content.md "Drafts as related documents"; verify: a menu link to an unpublished page is gone on the site |
| Integration status written alone (1.18.0): `emailStatus` / `turnstileStatus` go through the database adapter on their own, so a visitor's form submit can no longer put back an admin's SMTP or Turnstile change saved at the same moment; the cookie list is checked again right before the scanner writes it (a row an editor saved in between stays) | — | `writeGlobalFields(payload, slug, data)` for your own bookkeeping fields (no hooks, no version); `addToCookieList` |
| Access callbacks (`cookieScanner.access`, the doctor's `access`): **only a literal `true` allows (1.18.0)** — a callback returning `req.user` (an object), `1`, a string or an un-awaited Promise refuses; an answer that is not a boolean is reported once per option in the server log with the fix. **Verify:** a callback returning `req.user` → `403` and one `[iapl] … returned an object` line | `strictAccessAnswers: false` (any truthy answer allows, as before 1.18.0) | return a boolean (`({ req }) => Boolean(req.user)`); `accessAllowed(option, answer, { strict })`, `strictAccessAnswers(req)`, type `AccessAnswerOptions`; security.md "Access callbacks" |
| Consent log on (since 1.17.0; Postgres / SQLite: a migration in the same deploy) | `consentLog: false`; one layout: `logEndpoint={false}` | `consentLog: { retentionDays, collectionOverrides }`; `buildConsentLogCollection` / `buildConsentLogEndpoint`, `CONSENT_LOG_PATH` | | Consent log on (since 1.17.0; Postgres / SQLite: a migration in the same deploy) | `consentLog: false`; one layout: `logEndpoint={false}` | `consentLog: { retentionDays, collectionOverrides }`; `buildConsentLogCollection` / `buildConsentLogEndpoint`, `CONSENT_LOG_PATH` |
| Global Privacy Control honoured: no banner, analytics and marketing off, no Google request also in Consent Mode `advanced`; a grant made without the signal is switched off when it appears | `gpc={false}` (doctor warns) | `gpc="ask"`; `resolveConsent`, `gpcFromHeaders`, `consentBannerScript({ gpc })` | | Global Privacy Control honoured: no banner, analytics and marketing off, no Google request also in Consent Mode `advanced`; a grant made without the signal is switched off when it appears | `gpc={false}` (doctor warns) | `gpc="ask"`; `resolveConsent`, `gpcFromHeaders`, `consentBannerScript({ gpc })` |
| "Reject" styled like "Accept all" (`equalChoice`) | `equalChoice={false}` (doctor warns) | `classNames.rejectButton` | | "Reject" styled like "Accept all" (`equalChoice`) | `equalChoice={false}` (doctor warns) | `classNames.rejectButton` |
@@ -1218,14 +1272,25 @@ add missing hosts with flags / `extra`; (3) change `mode` to `'enforce'` in both
| Injected `users`: admin manages everyone, others only themselves | — | `access.authAccess` (your keys win); your own `users` collection wins whole | | Injected `users`: admin manages everyone, others only themselves | — | `access.authAccess` (your keys win); your own `users` collection wins whole |
| First registered account = admin | `access.firstUserAdmin: false` | `buildRolesField(defaultRole, { firstUserAdmin })` | | First registered account = admin | `access.firstUserAdmin: false` | `buildRolesField(defaultRole, { firstUserAdmin })` |
| 2FA on the panel's login collection, mismatch = startup error; redirect to the 2FA screens by `TotpRedirectProvider` | `twoFactor: false` (discouraged) | `twoFactor.collectionSlug`, `allowCollectionMismatch: true`, `twoFactor.provider` (own component, or `false` for the package's) | | 2FA on the panel's login collection, mismatch = startup error; redirect to the 2FA screens by `TotpRedirectProvider` | `twoFactor: false` (discouraged) | `twoFactor.collectionSlug`, `allowCollectionMismatch: true`, `twoFactor.provider` (own component, or `false` for the package's) |
| 2FA setup required: an account without TOTP reaches only the setup screen; 72 h window from creation / admin reset, then blocked; status and "Reopen setup" on the account page, notice on the dashboard, `POST /api/ipal/two-factor/reset` | `twoFactor.requireSetup: false`; parts: `requireSetup: { dashboardNotice: false, statusField: false, setupNotice: false }` | `requireSetup: { windowHours, exempt }` (`exempt` returns exactly `true`, never `async`), `twoFactor.resetAccess` (default: an admin who entered its own code; the reset ends the account's sessions), texts `twoFactor*`; `twoFactorSetupState(req)`, `buildSetupFields`, `backfillSetupFrom`, `buildTwoFactorResetEndpoint`. **Postgres/SQLite: migration for `totp_setup_from` applied when the new container starts (`prodMigrations` or `pnpm payload migrate && pnpm start`; never a pre-deployment command — deployment.md §4.3), or every login answers 500** | | 2FA setup required: an account without TOTP reaches only the setup screen; 72 h window from creation / admin reset, then blocked; status and "Reopen setup" on the account page, notice on the dashboard, `POST /api/ipal/two-factor/reset` | `twoFactor.requireSetup: false`; parts: `requireSetup: { dashboardNotice: false, statusField: false, setupNotice: false }` | `requireSetup: { windowHours, exempt }` (`exempt` returns exactly `true`, never `async`; decide it from a field only admins write, e.g. a `serviceAccount` checkbox with `adminOnlyField` — never from the e-mail, which every account may change itself; security.md "Decide `exempt` from a field only an administrator can write"), `twoFactor.resetAccess` (default: an admin who entered its own code; the reset ends the account's sessions), texts `twoFactor*`; `twoFactorSetupState(req)`, `buildSetupFields`, `backfillSetupFrom`, `buildTwoFactorResetEndpoint`. **Postgres/SQLite: migration for `totp_setup_from` applied when the new container starts (`prodMigrations` or `pnpm payload migrate && pnpm start`; never a pre-deployment command — deployment.md §4.3), or every login answers 500** |
| The second factor on every collection and global, whichever plugin added it, and on the plugin's endpoints; an unrecognised 2FA package = startup error | per entity: `custom.ipal.secondFactor: false` or `{ read: false }` (or the package's `custom.totp.disableAccessWrapper`); everywhere: `twoFactor.guard: false` (not recommended) | `requireSecondFactor` / `secondFactorPassed` in your own access functions and endpoints | | The second factor on every collection and global, whichever plugin added it, and on the plugin's endpoints; an unrecognised 2FA package = startup error | per entity: `custom.ipal.secondFactor: false` or `{ read: false }` (or the package's `custom.totp.disableAccessWrapper`); everywhere: `twoFactor.guard: false` (not recommended) | `requireSecondFactor` / `secondFactorPassed` in your own access functions and endpoints |
| At most 5 verify attempts per account in 10 minutes (`POST /api/verify-totp` → `429`); the count is kept in memory and in the database (`payload.kv`), so a restart or a second instance does not reset it | `twoFactor.verifyLimit: false` | `verifyLimit: { max, windowMinutes, store: 'memory' }` | | At most 5 **wrong** verify codes per account in 10 minutes (`POST /api/verify-totp` → `429`); a right code gives its place back (1.17.1), so correct logins are never refused; an attempt held out only by others still being checked gets `429` + `Retry-After: 2` ("try again in a moment"); the count is kept in memory and in the database (`payload.kv`), so a restart or a second instance does not reset it. **Verify:** log in correctly 7 times in a row → all in; 5 wrong codes → the next gets `429` with a long `Retry-After` | `twoFactor.verifyLimit: false` | `verifyLimit: { max, windowMinutes, store: 'memory' }`; own wiring: `buildVerifyLimit(...)` + `limit.settle(req, correct)` |
| 2FA verify and setup attempts only from the site's own origin: a request a browser marks as coming from elsewhere (`Origin`, `Sec-Fetch-Site`) gets `403` and is not counted. **Set `serverURL`**: behind a proxy that rewrites `Host` and sends no `X-Forwarded-Host` the site's own page is refused without it (logged once per origin: `[iapl] 2FA: a code from origin … was refused`) | `twoFactor.sameOrigin: false` | `sameOrigin: { origins: ['https://app.example.com'] }`; `requestFromOwnOrigin`, `reportRefusedOrigin` | | The plugin's panel actions (`POST` mail service connect / disconnect, test e-mail, cookie scan / approval / crawl) refuse a request a browser marks as coming from another origin (`403`, before anything is read; 1.18.0). The panel's buttons are not affected; set `serverURL` (doctor `csrf-empty` warns without it). **Verify:** `curl -X POST <site>/api/ipal/test-email -H 'Origin: https://other.example' -H 'Content-Type: text/plain' -b <admin cookies> -d '{}'` → `403` | `adminSameOrigin: false` | `adminSameOrigin: { origins: [...] }`; `requireOwnOrigin(endpoint, origins?)` for your own endpoints |
| Stored secrets are write-only: `smtpPassword` and `turnstileSecretKey` come back as `'********'` over REST, GraphQL and in the panel; an empty save keeps the value, `'[[clear]]'` removes it; server code reads the real value with the Local API. **The panel is the source — never add an env variable for them** (`TURNSTILE_SECRET_KEY` is deprecated) | `secrets: { writeOnly: false }` | `writeOnlySecret(field)` / `writeOnlySecrets(fields, names)` for your own secret fields; with versions on the entity add `hooks.afterRead: [maskSecretsOnRestore]` | | Public lists capped (1.18.0, audit F4): a REST / GraphQL list from a caller that is not staff gets at most 100 documents; `pagination=false` / `limit=0` become one page of 100; staff, the Local API and server reads with `overrideAccess: true` that pass a request on untouched. **Verify:** `curl -s '<site>/api/pages?limit=100000' \| jq .limit` → `100` | `listLimit: false` | `listLimit: { max, staff, exclude }`; `buildQueryGuardHook` for a collection a plugin adds after iapl; `capListLimit` |
| Operator names in `sort` refused (1.18.0, audit F5): `?sort=$where`, `-$natural`, `a.$ne` → `400` for everyone (logged as one `info` line, `RefusedSortError`) instead of a database error. **Verify:** `curl -s -o /dev/null -w '%{http_code}' '<site>/api/pages?sort=%24where'` → `400` | `refuseOperatorSort: false` | `loggingLevels: { RefusedSortError: false }`; `isOperatorSort` |
| Payload's document locks (`payload-locked-documents`) for staff accounts only, with the second factor (1.18.0); Payload's default was any signed-in account, a customer too. **Verify:** a visitor account gets `403` on `/api/payload-locked-documents`; the panel still shows who edits a document | `lockedDocuments: false` | `lockedDocuments: { access: { read, create, update, delete } }`; `staffOnlyLocks`, `applyLockedDocumentsAccess` |
| CSP report log lines normalised (1.18.0, audit F1): origin of the blocked resource, path of the page, no control characters, every value ≤ 128 characters; at most 10 violations per request, 60 requests per client a minute (answer stays `204`) | `rateLimit: false`; your own `onReport` (gets the raw values) | `createCspReportRoute({ maxReports, rateLimit: { max, windowMs }, onReport })`, `cspLogLine` |
| Markdown negotiated at a page URL is `private, no-store` + `Vary: Accept`; HTML keeps Next's own `Vary` and caching (1.18.0, audit F3); `/md/…` stays publicly cacheable | `markdown: { negotiate: false }` (Markdown only at `/md/…`) | `markdown: { prefix }`; `MARKDOWN_NEGOTIATED_HEADER`, `appendVary` for your own proxy |
| 2FA first set-up confirmed by e-mail (1.18.0): the code only starts it; a link to the account's own address, opened in the same browser within 30 min, turns it on and ends the account's sessions; notice mails on every enrolment, change, removal / reset; without working mail the link goes to the server log and an admin confirms on the account page ("Confirm the waiting set-up", `POST /api/iapl/two-factor/confirm-pending`). **Verify:** security.md "Set-up confirmed by e-mail" → Verify; doctor `2fa-enrolment-mail` | `twoFactor.confirmByEmail: false` | `confirmByEmail: { linkMinutes, sameBrowser, adminConfirm, logLinkWhenMailFails, notices, maxMailsPerHour }`; `startEnrolment`, `buildEnrolmentEndpoints`, `buildTotpNoticeHooks`, `sendTwoFactorNotice`, `verifyTotpCode`, `readPendingEnrolment`, `pendingEnrolmentInfo`, `countPendingEnrolments`, `mailConfigured` |
| 2FA verify and setup attempts only from the site's own origin: a request a browser marks as coming from elsewhere (`Origin`, `Sec-Fetch-Site`) gets `403` and is not counted. The admin's reset `POST /api/ipal/two-factor/reset` follows the same rule (1.17.1). **Verify:** `curl -X POST <site>/api/ipal/two-factor/reset -H 'Origin: https://other.example' -H 'Content-Type: text/plain' -b <admin cookies> -d '{"userId":1}'` → `403`; the panel's button still works. **Set `serverURL`**: behind a proxy that rewrites `Host` and sends no `X-Forwarded-Host` the site's own page is refused without it (logged once per origin: `[iapl] 2FA: a code from origin … was refused`) | `twoFactor.sameOrigin: false` | `sameOrigin: { origins: ['https://app.example.com'] }`; `requestFromOwnOrigin`, `reportRefusedOrigin` |
| Stored secrets are write-only: `smtpPassword` and `turnstileSecretKey` come back as `'********'` over REST, GraphQL and in the panel; an empty save keeps the value, `'[[clear]]'` removes it; server code reads the real value with the Local API. A query cannot name a secret (1.17.1): `where` / `sort` on it — REST, GraphQL, versions — is refused (`secretReadAccess`, the field's `read` rule; verify: `GET /api/globals/site-integrations/versions?where[version.smtpPassword][exists]=true` as an admin → 400 `QueryError`, no `totalDocs`). **The panel is the source — never add an env variable for them** (`TURNSTILE_SECRET_KEY` is deprecated) | `secrets: { writeOnly: false }` | `writeOnlySecret(field)` / `writeOnlySecrets(fields, names)` for your own secret fields; with versions on the entity add `hooks.afterRead: [maskSecretsOnRestore]` |
| The SMTP password stays with its server: a save in the panel or over the API that changes the server, port or user name without the password is refused (`400` "Enter the password again…"), whatever the transport says — otherwise an admin session points the server at its own machine and a test e-mail hands the password over. A change of the transport alone asks for nothing. Seeds and scripts (Local API, access control off) are not asked | `secrets: { reenterOnChange: false }` | `writeOnlySecret(field, { boundTo: [...] })`, `buildKeepSecret`, `SMTP_PASSWORD_BOUND_TO` | | The SMTP password stays with its server: a save in the panel or over the API that changes the server, port or user name without the password is refused (`400` "Enter the password again…"), whatever the transport says — otherwise an admin session points the server at its own machine and a test e-mail hands the password over. A change of the transport alone asks for nothing. Seeds and scripts (Local API, access control off) are not asked | `secrets: { reenterOnChange: false }` | `writeOnlySecret(field, { boundTo: [...] })`, `buildKeepSecret`, `SMTP_PASSWORD_BOUND_TO` |
| The admin panel opens for `editor` and above; an account with only `user` sees "Unauthorized" (the API is not touched). First start logs how many accounts are below the role | `accounts: { panelRole: 'user' }` (or `false`) | `panelRole: 'admin'`; your own `access.admin`; `panelAccess(role)` | | The admin panel opens for `editor` and above; an account with only `user` sees "Unauthorized" (the API is not touched). First start logs how many accounts are below the role | `accounts: { panelRole: 'user' }` (or `false`) | `panelRole: 'admin'`; your own `access.admin`; `panelAccess(role)` |
| Nobody creates an account for themselves, or takes one over. A staff collection (also the project's own, also one a later plugin adds) without a `create` / `update` / `delete` / `unlock` / `read` / `readVersions` rule gets one (on a collection a later plugin adds the plugin's rule is put in front of its own and both must allow; `custom: { ipal: { accountRules: false } }` on it keeps its own): with the plugin's roles, or wherever an account of it can hold `editor` or `admin` (`user, editor, admin, boss`; `viewer, editor`; a `roles` field that is text, json or a relationship holding a list — the value in the account's `roles` array makes a plugin admin or editor; a single-valued `roles` field is not affected: its value never counts) — create, delete, unlock: an admin; update: an admin or the account itself; the `roles` field: only an admin. With roles of its own that hold neither `editor` nor `admin`, or none: an account of that same collection, or a plugin admin, and an account never changes its own roles — **the plugin cannot rank a project's own roles: write that collection's rules** (`iapl-doctor` → `staff-own-roles`). `read`: a staff account. Payload's first-user route answers only for the panel's login collection (the first account, which becomes admin), in any spelling of the URL. `access.firstUserAdmin: false` with a default role below the panel role: the default panel role is not applied (logged), an explicit one is refused at start. With a slug in `access.staffCollections` that is not an auth collection Payload does not start (`/api/health` 503) | `accounts: { adminOnlyCreate: false, adminOnlyWrite: false, staffOnlyRead: false, firstUserRoute: 'all' }` | your own rule wins; `firstUserRoute: ['users', 'partners']`; a collection with open sign-up keeps its routes; `staffCreateAccess`, `staffUpdateAccess(slug)`, `staffReadAccess`, `sameStaffCollectionAccess(slug)`, `rolesByAdminOnly`, `rolesNotOwn(slug)`, `hasPluginRoles`, `applyStaffAccountAccess`, `adoptLateAuthCollections`, `buildFirstUserEndpoint` | | Nobody creates an account for themselves, or takes one over. A staff collection (also the project's own, also one a later plugin adds) without a `create` / `update` / `delete` / `unlock` / `read` / `readVersions` rule gets one (on a collection a later plugin adds the plugin's rule is put in front of its own and both must allow; `custom: { ipal: { accountRules: false } }` on it keeps its own): with the plugin's roles, or wherever an account of it can hold `editor` or `admin` (`user, editor, admin, boss`; `viewer, editor`; a `roles` field that is text, json or a relationship holding a list — the value in the account's `roles` array makes a plugin admin or editor; a single-valued `roles` field is not affected: its value never counts) — create, delete, unlock: an admin; update: an admin or the account itself; the `roles` field: only an admin. With roles of its own that hold neither `editor` nor `admin`, or none: an account of that same collection, or a plugin admin, and an account never changes its own roles — **the plugin cannot rank a project's own roles: write that collection's rules** (`iapl-doctor` → `staff-own-roles`). `read`: a staff account. Payload's first-user route answers only for the panel's login collection (the first account, which becomes admin), in any spelling of the URL. `access.firstUserAdmin: false` with a default role below the panel role: the default panel role is not applied (logged), an explicit one is refused at start. With a slug in `access.staffCollections` that is not an auth collection Payload does not start (`/api/health` 503) | `accounts: { adminOnlyCreate: false, adminOnlyWrite: false, staffOnlyRead: false, firstUserRoute: 'all' }` | your own rule wins; `firstUserRoute: ['users', 'partners']`; a collection with open sign-up keeps its routes; `staffCreateAccess`, `staffUpdateAccess(slug)`, `staffReadAccess`, `sameStaffCollectionAccess(slug)`, `rolesByAdminOnly`, `rolesNotOwn(slug)`, `hasPluginRoles`, `applyStaffAccountAccess`, `adoptLateAuthCollections`, `buildFirstUserEndpoint` |
| A locked staff account (Payload's `maxLoginAttempts`) answers its login exactly like a wrong password — REST body and status, GraphQL `extensions.name: AuthenticationError`, the panel's sign-in (1.18.0); visitor collections keep Payload's answer. **Verify:** 5 wrong passwords for an admin, then the right one → the same `401` body as for an unknown address | `accounts: { lockedAnswer: 'payload' }` | `lockedLooksWrong`, `withLockedAnswer(config)`, `graphqlLoginName` |
| Failed staff sign-ins counted per client IP and typed address (folded: case, width, NFKC): 5 in 15 min, then `429` for that IP and address; only failures count; Payload's per-account lock raised to 50 failures / 1 hour where the project did not set `maxLoginAttempts` / `lockTime` (1.18.0). Pin `IAPL_IP_HEADER`. **Verify:** 5 wrong passwords with `X-Forwarded-For: 198.51.100.1`, then the right one from there → `429`, from another address → `200` | `accounts: { signInLimit: false }` | `signInLimit: { perAddress, windowMinutes, accountLock: { maxLoginAttempts, lockTime } \| false }`; `applySignInRules`, `releaseRateLimit` |
| Staff login, forgot password and reset password refuse a request a browser marks as coming from another origin (`403`, REST and GraphQL; 1.18.0); visitor collections untouched. **Verify:** `curl -X POST <site>/api/users/login -H 'Origin: https://other.example' …` → `403` | `accounts: { signInSameOrigin: false }` | `signInSameOrigin: { origins: [...] }` |
| Changing one's OWN e-mail, username or password needs the current password: panel field "Current password" on the account page (`MaskedField`, no import-map change), `currentPassword` over REST / GraphQL; admins changing others, server code and API keys are not asked; wrong ones count like failed sign-ins (1.18.0). **Verify:** `PATCH /api/users/<own id> {"email":"…"}` → `400`, with `"currentPassword"` → `200` | `accounts: { confirmOwnChanges: false }` | `buildCurrentPasswordField`, `passwordMatches`, `CURRENT_PASSWORD_FIELD` (access.md) |
| A password set on a staff account has at least 12 characters and is not the e-mail address; existing passwords are not checked | `accounts: { password: false }` | `password: { minLength }`; `checkPassword`, `buildPasswordRuleHook` | | A password set on a staff account has at least 12 characters and is not the e-mail address; existing passwords are not checked | `accounts: { password: false }` | `password: { minLength }`; `checkPassword`, `buildPasswordRuleHook` |
| While Turnstile cannot check (wrong secret, Cloudflare down): a text form is accepted, a form with files is refused | `forms: { turnstileOnConfigError: 'allow' }` | `'reject'`, `{ text, files }`; `turnstileOnConfigError` at a call site wins | | While Turnstile cannot check (wrong secret, Cloudflare down): a text form is accepted, a form with files is refused | `forms: { turnstileOnConfigError: 'allow' }` | `'reject'`, `{ text, files }`; `turnstileOnConfigError` at a call site wins |
| Dashboard alerts by role: integration details for admins, a neutral line for editors, nothing for others; cookie alerts for editors and above. `'all'` checks nothing — no role, no second factor | `dashboardAlerts: { integrations: 'all', cookies: 'all' }` | `integrations: 'editor'`; the components' `details` / `audience` props | | Dashboard alerts by role: integration details for admins, a neutral line for editors, nothing for others; cookie alerts for editors and above. `'all'` checks nothing — no role, no second factor | `dashboardAlerts: { integrations: 'all', cookies: 'all' }` | `integrations: 'editor'`; the components' `details` / `audience` props |
@@ -1234,12 +1299,13 @@ add missing hosts with flags / `extra`; (3) change `mode` to `'enforce'` in both
| Roles count only for accounts of a staff collection, in every predicate and access function | — | `access.staffCollections` | | Roles count only for accounts of a staff collection, in every predicate and access function | — | `access.staffCollections` |
| `enabled: false` keeps the schema | — | — (no endpoints, `onInit` or admin components; no DROP TABLE in `migrate:create`) | | `enabled: false` keeps the schema | — | — (no endpoints, `onInit` or admin components; no DROP TABLE in `migrate:create`) |
| No client IP = one shared `unknown-ip` bucket at 20× the limit | `setUnknownIpFactor(0)` (only with a limiter in front) | `setUnknownIpFactor(n)`; `UNKNOWN_IP_FACTOR` | | No client IP = one shared `unknown-ip` bucket at 20× the limit | `setUnknownIpFactor(0)` (only with a limiter in front) | `setUnknownIpFactor(n)`; `UNKNOWN_IP_FACTOR` |
| IPv6 counted per /64 in every plugin limiter (1.18.0): one /64 = one client, `::ffff:a.b.c.d` = its IPv4; no /48 counter by default. **Verify:** 50 requests with `X-Real-IP: 2001:db8:1:1::<n>` → `429` after the limit | `setIpv6Grouping({ prefix: 128 })` (per address, as before) | `setIpv6Grouping({ prefix, wide: 48, wideFactor })`; `ipRateKey(ip)` for your own limiter (forms.md "IPv6 is counted per network") |
| Turnstile token domain not checked | (default) | `createSubmitAction({ turnstileHostnames })`, `verifyTurnstile({ hostnames })` — leave empty in dev | | Turnstile token domain not checked | (default) | `createSubmitAction({ turnstileHostnames })`, `verifyTurnstile({ hostnames })` — leave empty in dev |
| Consent Mode `advanced` | `consentMode: 'basic'` | your own `<Analytics>` props (`SiteProviders analytics={false}`) | | Consent Mode `advanced` | `consentMode: 'basic'` | your own `<Analytics>` props (`SiteProviders analytics={false}`) |
| Locale cookie: consent read under its own stored version | — | `createProxy(config, { policyVersion })` / `createLocaleMiddleware({ policyVersion })` | | Locale cookie: consent read under its own stored version | — | `createProxy(config, { policyVersion })` / `createLocaleMiddleware({ policyVersion })` |
| No `X-Powered-By` (with `withSecurityConfig`) | `withSecurityConfig(config, { hidePoweredBy: false })` | — | | No `X-Powered-By` (with `withSecurityConfig`) | `withSecurityConfig(config, { hidePoweredBy: false })` | — |
| Payload's colour-scheme client hints only on `/admin/:path*` (with `withSecurityConfig` outside `withPayload`) | `withSecurityConfig(config, { adminClientHints: false })` | `{ adminClientHints: { route, sources } }`, `scopeColorSchemeClientHints(rules, sources)` | | Payload's colour-scheme client hints only on `/admin/:path*` (with `withSecurityConfig` outside `withPayload`) | `withSecurityConfig(config, { adminClientHints: false })` | `{ adminClientHints: { route, sources } }`, `scopeColorSchemeClientHints(rules, sources)` |
| CSP off until `buildSecurityHeaders({ csp })`; then hard rules, `'unsafe-eval'` only in dev | leave out `csp` | `buildCsp({ extra, override, strictDynamic, dev })`, `buildAdminCsp({ extra, override })`, `createCspReportRoute({ onReport, maxBytes })`, your own string via `additional` | | CSP off until `buildSecurityHeaders({ csp })`; then hard rules, `'unsafe-eval'` only in dev | leave out `csp` | `buildCsp({ extra, override, strictDynamic, dev })`, `buildAdminCsp({ extra, override })`, `createCspReportRoute({ onReport, maxBytes, maxReports, rateLimit })`, your own string via `additional` |
| Construction mode hides pages in Markdown, MCP | `markdown: { isPathVisible: () => true }`, `mcp: { isPathVisible: () => true }` | `isPathVisible`, `isPathVisibleIn(mode, path)`, `pathOf(url)`, type `PathVisibility` | | Construction mode hides pages in Markdown, MCP | `markdown: { isPathVisible: () => true }`, `mcp: { isPathVisible: () => true }` | `isPathVisible`, `isPathVisibleIn(mode, path)`, `pathOf(url)`, type `PathVisibility` |
| Construction mode filters the sitemap and llms.txt | `underConstructionSeo: false` | `include` / `getIncludedPaths` in the low-level builders | | Construction mode filters the sitemap and llms.txt | `underConstructionSeo: false` | `include` / `getIncludedPaths` in the low-level builders |
| `getSettings` at `depth: 1` | — | `createContentHelpers({ settingsDepth: 2 })` (every request pays) | | `getSettings` at `depth: 1` | — | `createContentHelpers({ settingsDepth: 2 })` (every request pays) |
@@ -1251,7 +1317,7 @@ add missing hosts with flags / `extra`; (3) change `mode` to `'enforce'` in both
| Sitemap split / CDN cache / memo | `sitemapOptions: { maxUrls: Infinity, cacheControl: false, memoSeconds: 0 }` | `sitemapEntries`, `createSitemapRouteHandler`, `buildSitemapIndexXml`, `buildSitemapEntries` | | Sitemap split / CDN cache / memo | `sitemapOptions: { maxUrls: Infinity, cacheControl: false, memoSeconds: 0 }` | `sitemapEntries`, `createSitemapRouteHandler`, `buildSitemapIndexXml`, `buildSitemapEntries` |
| Sitemap error = 503 + `Retry-After` | — (correct HTTP behaviour) | your own route with `buildSitemapXml` | | Sitemap error = 503 + `Retry-After` | — (correct HTTP behaviour) | your own route with `buildSitemapXml` |
| IndexNow silent with `IAPL_NOINDEX` | `indexNow` off by default | `submitToIndexNow` by hand | | IndexNow silent with `IAPL_NOINDEX` | `indexNow` off by default | `submitToIndexNow` by hand |
| A site with no SMTP server in the panel sends through the Intecion mail service: it enrols by itself on its first send (an outbound call with its host and the plugin version) and gets its own token through the public route `POST /api/iapl/mail-relay/confirm` | `mail: { relay: false }` (no call, no routes, no state block) | `mail.relay: { url, host, enrol, token, senderName, kind, accountMail, confirmRateLimit, timeoutMs, retryBackoffMs, fetchImpl }`; `mailAdapter({ relay })`; §7.2 | | A site sends through the Intecion mail service unless an admin chose another "Sending method" (SMTP, Graph): it enrols by itself on its first send (an outbound call with its host and the plugin version) and gets its own token through the public route `POST /api/iapl/mail-relay/confirm` | `mail: { relay: false }` (no call, no routes, no state block) | `mail.relay: { url, host, enrol, token, senderName, kind, accountMail, confirmRateLimit, timeoutMs, retryBackoffMs, fetchImpl }`; `mailAdapter({ relay })`; §7.2 |
| The mail service's token is kept in `payload.kv` (never in a field, never readable over REST or GraphQL), bound to the site's server addresses, rotated every 90 days | "Disconnect" in the panel; `disconnectRelay` | `enrolRelay`, `rotateRelayToken`, `setRelayToken`, `getRelayStatus` | | The mail service's token is kept in `payload.kv` (never in a field, never readable over REST or GraphQL), bound to the site's server addresses, rotated every 90 days | "Disconnect" in the panel; `disconnectRelay` | `enrolRelay`, `rotateRelayToken`, `setRelayToken`, `getRelayStatus` |
| Account e-mails through the mail service: at most 5 to one address and 10 asked for by one visitor an hour | `mail: { relay: { accountMail: false } }` | `accountMail: { perAddress, perVisitor, windowMinutes }` | | Account e-mails through the mail service: at most 5 to one address and 10 asked for by one visitor an hour | `mail: { relay: { accountMail: false } }` | `accountMail: { perAddress, perVisitor, windowMinutes }` |
| Every message says what it is (form notification, form confirmation, account, test, system) | — (other transports ignore the mark) | `withMailKind`, `runWithMailKind`, `expectMailTo`, `mail.relay.kind`, `buildFormMailKindHook` | | Every message says what it is (form notification, form confirmation, account, test, system) | — (other transports ignore the mark) | `withMailKind`, `runWithMailKind`, `expectMailTo`, `mail.relay.kind`, `buildFormMailKindHook` |
@@ -1283,9 +1349,25 @@ No env variable, no key, no field to fill in, no import-map change (the tab's st
banner that is already in every import map). **Do not** add `nodemailer`, `resend`, an `api/send` route or a banner that is already in every import map). **Do not** add `nodemailer`, `resend`, an `api/send` route or a
`GRAPH_*` variable to a project. `GRAPH_*` variable to a project.
**How a send is routed** (`resolveMailTransport`, type `MailTransport`): Microsoft Graph when the panel says so and **How a send is routed** — by the admin's choice, Site integrations → E-mail sending → **"Sending method"**: "IWSN
`GRAPH_*` is set (deprecated) → SMTP when server, user name and password are filled in → Graph when `GRAPH_*` is set → (built-in)" (the mail service), "Own SMTP server", "Microsoft Graph (deprecated)". What is chosen is what is used;
the mail service → nothing (`mail: { relay: false }` and no SMTP). A site with SMTP filled in never contacts the service. a choice that cannot be used (SMTP incomplete, Graph without `GRAPH_*`) **fails loudly and nothing is sent another
way** (state block, status `smtp-incomplete` / `graph-not-set-up`, doctor `mail-method`). The choice is the stored field
`emailMethod` (`relay` / `smtp` / `graph`; empty until somebody chooses) — **MongoDB: nothing to run; Postgres / SQLite:
one migration** (`pnpm payload migrate:create`, applied at container start); before it runs the site keeps sending the
old way, the Site integrations page does not open, and `iapl-doctor --deep` reports `mail-method` (error). Until somebody chooses (an upgraded site, a new site) the order of 1.17.0 applies and the field shows
its result as selected (`resolveMailTransport`, type `MailTransport`): Graph when `emailTransport` is `graph` and
`GRAPH_*` is set → SMTP when server, user name and password are filled in → Graph when `GRAPH_*` is set → the mail
service → nothing. Saving with the method shown stores no choice: only picking another option does (the owner's
rule: nothing changes until somebody picks another option); `setMailMethod` fixes it from code. The state block warns
while an unusable option is picked, before the save. From code: `getMailMethod`,
`setMailMethod(payload, 'relay' | 'smtp' | 'graph' | null)`, `resolveMailMethod` (`ResolvedMailMethod`,
`MailMethodProblem`), `MailMethod`, `MAIL_METHODS`, `isMailMethod`, `readMailSettings` / `STORED_MAIL_METHOD_CONTEXT`
(a read with the value as stored — an ordinary read shows the method in effect), `mailMethodColumnMissing`; or
`updateGlobal` with `emailMethod`. Seeds that
set up mail write `emailMethod`, not `emailTransport`. **Verify:** the state block names the method; **Send test
e-mail** answers "through IWSN" / "through your SMTP server" / "through Microsoft Graph"; `iapl-doctor --deep`
reports `mail-method` info (nothing picked yet) or nothing (picked and usable). `mail: { relay: false }` removes the option "IWSN".
**What the site needs for the mail service** — check each one: **What the site needs for the mail service** — check each one:
@@ -1296,8 +1378,12 @@ the mail service → nothing (`mail: { relay: false }` and no SMTP). A site with
3. The server may call `https://webservices.intecion.net`. 3. The server may call `https://webservices.intecion.net`.
4. Site integrations → E-mail sending: "Sender name" (else the site name is used) and **"Sender address"** — with 4. Site integrations → E-mail sending: "Sender name" (else the site name is used) and **"Sender address"** — with
the mail service that is where replies go; the service's own address has no mailbox. the mail service that is where replies go; the service's own address has no mailbox.
5. Nothing to arrange with Intecion: a site that passes the call-back is active at once (`relay-pending`, held for 5. **A person of Intecion connects the site** (contract 1.8.0): after its first e-mail (or the button) the site waits
approval, is the exception — the panel says so). (`relay-pending`). Site integrations → E-mail sending → **"Połącz z IWSN"** opens the service's confirmation page in a
new tab; a person of Intecion signs in with an `@intecion.com` address and presses "Potwierdź"; the block shows
"Connected to IWSN" by itself (it asks every 5 s for 10 min, and on every load while the site waits). Tell the owner
that step is theirs. Nothing to paste, no token. Opt-out: `mail: { relay: { connectButton: false } }` (no button, no
route). **Verify:** `iapl-doctor --deep` has no `mail-relay-connect` error; a test e-mail answers "through IWSN".
6. **Launch needs nobody:** a site enrolled on its development address and then served on the real domain (or moved 6. **Launch needs nobody:** a site enrolled on its development address and then served on the real domain (or moved
to another domain) enrols by itself on its first e-mail. **A non-public copy does not send by itself:** a site to another domain) enrols by itself on its first e-mail. **A non-public copy does not send by itself:** a site
whose host matches `iapl({ developmentHosts })` — default `['*.dev.netscale.pl']`, Intecion's development whose host matches `iapl({ developmentHosts })` — default `['*.dev.netscale.pl']`, Intecion's development
@@ -1318,8 +1404,8 @@ the mail service → nothing (`mail: { relay: false }` and no SMTP). A site with
--deep --url <site>` reports no `mail-*` finding. On `localhost` the plugin refuses to enrol (nothing leaves the machine): test --deep --url <site>` reports no `mail-*` finding. On `localhost` the plugin refuses to enrol (nothing leaves the machine): test
mail locally with SMTP (Mailpit) or `createFakeRelay()`. mail locally with SMTP (Mailpit) or `createFakeRelay()`.
**The client wants its own mail server:** fill in "Own SMTP server", user name, password and "Sender address" in the **The client wants its own mail server:** "Sending method" → "Own SMTP server", fill in server, user name, password
panel, send a test. Nothing in code. **A site on `GRAPH_*`:** keeps working, warns once per start; move it when the and "Sender address", save, send a test. Nothing in code. **A site on `GRAPH_*`:** keeps working, warns once per start; move it when the
owner says so (email.md "Moving off Microsoft Graph"). owner says so (email.md "Moving off Microsoft Graph").
**Your own mail** goes through `payload.sendEmail`. Say what it is when it is not a generic system message: **Your own mail** goes through `payload.sendEmail`. Say what it is when it is not a generic system message:
@@ -1347,6 +1433,7 @@ overrides per adapter; `resolveRelayOptions` reads what is in effect):
| `otherHosts` | `'auto'` | a database holding another host's connection: a public site enrols by itself (launch, a move), a non-public one (`IAPL_NOINDEX=1` / `developmentHosts`) neither enrols nor sends until "Connect again"; a list of the site's own other hosts; `'wait'` (a public site without a connection waits too); `'enrol'` (no rule) | | `otherHosts` | `'auto'` | a database holding another host's connection: a public site enrols by itself (launch, a move), a non-public one (`IAPL_NOINDEX=1` / `developmentHosts`) neither enrols nor sends until "Connect again"; a list of the site's own other hosts; `'wait'` (a public site without a connection waits too); `'enrol'` (no rule) |
| `developmentHosts` | `iapl({ developmentHosts })`, default `DEFAULT_DEVELOPMENT_HOSTS` = `['*.dev.netscale.pl']` (`pluginDevelopmentHosts`) | host patterns (`*`) of development and staging addresses, for the mail service alone: a site there is non-public for `otherHosts` with no env (`siteIsNonPublic`, `siteNonPublicSignal` → `NonPublicSignal`, `matchDevelopmentHost`, `isDevelopmentHost`); `[]` = none. Checked when the config is built (`assertDevelopmentHosts`): not an array of non-empty host patterns, or a lone `*` → the site does not start; Unicode patterns are punycoded, a trailing dot and the port are ignored | | `developmentHosts` | `iapl({ developmentHosts })`, default `DEFAULT_DEVELOPMENT_HOSTS` = `['*.dev.netscale.pl']` (`pluginDevelopmentHosts`) | host patterns (`*`) of development and staging addresses, for the mail service alone: a site there is non-public for `otherHosts` with no env (`siteIsNonPublic`, `siteNonPublicSignal` → `NonPublicSignal`, `matchDevelopmentHost`, `isDevelopmentHost`); `[]` = none. Checked when the config is built (`assertDevelopmentHosts`): not an array of non-empty host patterns, or a lone `*` → the site does not start; Unicode patterns are punycoded, a trailing dot and the port are ignored |
| `enrol` | `'auto'` | `'manual'` (only "Connect again" / `enrolRelay`), `false` (token from `token` / `setRelayToken`) | | `enrol` | `'auto'` | `'manual'` (only "Connect again" / `enrolRelay`), `false` (token from `token` / `setRelayToken`) |
| `connectButton` | `true` | `false`: no "Połącz z IWSN" and no `POST /api/iapl/mail-relay/connect-link`; confirm by an operator or with `requestRelayConnectLink` |
| `accessKeyField` | `false` | `true`: admins get "Enter an access key" in the state block (a hand-issued token) | | `accessKeyField` | `false` | `true`: admins get "Enter an access key" in the state block (a hand-issued token) |
| `token` | — | a token from elsewhere; nothing is stored, the site does not enrol | | `token` | — | a token from elsewhere; nothing is stored, the site does not enrol |
| `senderName` | panel → site name (`relaySenderName`) | fixed name or function | | `senderName` | panel → site name (`relaySenderName`) | fixed name or function |
@@ -1380,6 +1467,7 @@ needs more: Intecion raises the limits, or SMTP.
|---|---| |---|---|
| The transport alone, no SMTP / Graph | `email: relayAdapter()` (`RelayAdapterArgs`) | | The transport alone, no SMTP / Graph | `email: relayAdapter()` (`RelayAdapterArgs`) |
| Enrol from a deploy script; state; rotate; disconnect; a token issued by hand | `enrolRelay` (`EnrolResult`), `getRelayStatus` (`RelayStatus`), `rotateRelayToken`, `disconnectRelay`, `setRelayToken` | | Enrol from a deploy script; state; rotate; disconnect; a token issued by hand | `enrolRelay` (`EnrolResult`), `getRelayStatus` (`RelayStatus`), `rotateRelayToken`, `disconnectRelay`, `setRelayToken` |
| A button of your own for the confirmation by Intecion | `requestRelayConnectLink(payload)` (`ConnectLinkResult`: `{ state: 'pending', connectUrl, expiresAt }` / `{ state: 'active' }` / a refusal) on a person's click only; open `connectUrl` in a new tab with `noopener noreferrer`; never store, log or fetch it; `isRelayConnectUrl(url, base)`; the route `RELAY_CONNECT_LINK_PATH`; the stand-in `createFakeRelay({ connect })` + `relay.confirmConnect(url)` |
| Your own state block or panel route | `mailPanelState` (`MailPanelState`), `relayPanelEndpoints`, `relayConfirmEndpoint`; the plugin's component is `MailRelayStatus` (`/admin`) | | Your own state block or panel route | `mailPanelState` (`MailPanelState`), `relayPanelEndpoints`, `relayConfirmEndpoint`; the plugin's component is `MailRelayStatus` (`/admin`) |
| One message with the retry rule; one HTTP call | `sendThroughRelay` (`RelaySendContext`, `RelaySendResult`), `relayRequest` (`RelayCall`, `RelayAnswer`, `RelayRefusal`) | | One message with the retry rule; one HTTP call | `sendThroughRelay` (`RelaySendContext`, `RelaySendResult`), `relayRequest` (`RelayCall`, `RelayAnswer`, `RelayRefusal`) |
| The request the service takes | `buildRelayMessage` (`BuildRelayMessageArgs`, `BuiltRelayMessage`, `RelaySendRequest`), `bareAddress`, `bareAddresses`, `cleanSubject` | | The request the service takes | `buildRelayMessage` (`BuildRelayMessageArgs`, `BuiltRelayMessage`, `RelaySendRequest`), `bareAddress`, `bareAddresses`, `cleanSubject` |
@@ -1411,6 +1499,11 @@ its own tests). Order from the cheapest:
| Build | `pnpm build` — page routes `●` (SSG), not `ƒ` | before every "done" | | Build | `pnpm build` — page routes `●` (SSG), not `ƒ` | before every "done" |
| Smoke (Playwright) | `iapl-audit/resources/smoke.spec.template.ts` → `tests/smoke.spec.ts`: all URLs from the sitemap 200 + title + one h1, 404, GEO routes, banner, form end-to-end | before handover and after every IAPL update | | Smoke (Playwright) | `iapl-audit/resources/smoke.spec.template.ts` → `tests/smoke.spec.ts`: all URLs from the sitemap 200 + title + one h1, 404, GEO routes, banner, form end-to-end | before handover and after every IAPL update |
| Site in the browser | `iapl-seo-check`, `iapl-consent-check`, `cookie-scan` | before handover, after deploy | | Site in the browser | `iapl-seo-check`, `iapl-consent-check`, `cookie-scan` | before handover, after deploy |
| Closed doors (Playwright) | `iapl-audit/resources/closed-doors.spec.template.ts` → `tests/closed-doors.spec.ts`: every door that must stay closed, asked on a production build as anonymous, customer and editor; add the project's own doors (security.md "Closed doors from outside") | before every release and after every IAPL / Payload update |
| Routes judged | `iapl-audit/resources/routes.template.ts` → `tests/routes.ts`; `pnpm payload run tests/routes.ts` against the committed `tests/routes.snapshot.json`, one reason per route; `… update` after an upgrade (security.md "Routes nobody has judged") | in CI, and after every IAPL / Payload / plugin update |
| Security, code | `pnpm exec iapl-doctor --only security`: headers, CSP, 2FA, account rules and the static rules over your code (`code-patterns`: unescaped HTML / JSON-LD, `overrideAccess: true` or a Local API `user` without `overrideAccess: false` where a request reaches, a `where` from the request, `eval`, `NEXT_PUBLIC_` secrets, redirects and fetches to an address from the request; `config-dangerous`). A correct place: `// iapl-security-ok: <why>` (security.md "Security suites") | before every "done", in CI |
| Attack probes (Playwright / doctor) | `iapl-audit/resources/attack-probes.spec.template.ts` → `tests/attack-probes.spec.ts` on a production build or staging (secret files, bundle secrets, proxy bypass, open redirect, cache poisoning, NoSQL operators, anonymous where / draft / GraphQL reads, error leaks, unbounded lists, `/_next/image`, 8 MB bodies); add a probe per custom endpoint in `EXTRA`. On the live site: `pnpm exec iapl-doctor --url https://<domain> --only live-probes` (changes nothing) | before every release, after every IAPL / Payload / Next update, and after deploy (live) |
| Dependencies | `pnpm audit --prod` (the doctor's `deps-audit`): no high or critical; see §4 for the minimum Next / sharp / Payload | before every deploy |
| Project logic | vitest for your own functions (mapping company data to JSON-LD, helpers, hooks, migration scripts with `--dry-run`) | when you write logic the plugin does not have | | Project logic | vitest for your own functions (mapping company data to JSON-LD, helpers, hooks, migration scripts with `--dry-run`) | when you write logic the plugin does not have |
| Panel | the editor test (§11) and the empty-block test (§6.5a) | every new block / global | | Panel | the editor test (§11) and the empty-block test (§6.5a) | every new block / global |
@@ -1519,6 +1612,8 @@ block library — [doctor.md](../doctor.md)):
bash .agents/skills/iapl-audit/scripts/audit.sh bash .agents/skills/iapl-audit/scripts/audit.sh
pnpm exec iapl-doctor # + --deep --url http://localhost:3000 on the built site pnpm exec iapl-doctor # + --deep --url http://localhost:3000 on the built site
node .agents/skills/iapl-seo-check/scripts/seo-check.mjs http://localhost:3000 node .agents/skills/iapl-seo-check/scripts/seo-check.mjs http://localhost:3000
pnpm test:e2e e2e/performance.spec # the budget gate (iapl-performance) on the built site
pnpm exec iapl-doctor --deep --only growth # what grows: sizes, versions, retention, old submissions, unused media
pnpm generate:types && pnpm tsc --noEmit pnpm generate:types && pnpm tsc --noEmit
pnpm build # --webpack in the script; locally, not only dev pnpm build # --webpack in the script; locally, not only dev
# hardcoding and the field zoo in blocks # hardcoding and the field zoo in blocks
@@ -1579,6 +1674,7 @@ Anything that needs a developer → move it to the panel.
| Rich text | [richtext.md](../richtext.md) | | Rich text | [richtext.md](../richtext.md) |
| Headers, CSP, 2FA, panel path | [security.md](../security.md) | | Headers, CSP, 2FA, panel path | [security.md](../security.md) |
| SEO, metadata, sitemap, JSON-LD, llms.txt | [seo.md](../seo.md) | | SEO, metadata, sitemap, JSON-LD, llms.txt | [seo.md](../seo.md) |
| Speed: what the plugin does, what the project does, budgets, measuring, the doctor's performance group | [performance.md](../performance.md) |
| Auto-slug | [slug.md](../slug.md) | | Auto-slug | [slug.md](../slug.md) |
| Media: collection, file names, optimization, placeholders | [media.md](../media.md) | | Media: collection, file names, optimization, placeholders | [media.md](../media.md) |
| Image lightbox (enlarge, galleries, rich text images) | [lightbox.md](../lightbox.md) | | Image lightbox (enlarge, galleries, rich text images) | [lightbox.md](../lightbox.md) |
@@ -1660,6 +1756,7 @@ the task matches — manually: `/<name>`.
| `iapl-debug` | anything does not work — procedure + a symptom → cause → fix table | | `iapl-debug` | anything does not work — procedure + a symptom → cause → fix table |
| `iapl-audit` | before every "done" — the §0b set + the §11 checks + panel (§6.5a) + hardcoding in JSX + tsc + build | | `iapl-audit` | before every "done" — the §0b set + the §11 checks + panel (§6.5a) + hardcoding in JSX + tsc + build |
| `iapl-seo-check` | the running site through the eyes of Googlebot and AI agents (head, canonical, hreflang, sitemap, 404, JSON-LD, llms, Markdown, MCP) | | `iapl-seo-check` | the running site through the eyes of Googlebot and AI agents (head, canonical, hreflang, sitemap, 404, JSON-LD, llms, Markdown, MCP) |
| `iapl-performance` | speed: the doctor's performance group, measuring the built site (phone and desktop), the budget gate `e2e/performance.spec.ts` (`resources/`), reading LCP / CLS / INP / bytes / queries — when building pages or blocks, before handing over, whenever "slow" or PageSpeed comes up |
| `iapl-consent-check` | browser: no tracking pixels or cookies before consent; the Google tag may load before consent only in Consent Mode `advanced` (all signals `denied`) — a client who wants zero requests gets `consentMode: 'basic'` | | `iapl-consent-check` | browser: no tracking pixels or cookies before consent; the Google tag may load before consent only in Consent Mode `advanced` (all signals `denied`) — a client who wants zero requests gets `consentMode: 'basic'` |
| `iapl-doctor` | the whole site against the team standard in one command (`pnpm exec iapl-doctor`): versions, Node 22, layout, database names, env, headers, CSP, 2FA, cookie scanner, adminMeta, AGENTS.md, skills, seeds, block library, pnpm audit; `--url` / `--deep` for the running site and the database; `--strict` in the CI of a new site | | `iapl-doctor` | the whole site against the team standard in one command (`pnpm exec iapl-doctor`): versions, Node 22, layout, database names, env, headers, CSP, 2FA, cookie scanner, adminMeta, AGENTS.md, skills, seeds, block library, pnpm audit; `--url` / `--deep` for the running site and the database; `--strict` in the CI of a new site |
| `iapl-plugin-gap` | IAPL has a bug or is missing a feature — report to the owner, wait for the decision; a marked workaround only after approval | | `iapl-plugin-gap` | IAPL has a bug or is missing a feature — report to the owner, wait for the decision; a marked workaround only after approval |
+100 -62
View File
@@ -2,7 +2,7 @@
<!-- Generated by scripts/reference-index.mjs from reference/ — do not edit by hand (pnpm reference:index). --> <!-- 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 IAPL 1.17.0 ("Example Studio", made up) that uses The reference site is one complete client site on IAPL 1.18.0 ("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 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 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: 40 lines are below in full; open the rest in the repo at the tag of your plugin version:
@@ -265,7 +265,7 @@ import { i18nConfig } from '@/i18n.config'
export const proxy = createProxy(i18nConfig, { markdown: true, NextResponse }) export const proxy = createProxy(i18nConfig, { markdown: true, NextResponse })
// Inline LITERAL — Next reads the matcher statically (importing DEFAULT_PROXY_MATCHER breaks /admin) // Inline LITERAL — Next reads the matcher statically (importing DEFAULT_PROXY_MATCHER breaks /admin)
export const config = { matcher: ['/((?!api|admin|_next|.*\\..*).*)'] } export const config = { matcher: ['/((?!(?:api|admin|_next)(?:/|$)|.*\\..*).*)'] }
``` ```
## Collections and globals ## Collections and globals
@@ -279,7 +279,7 @@ Rules: AGENT.md §5, iapl-nav, iapl-collection.
| `src/collections/Pages.ts` | Pages: slug, blocks layout, AI summary, noindex, slug history, revalidation, system-page delete guard (below) | | `src/collections/Pages.ts` | Pages: slug, blocks layout, AI summary, noindex, slug history, revalidation, system-page delete guard (below) |
| `src/collections/Posts.ts` | the blog collection (archive in System pages) (below) | | `src/collections/Posts.ts` | the blog collection (archive in System pages) (below) |
| `src/collections/entryFields.ts` | shared fields of archive collections (names the entry card reads) (below) | | `src/collections/entryFields.ts` | shared fields of archive collections (names the entry card reads) (below) |
| `src/globals/Company.ts` | company data (PL market): footer, contact details, LocalBusiness JSON-LD (below) | | `src/globals/Company.ts` | company data (PL market): footer, contact details, LocalBusiness JSON-LD |
| `src/globals/Footer.ts` | footer navigation global (below) | | `src/globals/Footer.ts` | footer navigation global (below) |
| `src/globals/Header.ts` | header navigation global (below) | | `src/globals/Header.ts` | header navigation global (below) |
@@ -288,7 +288,7 @@ Rules: AGENT.md §5, iapl-nav, iapl-collection.
```ts ```ts
import type { CollectionConfig } from 'payload' import type { CollectionConfig } from 'payload'
import { buildRevalidateHook } from '@intecion/ipal-kit' import { adminOrEditor, buildRevalidateHook } from '@intecion/ipal-kit'
import { revalidatePath } from 'next/cache' import { revalidatePath } from 'next/cache'
import { i18nConfig } from '@/i18n.config' import { i18nConfig } from '@/i18n.config'
@@ -301,7 +301,8 @@ const revalidate = buildRevalidateHook({ config: i18nConfig, revalidatePath })
export const CaseStudies: CollectionConfig = { export const CaseStudies: CollectionConfig = {
slug: 'caseStudies', slug: 'caseStudies',
admin: { defaultColumns: ['title', 'publishedAt', 'updatedAt'], useAsTitle: 'title' }, admin: { defaultColumns: ['title', 'publishedAt', 'updatedAt'], useAsTitle: 'title' },
access: { read: () => true }, // write rules of its own: Payload's default is "any signed-in account" — a visitor login collection would reach it (security.md "Visitor accounts")
access: { create: adminOrEditor, delete: adminOrEditor, read: () => true, update: adminOrEditor },
defaultSort: '-publishedAt', defaultSort: '-publishedAt',
fields: entryFields, fields: entryFields,
hooks: { afterChange: [revalidate.afterChange], afterDelete: [revalidate.afterDelete] }, hooks: { afterChange: [revalidate.afterChange], afterDelete: [revalidate.afterDelete] },
@@ -315,6 +316,7 @@ export const CaseStudies: CollectionConfig = {
import type { CollectionConfig } from 'payload' import type { CollectionConfig } from 'payload'
import { import {
adminOrEditor,
buildMediaPlaceholderField, buildMediaPlaceholderField,
buildMediaPlaceholderHook, buildMediaPlaceholderHook,
buildOptimizeUploadField, buildOptimizeUploadField,
@@ -325,7 +327,8 @@ import {
/** media.md "Full collection", 1:1. */ /** media.md "Full collection", 1:1. */
export const Media: CollectionConfig = { export const Media: CollectionConfig = {
slug: 'media', slug: 'media',
access: { read: () => true }, // public files; media are served by the app (/api/media/file/…) // write rules of its own: Payload's default is "any signed-in account" — a visitor login collection would reach it (security.md "Visitor accounts")
access: { create: adminOrEditor, delete: adminOrEditor, read: () => true, update: adminOrEditor }, // public files; media are served by the app (/api/media/file/…)
upload: { focalPoint: true, mimeTypes: ['image/*', 'application/pdf', 'video/mp4', 'video/webm'] }, upload: { focalPoint: true, mimeTypes: ['image/*', 'application/pdf', 'video/mp4', 'video/webm'] },
hooks: { hooks: {
beforeOperation: [normalizeFilenameHook, buildOptimizeUploadHook(), buildMediaPlaceholderHook()], beforeOperation: [normalizeFilenameHook, buildOptimizeUploadHook(), buildMediaPlaceholderHook()],
@@ -344,6 +347,7 @@ export const Media: CollectionConfig = {
import type { CollectionConfig } from 'payload' import type { CollectionConfig } from 'payload'
import { import {
adminOrEditor,
buildNoindexField, buildNoindexField,
buildPreventDeleteSystemPage, buildPreventDeleteSystemPage,
buildRevalidateHook, buildRevalidateHook,
@@ -362,14 +366,15 @@ const revalidate = buildRevalidateHook({ config: i18nConfig, revalidatePath })
export const Pages: CollectionConfig = { export const Pages: CollectionConfig = {
slug: 'pages', slug: 'pages',
admin: { defaultColumns: ['title', 'slug', 'updatedAt'], useAsTitle: 'title' }, admin: { defaultColumns: ['title', 'slug', 'updatedAt'], useAsTitle: 'title' },
access: { read: () => true }, // write rules of its own: Payload's default is "any signed-in account" — a visitor login collection would reach it (security.md "Visitor accounts")
access: { create: adminOrEditor, delete: adminOrEditor, read: () => true, update: adminOrEditor },
fields: [ fields: [
{ name: 'title', type: 'text', localized: true, required: true }, { name: 'title', type: 'text', localized: true, required: true },
buildSlugField({ from: 'title' }), buildSlugField({ from: 'title' }),
{ name: 'layout', type: 'blocks', blocks: pageBlocks, minRows: 1 }, { name: 'layout', type: 'blocks', blocks: pageBlocks, minRows: 1 },
buildSummaryField(), // aiSummary — GEO (llms.txt, MCP) buildSummaryField(), // aiSummary — GEO (llms.txt, MCP)
buildNoindexField(), buildNoindexField(),
{ name: 'slugHistory', type: 'array', admin: { components: rowLabel('slug', 'Old address'), readOnly: true }, fields: [{ name: 'slug', type: 'text' }], labels: { plural: 'Old addresses', singular: 'Old address' } }, { name: 'slugHistory', type: 'array', admin: { components: rowLabel('slug', 'Old address'), readOnly: true }, fields: [{ name: 'slug', type: 'text', index: true }], labels: { plural: 'Old addresses', singular: 'Old address' } },
], ],
hooks: { hooks: {
afterChange: [revalidate.afterChange], afterChange: [revalidate.afterChange],
@@ -385,7 +390,7 @@ export const Pages: CollectionConfig = {
```ts ```ts
import type { CollectionConfig } from 'payload' import type { CollectionConfig } from 'payload'
import { buildRevalidateHook } from '@intecion/ipal-kit' import { adminOrEditor, buildRevalidateHook } from '@intecion/ipal-kit'
import { revalidatePath } from 'next/cache' import { revalidatePath } from 'next/cache'
import { i18nConfig } from '@/i18n.config' import { i18nConfig } from '@/i18n.config'
@@ -398,7 +403,8 @@ const revalidate = buildRevalidateHook({ config: i18nConfig, revalidatePath })
export const Posts: CollectionConfig = { export const Posts: CollectionConfig = {
slug: 'posts', slug: 'posts',
admin: { defaultColumns: ['title', 'publishedAt', 'updatedAt'], useAsTitle: 'title' }, admin: { defaultColumns: ['title', 'publishedAt', 'updatedAt'], useAsTitle: 'title' },
access: { read: () => true }, // write rules of its own: Payload's default is "any signed-in account" — a visitor login collection would reach it (security.md "Visitor accounts")
access: { create: adminOrEditor, delete: adminOrEditor, read: () => true, update: adminOrEditor },
defaultSort: '-publishedAt', defaultSort: '-publishedAt',
fields: entryFields, fields: entryFields,
hooks: { afterChange: [revalidate.afterChange], afterDelete: [revalidate.afterDelete] }, hooks: { afterChange: [revalidate.afterChange], afterDelete: [revalidate.afterDelete] },
@@ -431,63 +437,19 @@ export const entryFields: Field[] = [
] ]
``` ```
### `src/globals/Company.ts`
```ts
import type { GlobalConfig } from 'payload'
import { buildGlobalRevalidateHook, rowLabel } from '@intecion/ipal-kit'
import { revalidatePath } from 'next/cache'
/** Company data for a PL market site: footer, contact block details, LocalBusiness JSON-LD. */
export const Company: GlobalConfig = {
slug: 'company',
access: { read: () => true },
fields: [
{ name: 'name', type: 'text', required: true },
{ name: 'legalName', type: 'text' },
{ name: 'taxId', type: 'text', label: 'NIP' },
{ name: 'taxIdLabel', type: 'text', admin: { description: 'Shown before the tax ID in the footer.' }, defaultValue: 'NIP', label: 'Tax ID label', localized: true },
{
name: 'address',
type: 'group',
fields: [
{ name: 'street', type: 'text' },
{ name: 'postalCode', type: 'text' },
{ name: 'city', type: 'text' },
{ name: 'country', type: 'text', defaultValue: 'PL' },
],
},
{ name: 'phone', type: 'text' },
{ name: 'email', type: 'email' },
{ name: 'hours', type: 'text', localized: true, admin: { description: 'Shown next to the contact form, e.g. "Mon–Fri 9:00–17:00".' } },
{
name: 'socials',
type: 'array',
admin: { components: rowLabel('label', 'Profile'), initCollapsed: true },
labels: { plural: 'Profiles', singular: 'Profile' },
fields: [
{ name: 'label', type: 'text', required: true },
{ name: 'url', type: 'text', required: true },
],
},
],
hooks: { afterChange: [buildGlobalRevalidateHook({ revalidatePath })] },
}
```
### `src/globals/Footer.ts` ### `src/globals/Footer.ts`
```ts ```ts
import type { GlobalConfig } from 'payload' import type { GlobalConfig } from 'payload'
import { buildGlobalRevalidateHook, buildLinkField, rowLabel } from '@intecion/ipal-kit' import { adminOrEditor, buildGlobalRevalidateHook, buildLinkField, rowLabel } from '@intecion/ipal-kit'
import { revalidatePath } from 'next/cache' import { revalidatePath } from 'next/cache'
/** iapl-nav: link columns and a note. Legal links come from System pages (getSystemLinks), not from here. */ /** iapl-nav: link columns and a note. Legal links come from System pages (getSystemLinks), not from here. */
export const Footer: GlobalConfig = { export const Footer: GlobalConfig = {
slug: 'footer', slug: 'footer',
access: { read: () => true }, // write rules of its own: Payload's default is "any signed-in account" — a visitor login collection would reach it (security.md "Visitor accounts")
access: { read: () => true, update: adminOrEditor },
fields: [ fields: [
{ {
name: 'columns', name: 'columns',
@@ -517,13 +479,14 @@ export const Footer: GlobalConfig = {
```ts ```ts
import type { GlobalConfig } from 'payload' import type { GlobalConfig } from 'payload'
import { buildGlobalRevalidateHook, buildLinkField, buildLinksField, rowLabel } from '@intecion/ipal-kit' import { adminOrEditor, buildGlobalRevalidateHook, buildLinkField, buildLinksField, rowLabel } from '@intecion/ipal-kit'
import { revalidatePath } from 'next/cache' import { revalidatePath } from 'next/cache'
/** iapl-nav: menu with one submenu level, a CTA button, the mobile menu label. Logo comes from Site settings. */ /** iapl-nav: menu with one submenu level, a CTA button, the mobile menu label. Logo comes from Site settings. */
export const Header: GlobalConfig = { export const Header: GlobalConfig = {
slug: 'header', slug: 'header',
access: { read: () => true }, // write rules of its own: Payload's default is "any signed-in account" — a visitor login collection would reach it (security.md "Visitor accounts")
access: { read: () => true, update: adminOrEditor },
fields: [ fields: [
{ {
name: 'navItems', name: 'navItems',
@@ -866,7 +829,12 @@ import * as content from '@/lib/content'
import { loadNotFoundView } from './notFoundView' import { loadNotFoundView } from './notFoundView'
export default createNotFoundPage(content, { load: loadNotFoundView }) // The lazy 404 content arrives after hydration: a block as tall as it keeps the footer still (no layout shift).
// Measured for this site's 404 content: 282 px at 360 px wide to 432 px at 1920 — change it with that content.
export default createNotFoundPage(content, {
load: loadNotFoundView,
placeholder: <div aria-hidden style={{ minHeight: 'max(290px, calc(212px + 11.5vw))' }} />,
})
``` ```
### `src/app/(frontend)/[locale]/notFoundView.ts` ### `src/app/(frontend)/[locale]/notFoundView.ts`
@@ -1164,18 +1132,68 @@ Rules: AGENT.md §8a.
| File | What it shows | | File | What it shows |
|---|---| |---|---|
| `e2e/attack-probes.spec.ts` | attack probes on the built site (run by `pnpm e2e:built` in both bundlers): every probe of the plugin's ATTACK_PROBES (security.md "Security suites") with this site's secret values for the bundle check, plus CSRF with the editor's cookie from another origin and the session cookie's flags; probes tied to an open audit finding are expected to fail (`test.fail`) |
| `e2e/closed-doors.spec.ts` | closed doors from outside (run by `pnpm e2e:built` in both bundlers): every door of e2e/closed-doors.ts asked on the production build as an anonymous visitor, a customer (the fixture's `e2e-visitors`) and an editor; doors still open while the owner decides are asserted open (`test.fail`) |
| `e2e/closed-doors.ts` | the doors that must stay closed, who each is closed for and how a closed answer looks; a project adds its own (security.md "Closed doors from outside") |
| `e2e/create-test-admin.ts` | two test admins with a known TOTP secret (the specs share out the five 2FA verify attempts per account), their stored verify counts cleared, and e-mail sending pointed at the tests' mail sink (local / CI database only) | | `e2e/create-test-admin.ts` | two test admins with a known TOTP secret (the specs share out the five 2FA verify attempts per account), their stored verify counts cleared, and e-mail sending pointed at the tests' mail sink (local / CI database only) |
| `e2e/enrolment.ts` | reads the two-step verification confirmation link (twoFactor.confirmByEmail, 1.18.0) from the mail sink: quoted-printable undone, the latest message to an address, waited for (below) |
| `e2e/global-setup.ts` | Playwright global setup: resets the test admins and clears their stored 2FA attempt counts before every run, so specs do not depend on run order (below) | | `e2e/global-setup.ts` | Playwright global setup: resets the test admins and clears their stored 2FA attempt counts before every run, so specs do not depend on run order (below) |
| `e2e/late-staff-fixture.ts` | test fixture, on only with E2E_LATE_STAFF=1: one plugin before iapl (staff collections of the config: roles with one more value, the plugin's roles, roles of the project's own) and one after it (a staff collection without rules, one whose roles field is text, copies of staff collections under new slugs — plain, with rules of their own, one rule used for another operation, other role values, the opt-out, not staff — and a visitor collection with open sign-up) | | `e2e/late-staff-fixture.ts` | test fixture, on only with E2E_LATE_STAFF=1: one plugin before iapl (staff collections of the config: roles with one more value, the plugin's roles, roles of the project's own) and one after it (a staff collection without rules, one whose roles field is text, copies of staff collections under new slugs — plain, with rules of their own, one rule used for another operation, other role values, the opt-out, not staff — and a visitor collection with open sign-up) |
| `e2e/late-staff.spec.ts` | the account rules on a BUILT site (run by `pnpm e2e:built` after a webpack and a Turbopack build): a staff collection a later plugin adds, staff collections whose accounts can hold `admin`, and copies of staff collections — a visitor account gets nothing, nobody raises its own role or makes an admin, a copy is never wider than the plugin's rule | | `e2e/late-staff.spec.ts` | the account rules on a BUILT site (run by `pnpm e2e:built` after a webpack and a Turbopack build): a staff collection a later plugin adds, staff collections whose accounts can hold `admin`, and copies of staff collections — a visitor account gets nothing, nobody raises its own role or makes an admin, a copy is never wider than the plugin's rule |
| `e2e/mail-relay-fixture.ts` | test fixture, on only with E2E_MAIL_RELAY_URL: points the mail service's client at the stand-in the spec starts; never in a real site (a real site names no address) (below) | | `e2e/mail-relay-fixture.ts` | test fixture, on only with E2E_MAIL_RELAY_URL: points the mail service's client at the stand-in the spec starts; never in a real site (a real site names no address) (below) |
| `e2e/mail-relay-setup.ts` | for the mail-service spec: empties the SMTP fields and the stored token, so the next e-mail enrols and goes through the mail service (local database only) (below) | | `e2e/mail-relay-setup.ts` | for the mail-service spec: empties the SMTP fields and the stored token, so the next e-mail enrols and goes through the mail service (local database only) (below) |
| `e2e/mail-relay.spec.ts` | the mail service on a built site: the state block in the panel, the first e-mail through the public confirm route, no token in anything the browser receives | | `e2e/mail-relay.spec.ts` | the mail service on a built site: the state block in the panel, the first e-mail through the public confirm route, no token in anything the browser receives |
| `e2e/own-account.spec.ts` | built-site test (pnpm e2e:built, 1.18.0): the account page asks for the current password before a new e-mail is saved (accounts.confirmOwnChanges); five failed staff sign-ins from one place answer 429 there, not elsewhere (accounts.signInLimit); a staff sign-in from another origin gets 403 (accounts.signInSameOrigin) |
| `e2e/perf-lab.mjs` | the lab measurement of one page (Lighthouse's phone and desktop profiles, Web Vitals observers, bytes per type) — used by the performance spec and `pnpm perf:measure`; the iapl-performance skill ships the same file |
| `e2e/performance.spec.ts` | the performance budgets (run by `pnpm e2e:built` in both bundlers): every page type on a throttled phone and a desktop — LCP, CLS, TBT, the response to a tap, JS / CSS / font bytes, requests, render-blocking, third parties before consent — and the MongoDB queries of one render (docs/performance.md) |
| `e2e/routes.snapshot.json` | every public route of the site (REST, GraphQL, Next route files) with one line saying who may use it and why — the judged list `routes:check` compares with |
| `e2e/routes.ts` | `routes:check`: the site's public routes against e2e/routes.snapshot.json (`pnpm payload run e2e/routes.ts [update]`; from the repository `pnpm routes:check`) (below) |
| `e2e/sign-in-answers.spec.ts` | built-site test (pnpm e2e:built, 1.18.0): a locked staff account gets the wrong-password answer over REST and GraphQL (accounts.lockedAnswer); the plugin's panel actions refuse another origin and take the site's own (adminSameOrigin) |
| `e2e/sign-in-look.spec.ts` | browser test of the sign-in look (whiteLabel.signIn): the panel comes with the form, sits above it on a phone in both themes, is on forgot / reset / logout too, the language links work, the 2FA code screen keeps its boxes (now named) |
| `e2e/smoke.spec.ts` | the smoke tests every release must pass: pages, showcase, forms (also a file sent by e-mail), sitemap, SEO/GEO, headers, consent, 2FA | | `e2e/smoke.spec.ts` | the smoke tests every release must pass: pages, showcase, forms (also a file sent by e-mail), sitemap, SEO/GEO, headers, consent, 2FA |
| `e2e/smtp-sink.ts` | a local mail sink for the smoke tests: reads what the site really sent (recipients, attachments) | | `e2e/smtp-sink.ts` | a local mail sink for the smoke tests: reads what the site really sent (recipients, attachments) |
| `e2e/totp.ts` | RFC 6238 code generator for the 2FA sign-in in the smoke test, and the address of the second test admin (below) | | `e2e/totp.ts` | RFC 6238 code generator for the 2FA sign-in in the smoke test, and the addresses of the second test admin and the test editor (below) |
| `e2e/two-factor-back.spec.ts` | browser test of the 2FA screens' `back` link (twoFactor.safeBack): a prepared link — script or another host — ends on the admin root, an ordinary one is followed | | `e2e/two-factor-back.spec.ts` | browser test of the 2FA screens' `back` link (twoFactor.safeBack): a prepared link — script or another host — ends on the admin root, an ordinary one is followed |
| `e2e/two-factor-enrolment.spec.ts` | the first 2FA set-up confirmed by e-mail on the built site (run by `pnpm e2e:built` in both bundlers): the password alone no longer enrols an attacker's factor (the link goes to the owner and is refused in another browser), and the panel flow — code, notice, link from the mail sink, sign in again |
| `e2e/two-factor-setup.spec.ts` | browser check of "2FA setup required": the first admin of a fresh site, a new editor, the administrator's reset on the account page | | `e2e/two-factor-setup.spec.ts` | browser check of "2FA setup required": the first admin of a fresh site, a new editor, the administrator's reset on the account page |
| `e2e/unused-media.spec.ts` | the unused-files notice above the Media list (`unusedMedia: true`): an image nothing uses is listed and the link opens Payload's list filtered to it; the test deletes its own upload, the panel never deletes |
### `e2e/enrolment.ts`
```ts
import type { SinkMessage } from './smtp-sink'
/**
* twoFactor.confirmByEmail (IAPL 1.18.0, on by default): the first set-up of two-step verification waits for a link
* sent to the account's e-mail. The specs read that link from the mail sink (e2e/smtp-sink.ts; create-test-admin.ts
* points the site's SMTP at it).
*/
/** A raw message body as text: quoted-printable soft breaks and escapes undone. */
export const decodeMail = (raw: string): string =>
raw.replace(/=\r?\n/g, '').replace(/=([0-9A-F]{2})/g, (_, hex: string) => String.fromCharCode(parseInt(hex, 16)))
/** The confirmation link of the latest message to `email`, or null. */
export function enrolmentLink(messages: SinkMessage[], email: string): null | URL {
for (const message of [...messages].reverse()) {
if (!message.to.some((to) => to.toLowerCase().includes(email.toLowerCase()))) {continue}
const found = decodeMail(message.data).match(/https?:\/\/[^\s"<>]+\/two-factor\/confirm\?u=[^\s"<>&]+&(?:amp;)?t=[\w-]+/)
if (found) {return new URL(found[0].replace('&amp;', '&'))}
}
return null
}
/** Waits until a message with the confirmation link for `email` arrives (mail goes out right after the request). */
export async function waitForEnrolmentLink(messages: SinkMessage[], email: string, timeoutMs = 10_000): Promise<URL> {
const until = Date.now() + timeoutMs
for (;;) {
const link = enrolmentLink(messages, email)
if (link) {return link}
if (Date.now() > until) {throw new Error(`no confirmation e-mail for ${email} in the mail sink`)}
await new Promise((r) => setTimeout(r, 200))
}
}
```
### `e2e/global-setup.ts` ### `e2e/global-setup.ts`
@@ -1239,7 +1257,7 @@ const payload = await getPayload({ config })
await payload.updateGlobal({ await payload.updateGlobal({
slug: 'site-integrations', slug: 'site-integrations',
context: { ipalIntegrationStatus: true }, context: { ipalIntegrationStatus: true },
data: { emailStatus: { checkedAt: null, code: null, message: null, since: null, state: null }, emailTransport: 'smtp', smtpFromAddress: 'site@example-studio.test', smtpFromName: 'Example Studio', smtpHost: null, smtpPassword: null, smtpUser: null } as never, data: { emailStatus: { checkedAt: null, code: null, message: null, since: null, state: null }, emailMethod: 'relay', emailTransport: 'smtp', smtpFromAddress: 'site@example-studio.test', smtpFromName: 'Example Studio', smtpHost: null, smtpPassword: null, smtpUser: null } as never,
overrideAccess: true, overrideAccess: true,
}) })
for (const key of await payload.kv.keys()) { for (const key of await payload.kv.keys()) {
@@ -1249,6 +1267,23 @@ console.log('[e2e] no SMTP server and no mail-service token: the next e-mail enr
process.exit(0) process.exit(0)
``` ```
### `e2e/routes.ts`
```ts
/**
* routes:check — every public route of this site (REST, GraphQL, Next route files) against the judged list in
* e2e/routes.snapshot.json (docs/security.md "Routes nobody has judged"). Reads the config only, never the database.
* pnpm payload run e2e/routes.ts → fails on a route nobody has judged
* pnpm payload run e2e/routes.ts update → adds new routes with an empty reason (judge them), drops gone ones
* (`payload run` drops `--flags`, so the word is `update`.) From the plugin repository: pnpm routes:check [--update],
* also the first step of pnpm e2e:built.
*/
import config from '@payload-config'
import { runRouteCheck } from '@intecion/ipal-kit/doctor'
process.exit(await runRouteCheck({ config: await config, update: process.argv.slice(2).includes('update') }))
```
### `e2e/totp.ts` ### `e2e/totp.ts`
```ts ```ts
@@ -1270,4 +1305,7 @@ export function totp(secret: string, now = Date.now()): string {
/** The second smoke-test admin (create-test-admin.ts makes both): `e2e-admin@…` → `e2e-admin-2@…`. */ /** The second smoke-test admin (create-test-admin.ts makes both): `e2e-admin@…` → `e2e-admin-2@…`. */
export const secondTestAdmin = (email: string): string => email.replace('@', '-2@') export const secondTestAdmin = (email: string): string => email.replace('@', '-2@')
/** The smoke-test editor (create-test-admin.ts makes it): `e2e-admin@…` → `e2e-admin-editor@…`, role `editor`, the same password and secret. */
export const editorTestAccount = (email: string): string => email.replace('@', '-editor@')
``` ```
+33
View File
@@ -42,6 +42,13 @@ classes (warnings), `styles.css` without `@intecion/ipal-kit/tokens.css` (warnin
next/font in `--font-body` with the preset (warning), and with `src/design/tokens.ts`: no `DESIGN.md` (warning) and next/font in `--font-body` with the preset (warning), and with `src/design/tokens.ts`: no `DESIGN.md` (warning) and
`iapl-tokens --check` — a stale `src/design/tokens.css` or a WCAG AA contrast failure is an error. `iapl-tokens --check` — a stale `src/design/tokens.css` or a WCAG AA contrast failure is an error.
## Speed (AGENT.md §6.11b, docs/performance.md)
The full run (not `--quick`) lists the doctor's `performance` group as errors (since 1.18.0; a rule the project lowered in `iapl-doctor.json` shows as a warning): `next.config` without
`buildImagesConfig()`, fonts from Google or with `display: 'block'`, more than two families, a blocking `<script src>`
or a remote stylesheet, an `<iframe>` that loads with the page, transitions of layout properties, `transition-all`,
`scroll` listeners, animations with nothing for reduced motion. The `iapl-performance` skill measures the built site and
adds the budget test.
## iapl-audit and iapl-doctor ## iapl-audit and iapl-doctor
`iapl-audit` checks the **code** inside the edit loop (and tsc + build). `pnpm exec iapl-doctor` checks the **site** `iapl-audit` checks the **code** inside the edit loop (and tsc + build). `pnpm exec iapl-doctor` checks the **site**
against the team standard: it runs this script (`--quick`) from the installed package, reports its findings under its against the team standard: it runs this script (`--quick`) from the installed package, reports its findings under its
@@ -51,6 +58,22 @@ names, env, admin, AGENTS.md, skills, seeds and — with `--url` / `--deep` —
## What the script does not check (do it by hand) ## What the script does not check (do it by hand)
- **Closed doors and judged routes** (security.md "Closed doors from outside", "Routes nobody has judged"):
`resources/closed-doors.spec.template.ts` → `tests/closed-doors.spec.ts` (add the project's own doors; run on a
production build as anonymous, customer and editor) and `resources/routes.template.ts` → `tests/routes.ts`
(`pnpm payload run tests/routes.ts update` once, write a reason per route, commit the snapshot; then
`pnpm payload run tests/routes.ts` fails on a route nobody has judged). A new custom endpoint, collection or
route file of the project = a new snapshot entry with its reason, and a door in `DOORS` if it must stay closed.
- **Attack probes and static security rules** (security.md "Security suites"): `resources/attack-probes.spec.template.ts`
→ `tests/attack-probes.spec.ts`, run on a production build or staging (`BASE_URL=… PAGE=/pl pnpm exec playwright test
tests/attack-probes.spec.ts`): the plugin's ATTACK_PROBES, plus the project's own in `EXTRA` for every custom
endpoint. On the live site: `pnpm exec iapl-doctor --url https://<domain> --only live-probes`. The code side:
`pnpm exec iapl-doctor --only security` (`code-patterns`, `config-dangerous`); a correct place gets
`// iapl-security-ok: <why>`. Dependencies: `pnpm audit --prod` (the doctor's `deps-audit`) — no high or critical.
Every address field rendered into `href` (social profiles, a website) is `buildUrlField()` and rendered through
`safeHref()` (security.md "Addresses rendered into `href`"); the static rules do not flag an `href` from data.
- **Editor test** (AGENT.md §11): every text, image, button, section, - **Editor test** (AGENT.md §11): every text, image, button, section,
menu, footer and SEO field can be changed in the panel, in every language. menu, footer and SEO field can be changed in the panel, in every language.
- **Cookie consent:** in Network, before accepting, there are no requests to - **Cookie consent:** in Network, before accepting, there are no requests to
@@ -69,4 +92,14 @@ names, env, admin, AGENTS.md, skills, seeds and — with `--url` / `--deep` —
rolled out). Report-only for more than a few weeks with clean reports → WARNING (switch to `mode: 'enforce'`). rolled out). Report-only for more than a few weeks with clean reports → WARNING (switch to `mode: 'enforce'`).
Then open `/pl` and `/admin` in the browser: CSP lines in the console = missing sources (flags / `extra`). Then open `/pl` and `/admin` in the browser: CSP lines in the console = missing sources (flags / `extra`).
- **Drafts and locales over the API** (a collection with `versions: { drafts: true }`): without a session,
`curl -s "$U/api/<slug>?draft=true&limit=100" | grep -c '"_status":"draft"'` → `0`, else ERROR: give it
`access: { read: readPublished(), readVersions: readPublishedVersions() }` (access.md). `curl -s -o /dev/null -w '%{http_code}' "$U/api/<slug>/versions?limit=10"`
→ `200` (a `500` = a rule with the document's `_status` path on `readVersions`: ERROR). `curl -sI "$U/md/xx"` → `404`
(no stand-in locale); a 404 page assigned in System pages must be published.
- **Secrets out of queries** (as an admin, with versions on for Site integrations or a collection using
`writeOnlySecret`): `curl -s -H "Authorization: JWT $T" "$U/api/globals/site-integrations/versions?where[version.smtpPassword][exists]=true"`
answers an error with no `totalDocs`, else ERROR (the field lost `secretReadAccess`, e.g. an override replaced its
`access`).
Do not say "done" until the full audit (without `--quick`) has no errors. Do not say "done" until the full audit (without `--quick`) has no errors.
@@ -0,0 +1,30 @@
/**
* Attack probes from outside — the requests attackers send to Payload / Next.js sites, asked on a PRODUCTION build
* (`pnpm build && pnpm start`) or a staging copy (IAPL docs/security.md "Security suites"). Copy to
* tests/attack-probes.spec.ts and run:
*
* BASE_URL=http://localhost:3000 PAGE=/pl pnpm exec playwright test tests/attack-probes.spec.ts
*
* The probes come from the plugin (ATTACK_PROBES, @intecion/ipal-kit/doctor), so an IAPL upgrade brings new ones.
* On a LIVE site use `pnpm exec iapl-doctor --url https://<domain> --only live-probes` instead: it runs only the
* probes that change nothing (no 8 MB bodies). This spec runs all of them — local or staging only.
* The bundle check looks for this site's own secret VALUES: they are read from the environment (.env of the local
* build) and never printed. Add the project's own probes to EXTRA.
*/
import { ATTACK_PROBES, type AttackProbe, createProbeContext } from '@intecion/ipal-kit/doctor'
import { expect, test } from '@playwright/test'
const BASE = (process.env.BASE_URL ?? 'http://localhost:3000').replace(/\/$/, '')
const PAGE = process.env.PAGE ?? '/'
const secrets = ['PAYLOAD_SECRET', 'CRON_SECRET', 'R2_SECRET_ACCESS_KEY', 'TURNSTILE_SECRET_KEY', 'IAPL_DOCTOR_TOKEN', 'IAPL_COOKIE_SCAN_TOKEN'].map((k) => process.env[k]).filter((v): v is string => !!v && v.length >= 8)
/** The project's own probes, e.g. a custom endpoint that must refuse an 8 MB body or an operator in its query. */
const EXTRA: AttackProbe[] = []
for (const probe of [...ATTACK_PROBES, ...EXTRA]) {
test(`${probe.class}: ${probe.title}`, async () => {
const result = await probe.run(createProbeContext(BASE, { page: PAGE, secrets }))
test.skip(!!result.skipped, result.skipped)
expect(result.ok, result.detail).toBe(true)
})
}
@@ -0,0 +1,109 @@
/**
* Closed doors from outside — every door of the site that must stay CLOSED, asked on a PRODUCTION build (`pnpm build
* && pnpm start`: Payload's GraphQL playground and introspection, among others, behave differently outside
* production) as an anonymous visitor, a customer and an editor (IAPL docs/security.md "Closed doors from outside").
* Copy to tests/closed-doors.spec.ts and run:
*
* BASE_URL=http://localhost:3000 pnpm exec playwright test tests/closed-doors.spec.ts
*
* Callers (each is skipped when its variables are missing):
* anonymous always;
* customer a site with a visitor login collection: E2E_CUSTOMER_COLLECTION (its slug), E2E_CUSTOMER_EMAIL,
* E2E_CUSTOMER_PASSWORD — an existing test account of that collection;
* editor E2E_EDITOR_EMAIL, E2E_EDITOR_PASSWORD, E2E_EDITOR_TOTP_SECRET — a staff test account with the role
* `editor` and a known 2FA secret, on a LOCAL or staging database only (never production accounts).
* Add the project's own doors to DOORS (a custom endpoint, a collection only staff may read, a global with secrets).
* A write door is asked with a body that changes nothing when the door is open (an id that does not exist, `{}`).
*/
import { type APIRequestContext, expect, test } from '@playwright/test'
import { createHmac } from 'node:crypto'
type Caller = 'anonymous' | 'customer' | 'editor'
type Answer = { body: unknown; status: number }
type Door = { body?: unknown; closed?: (a: Answer) => boolean; closedFor: Caller[]; graphql?: string; method?: 'DELETE' | 'GET' | 'PATCH' | 'POST'; name: string; path?: string }
const BASE = (process.env.BASE_URL ?? 'http://localhost:3000').replace(/\/$/, '')
const ALL: Caller[] = ['anonymous', 'customer', 'editor']
const OUTSIDERS: Caller[] = ['anonymous', 'customer']
const NO_ID = '000000000000000000000000' // MongoDB; use 999999999 on Postgres / SQLite
const refused = ({ status }: Answer) => [401, 403, 404].includes(status)
const status = (code: number) => (a: Answer) => a.status === code
const noData = (field: string) => ({ body, status: s }: Answer) => {
const b = body as { data?: Record<string, unknown> | null; errors?: unknown[] } | null
return s >= 400 || Boolean(b?.errors?.length) || b?.data?.[field] == null
}
const DOORS: Door[] = [
// the plugin's own — keep them
{ closedFor: ALL, name: 'Site integrations cannot be read', path: '/api/globals/site-integrations' },
{ body: {}, closedFor: ALL, method: 'POST', name: 'Site integrations cannot be saved', path: '/api/globals/site-integrations' },
{ closedFor: ALL, graphql: '{ SiteIntegration { smtpHost } }', closed: noData('SiteIntegration'), name: 'Site integrations over GraphQL' },
{ closedFor: ALL, name: 'the key-value store (2FA counts, the mail-service token)', path: '/api/payload-kv' },
{ closedFor: ALL, name: 'the consent log', path: '/api/consent-records' },
{ closedFor: ALL, name: 'the deep doctor status without its token', path: '/api/ipal/doctor', closed: status(404) },
{ closedFor: ALL, method: 'POST', name: 'a test e-mail', path: '/api/ipal/test-email', body: { to: '[email protected]' } },
{ closedFor: ALL, name: 'the mail-service status', path: '/api/iapl/mail-relay/status' },
{ closedFor: ALL, method: 'POST', name: 'the crawler\'s call-back without its token', path: '/api/ipal/cookie-crawl/results', body: { jobId: 'x', ok: true } },
{ closedFor: OUTSIDERS, method: 'POST', name: 'a crawl without the schedule\'s token', path: '/api/ipal/cookie-crawl' },
{ closedFor: OUTSIDERS, name: 'form submissions', path: '/api/form-submissions' },
// IAPL 1.18.0: a staff account only; an open door answers 400 (validation) instead of 403
{ body: { form: NO_ID, submissionData: [] }, closedFor: OUTSIDERS, method: 'POST', name: 'a submission past submitForm', path: '/api/form-submissions', closed: status(403) },
{ body: { email: '[email protected]', password: 'Door-Password-1234', roles: ['admin'] }, closedFor: ALL, method: 'POST', name: 'nobody creates a staff account', path: '/api/users', closed: status(403) },
{ body: { email: '[email protected]', password: 'Door-Password-1234' }, closedFor: ALL, method: 'POST', name: 'the first-user route once an account exists', path: '/api/users/first-register', closed: status(403) },
{ body: {}, closedFor: OUTSIDERS, method: 'POST', name: 'Site settings cannot be saved', path: '/api/globals/site-settings', closed: status(403) },
{ closedFor: ALL, name: 'the GraphQL playground (production)', path: '/api/graphql-playground', closed: status(404) },
{ closedFor: ALL, graphql: '{ __schema { queryType { name } } }', closed: ({ body }) => Boolean((body as { errors?: unknown[] })?.errors?.length), name: 'GraphQL introspection (production)' },
// a site without jobs: 404. A site WITH jobs (IAPL 1.18.0): refused (401) for everybody but an admin and
// `Authorization: Bearer <CRON_SECRET>` — drop `closed: status(404)` there
{ closedFor: ALL, name: 'Payload\'s job queue', path: '/api/payload-jobs/run', closed: status(404) },
// the project's own doors: add them here
// { closedFor: OUTSIDERS, body: {}, method: 'PATCH', name: 'pages cannot be changed', path: `/api/pages/${NO_ID}`, closed: status(403) },
]
/** RFC 6238 TOTP (SHA-1, 6 digits, 30 s) for a base32 secret. */
function totp(secret: string): string {
const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'
let bits = ''
for (const ch of secret.replace(/=+$/, '').toUpperCase()) {bits += alphabet.indexOf(ch).toString(2).padStart(5, '0')}
const key = Buffer.from((bits.match(/.{8}/g) ?? []).map((b) => parseInt(b, 2)))
const counter = Buffer.alloc(8)
counter.writeBigUInt64BE(BigInt(Math.floor(Date.now() / 30_000)))
const h = createHmac('sha1', key).update(counter).digest()
return (((h.readUInt32BE(h[h.length - 1]! & 0xf) & 0x7fffffff) % 1_000_000).toString().padStart(6, '0'))
}
async function signIn(caller: Caller, playwright: { request: { newContext: (o: object) => Promise<APIRequestContext> } }): Promise<APIRequestContext | null> {
const api = await playwright.request.newContext({ baseURL: BASE, extraHTTPHeaders: { origin: BASE } })
const env = process.env
if (caller === 'customer') {
if (!env.E2E_CUSTOMER_COLLECTION || !env.E2E_CUSTOMER_EMAIL || !env.E2E_CUSTOMER_PASSWORD) {return null}
expect((await api.post(`/api/${env.E2E_CUSTOMER_COLLECTION}/login`, { data: { email: env.E2E_CUSTOMER_EMAIL, password: env.E2E_CUSTOMER_PASSWORD } })).status()).toBe(200)
}
if (caller === 'editor') {
if (!env.E2E_EDITOR_EMAIL || !env.E2E_EDITOR_PASSWORD || !env.E2E_EDITOR_TOTP_SECRET) {return null}
expect((await api.post('/api/users/login', { data: { email: env.E2E_EDITOR_EMAIL, password: env.E2E_EDITOR_PASSWORD } })).status()).toBe(200)
expect((await (await api.post('/api/verify-totp', { data: { token: totp(env.E2E_EDITOR_TOTP_SECRET) } })).json()).ok).toBe(true)
}
return api
}
for (const caller of ALL) {
test.describe(`closed doors as ${caller}`, () => {
let api: APIRequestContext | null = null
test.beforeAll(async ({ playwright }) => {
api = await signIn(caller, playwright)
})
for (const door of DOORS.filter((d) => d.closedFor.includes(caller))) {
test(door.name, async () => {
test.skip(!api, `no ${caller} test account configured`)
const res = door.graphql
? await api!.post('/api/graphql', { data: { query: door.graphql } })
: await api!.fetch(door.path!, { data: door.body, maxRedirects: 0, method: door.method ?? 'GET' })
const text = await res.text()
let body: unknown = text
try { body = JSON.parse(text) } catch { /* not JSON */ }
expect((door.closed ?? refused)({ body, status: res.status() }), `${door.graphql ?? door.path} → ${res.status()} ${text.slice(0, 200)}`).toBe(true)
})
}
})
}
@@ -0,0 +1,24 @@
/**
* Routes nobody has judged — every public route of this site (REST, GraphQL, Next route files) against the judged
* list in tests/routes.snapshot.json (IAPL docs/security.md "Routes nobody has judged"). Reads the config, never the
* database: the same on MongoDB, Postgres and SQLite. Copy to tests/routes.ts, then:
*
* pnpm payload run tests/routes.ts update → writes tests/routes.snapshot.json, every route with an EMPTY reason
* (write one line per route: who may use it and why it is open, or that it is closed and to whom)
* pnpm payload run tests/routes.ts → fails on a route nobody has judged or an entry without a reason
*
* Run it in CI and after every Payload / IAPL / plugin upgrade; an upgrade that adds a route fails here until somebody
* judges it (`update` adds it with an empty reason; review the diff). `payload run` drops `--flags`: the word is `update`.
*/
import config from '@payload-config'
import { runRouteCheck } from '@intecion/ipal-kit/doctor'
process.exit(
await runRouteCheck({
config: await config,
snapshot: 'tests/routes.snapshot.json',
// appDir: 'src/app', // where the Next routes live
// graphql: false, // a site that deleted app/(payload)/api/graphql
update: process.argv.slice(2).includes('update'),
}),
)
@@ -362,6 +362,16 @@ if [ -n "$UI" ]; then
done done
fi fi
# --- Speed (§6.11b, performance.md) — the doctor's performance group (errors since 1.18.0): images config, fonts,
# render-blocking, embeds, animations, a budget test. Full mode only: the doctor itself runs this audit with --quick.
if [ "$QUICK" -eq 0 ] && [ -x node_modules/.bin/iapl-doctor ]; then
# errors since 1.18.0; a rule the project lowered in iapl-doctor.json comes back as a warning, a silenced one not at all
PERF=$(node_modules/.bin/iapl-doctor --only performance --offline --json 2>/dev/null \
| node -e 'let s="";process.stdin.on("data",(d)=>(s+=d)).on("end",()=>{try{for(const f of JSON.parse(s).findings){if(!f.silenced&&f.severity!=="info"){console.log(`${f.severity==="error"?"E":"W"}|${f.file??"(site)"} [${f.rule}] ${f.message}`)}}}catch{}})')
report ERROR "speed (iapl-doctor --only performance)" "§6.11b / performance.md — each line names the rule; lower or silence one with a reason in iapl-doctor.json" "$(printf '%s\n' "$PERF" | sed -n 's/^E|//p')"
report WARNING "speed, lowered to a warning in iapl-doctor.json" "§6.11b / performance.md" "$(printf '%s\n' "$PERF" | sed -n 's/^W|//p')"
fi
# --- Compile & build --- # --- Compile & build ---
if [ "$QUICK" -eq 0 ]; then if [ "$QUICK" -eq 0 ]; then
echo echo
@@ -46,6 +46,11 @@ Ask only when the brief leaves a business question open (e.g. "do posts have aut
**No URL prefix in code** — the editor assigns the archive page in **No URL prefix in code** — the editor assigns the archive page in
Site settings (`<slug>Archive`). The plugin handles routing, sitemap, Site settings (`<slug>Archive`). The plugin handles routing, sitemap,
generateStaticParams, hreflang. generateStaticParams, hreflang.
**With drafts** (`versions: { drafts: true }`): `access: { read: readPublished(), readVersions: readPublishedVersions() }`
(`readPublished` is for `read`, `readPublishedVersions` for `readVersions` — the version list asks for `version._status`)
— Payload's open `read: () => true` answers `?draft=true` with the draft over REST and GraphQL. Check:
`curl -i <site>/api/<slug>/<draft id>?draft=true` without a session → `404`; the same with an editor's token → the draft;
`curl -s -o /dev/null -w '%{http_code}' <site>/api/<slug>/versions?limit=10` without a session → `200`, never `500`.
3. Entry list = a block (EntriesList) with `getEntries`; the entry page uses 3. Entry list = a block (EntriesList) with `getEntries`; the entry page uses
`resolveRoute` (type `entry`); JSON-LD per seo.md (e.g. Article). `resolveRoute` (type `entry`); JSON-LD per seo.md (e.g. Article).
4. **An auth collection for visitors** (`auth: true`: customers, members) only when the client requires it 4. **An auth collection for visitors** (`auth: true`: customers, members) only when the client requires it
@@ -55,6 +55,14 @@ before analytics or marketing consent — check the project's choice in "Project
`nonce` to `<SiteProviders>`. A visitor who decided must never see the banner on reload; one whose `nonce` to `<SiteProviders>`. A visitor who decided must never see the banner on reload; one whose
decision is from an older Policy version must see it at once. A click on a button before hydration decision is from an older Policy version must see it at once. A click on a button before hydration
counts (the checks above click as soon as the button is visible). counts (the checks above click as soon as the button is visible).
7. Cookie button (1.18.0, consent.md → "Where the cookie button sits"): after a decision, on a long page, a short
page and a page with a form, desktop and phone width (also 360 px) — the button is in the bottom corner of the
window at the top, in the middle, with the footer in view and at the very end: it must not move at all. At the
very end nothing of the footer is under it and the last footer link can be tapped (the footer has grown a little:
`[data-ipal-cookie-space]` on it). Before a decision and while the banner is open the footer has its own padding
only. Tab reaches the button and Enter reopens the banner. A project scroll handler, a button rendered inside
the footer or hand-made bottom padding for it → remove (AGENT.md §7). Too much or too little room:
`--ipal-cookie-button-space` on the footer; none: `reserve={false}`.
The script needs buttons with `data-ipal="accept"` / `"reject"` — the plugin's The script needs buttons with `data-ipal="accept"` / `"reject"` — the plugin's
`CookieBanner` has them in every `settings` mode (`inline`, `modal`, `detailed`). A custom banner in the project violates AGENT.md §7. `CookieBanner` has them in every `settings` mode (`inline`, `modal`, `detailed`). A custom banner in the project violates AGENT.md §7.
+17 -2
View File
@@ -34,11 +34,23 @@ through this procedure. Ask only when you are missing something you cannot get y
### Build / TypeScript ### Build / TypeScript
| Symptom | Cause | Fix | | Symptom | Cause | Fix |
|---|---|---| |---|---|---|
| the 2FA code screen answers "Too many codes were tried…" (`429` from `/api/verify-totp`) | more than 5 verify attempts for that account in 10 minutes (`twoFactor.verifyLimit`); repeated lines `[iapl] 2FA: too many verify attempts` in the log without the owner trying = someone has the password | wait for the window, enter the current code once; unexplained attempts: change that account's password. Tests that log in often: `verifyLimit: { max: … }` for that environment | | a panel button (mail service Connect / Disconnect, Send test e-mail, cookie scan / approve / check site) answers `403` "Not allowed from this origin."; log `[iapl] a panel action from origin "…" was refused` | the request's origin is not one the site knows (1.18.0, `adminSameOrigin`): a reverse proxy that rewrites `Host` and sends no `X-Forwarded-Host`, and no `serverURL` | set `serverURL: process.env.NEXT_PUBLIC_SERVER_URL` in the Payload config, or make the proxy send `X-Forwarded-Host`, or `adminSameOrigin: { origins: ['https://…'] }`; `iapl-doctor` `csrf-empty` |
| a staff account's correct password gets "The email or password provided is incorrect." | the account is locked by Payload after `maxLoginAttempts` wrong passwords (5, for `lockTime`, 10 min); since 1.18.0 a locked staff account gets the wrong-password answer (`accounts.lockedAnswer`) | wait for the lock to end, or an admin unlocks it (the account in the panel, or `POST /api/users/unlock`); `lockUntil` on the account shows it. Payload's own message back: `accounts: { lockedAnswer: 'payload' }` |
| a sign-in answers `429` "Too many failed sign-ins to this address from here" | 5 failed sign-ins for that address from that client IP in 15 minutes (`accounts.signInLimit`, 1.18.0); everybody behind one IP shares it (an office NAT); without `IAPL_IP_HEADER` everybody may share the no-IP bucket | wait the minutes it names, or sign in from elsewhere; pin `IAPL_IP_HEADER`; more room: `signInLimit: { perAddress: 10 }` |
| staff login / "forgot password" answers `403` and the log says `[iapl] a staff sign-in from origin "…" was refused` | the request came from another origin (`accounts.signInSameOrigin`, 1.18.0): a front end on another domain, or a proxy that rewrites `Host` without `serverURL` | set `serverURL`, or `signInSameOrigin: { origins: ['https://…'] }` |
| saving one's own account answers "Enter your current password to change your e-mail address or password." | `accounts.confirmOwnChanges` (1.18.0): own e-mail / username / password changes need the current password | type it in "Current password" on the account page; scripts send `currentPassword`; off: `confirmOwnChanges: false` |
| the 2FA code screen answers "Too many codes were tried…" (`429` from `/api/verify-totp`) | more than 5 wrong codes for that account in 10 minutes (`twoFactor.verifyLimit`; right codes do not count since 1.17.1). "…being checked right now. Try again in a moment." (`Retry-After: 2`) = several attempts of one account at the same moment, nothing is locked; repeated lines `[iapl] 2FA: too many verify attempts` in the log without the owner trying = someone has the password | wait for the window, enter the current code once; unexplained attempts: change that account's password. Tests that log in often: `verifyLimit: { max: … }` for that environment |
| `isAdmin(req.user)` says `false` for a real administrator on the server, in a process that loads two Payload configs (tests, a multi-site script) | a call without a source counts only collections that are staff in **every** config of the process | pass the source: `isAdmin(req.user, req.payload)` — with it each config gets its own answer | | `isAdmin(req.user)` says `false` for a real administrator on the server, in a process that loads two Payload configs (tests, a multi-site script) | a call without a source counts only collections that are staff in **every** config of the process | pass the source: `isAdmin(req.user, req.payload)` — with it each config gets its own answer |
| `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()`, imported from `@intecion/ipal-kit/client`; in middleware `isAdmin(user, { staffCollections: ['users'] })` | | `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()`, imported from `@intecion/ipal-kit/client`; in middleware `isAdmin(user, { staffCollections: ['users'] })` |
| `next build --webpack`: `'server-only' cannot be imported from a Client Component module … caused by importing '@intecion/ipal-kit/dist/index.js'` | a `'use client'` file imports the main entry (Turbopack lets it pass) | import from `@intecion/ipal-kit/client` (role predicates are there since 1.16.7; types: `import type` from the main entry is fine); data the browser needs → a prop from a server component | | `next build --webpack`: `'server-only' cannot be imported from a Client Component module … caused by importing '@intecion/ipal-kit/dist/index.js'` | a `'use client'` file imports the main entry (Turbopack lets it pass) | import from `@intecion/ipal-kit/client` (role predicates are there since 1.16.7; types: `import type` from the main entry is fine); data the browser needs → a prop from a server component |
| an account logs in but every page and request answers 403 / the setup screen says "The time to set up two-step verification has passed" | 2FA setup required: the account did not set TOTP up within the window (72 h from its creation, an admin's reset, or the first start after the upgrade) | an administrator opens the account in the panel → Two-step verification → "Reopen setup" (or `POST /api/ipal/two-factor/reset` `{ userId }`); every administrator is blocked: security.md "Every administrator is blocked" — a script with the Local API, `payload.update({ collection: 'users', id, data: { totpSetupFrom: new Date().toISOString() } })` (`pnpm payload run`), then log in and set TOTP up; or `requireSetup: { windowHours: false }`, redeploy, set up, put it back | | an account logs in but every page and request answers 403 / the setup screen says "The time to set up two-step verification has passed" | 2FA setup required: the account did not set TOTP up within the window (72 h from its creation, an admin's reset, or the first start after the upgrade) | an administrator opens the account in the panel → Two-step verification → "Reopen setup" (or `POST /api/ipal/two-factor/reset` `{ userId }`); every administrator is blocked: security.md "Every administrator is blocked" — a script with the Local API, `payload.update({ collection: 'users', id, data: { totpSetupFrom: new Date().toISOString() } })` (`pnpm payload run`), then log in and set TOTP up; or `requireSetup: { windowHours: false }`, redeploy, set up, put it back |
| a REST / GraphQL list from the front end returns only 100 documents (`hasNextPage: true`) although `limit` asks for more | `listLimit` (1.18.0, audit F4): callers that are not staff get at most 100 per request; staff and the Local API are not capped | page through (`page=2`), read on the server with the Local API, or `iapl({ listLimit: { max: 500 } })` / `{ exclude: ['slug'] }` / `false` (security.md "Lists and sorting") |
| `GET /api/<collection>?sort=$…` answers `400` "This sort field is not allowed." | `refuseOperatorSort` (1.18.0, audit F5): a sort naming a database operator is refused | sort by a field name; `refuseOperatorSort: false` = Payload's behaviour |
| a visitor account (customer) gets `403` on `/api/payload-locked-documents` | `lockedDocuments` (1.18.0): Payload's document locks are for staff only | intended; your own rule: `lockedDocuments: { access: { read } }`, or `false` |
| `[csp]` log lines show only `blocked=https://host` and `page=/path` (no query), or some reports are missing | `createCspReportRoute` (1.18.0, audit F1): the default line keeps origins and paths, at most 10 violations per request and 60 requests per client a minute | your own `onReport` gets the raw values; `maxReports`, `rateLimit: false` |
| a CDN or Varnish serves Markdown to visitors of an HTML page, or `Accept: text/markdown` answers `public, s-maxage` | a proxy of your own rewrites to `/md/…` without the 1.18.0 headers, or IAPL < 1.18.0 | `createProxy({ markdown: true })`, or copy `MARKDOWN_NEGOTIATED_HEADER` / `appendVary` into your proxy (content.md "content negotiation"); purge the CDN |
| saving a social profile / website address answers "Enter a full address, e.g. https://example.com." | `buildUrlField` (1.18.0, audit F2) accepts `https://` / `http://` and the `schemes` you list | type the full address; `buildUrlField({ schemes: ['mailto', 'tel'] })` for more kinds |
| after typing the code the setup screen says "we sent a link to …" / "the confirmation e-mail could not be sent", and nothing opens | 1.18.0 `twoFactor.confirmByEmail`: the first set-up waits for the link sent to the account's e-mail, opened in the browser that scanned the code | open the link in that browser, then sign in again; no mail: the link is in the server log (`[iapl] 2FA: … Link`), or an admin opens the account → "Confirm the waiting set-up"; fix e-mail (doctor `2fa-enrolment-mail`); "open this link in the browser where you scanned the code" = scan again in the browser you read mail in |
| a new account gets `403` from the API although its role allows the request | 2FA setup required: until TOTP is set up the account reaches only the setup screen | set TOTP up (log in to the panel); an integration: use an API key, or `twoFactor.requireSetup.exempt` | | a new account gets `403` from the API although its role allows the request | 2FA setup required: until TOTP is set up the account reaches only the setup screen | set TOTP up (log in to the panel); an integration: use an API key, or `twoFactor.requireSetup.exempt` |
| after an upgrade EVERY panel login answers `500` (also `/api/users/init`), administrators with 2FA included; log: `[iapl] 2FA: the column for "totpSetupFrom" is missing … NOBODY CAN LOG IN` or `column users.totp_setup_from does not exist` | Postgres/SQLite: the migration that adds the 2FA column has not run (needed whenever 2FA is on) | `pnpm payload migrate:create` if no migration has it, commit, and redeploy with migrations run when the new container starts — `prodMigrations` in the adapter or the start command `pnpm payload migrate && pnpm start` (deployment.md §4.3; not Coolify's Pre-deployment command, which runs in the old container); nothing is lost. `iapl-doctor` reports a project whose migrations lack `totp_setup_from` | | after an upgrade EVERY panel login answers `500` (also `/api/users/init`), administrators with 2FA included; log: `[iapl] 2FA: the column for "totpSetupFrom" is missing … NOBODY CAN LOG IN` or `column users.totp_setup_from does not exist` | Postgres/SQLite: the migration that adds the 2FA column has not run (needed whenever 2FA is on) | `pnpm payload migrate:create` if no migration has it, commit, and redeploy with migrations run when the new container starts — `prodMigrations` in the adapter or the start command `pnpm payload migrate && pnpm start` (deployment.md §4.3; not Coolify's Pre-deployment command, which runs in the old container); nothing is lost. `iapl-doctor` reports a project whose migrations lack `totp_setup_from` |
| the site does not start: `[iapl] twoFactor.requireSetup.exempt must not be async` / `…windowHours must be a number` | `exempt` is an `async` function, or `windowHours` is a string / negative | `exempt: ({ user }) => user.email === '…'` (returns `true` / `false` at once); `windowHours: 72` or `false` | | the site does not start: `[iapl] twoFactor.requireSetup.exempt must not be async` / `…windowHours must be a number` | `exempt` is an `async` function, or `windowHours` is a string / negative | `exempt: ({ user }) => user.email === '…'` (returns `true` / `false` at once); `windowHours: 72` or `false` |
@@ -100,6 +112,9 @@ through this procedure. Ask only when you are missing something you cannot get y
| pixel before consent (consent-check) | script wired by hand (`<Script>`) | only through the panel → `<Analytics>` (GA/GTM/pixels) or `<ConsentScript>` (analytics.md, consent.md) | | pixel before consent (consent-check) | script wired by hand (`<Script>`) | only through the panel → `<Analytics>` (GA/GTM/pixels) or `<ConsentScript>` (analytics.md, consent.md) |
| banner without styles | Tailwind does not scan the plugin | `@source` on `node_modules/@intecion/ipal-kit/dist/**/*.js` (path relative to the CSS file, PROGRAMISTA §2.5) | | banner without styles | Tailwind does not scan the plugin | `@source` on `node_modules/@intecion/ipal-kit/dist/**/*.js` (path relative to the CSS file, PROGRAMISTA §2.5) |
| emails are not sent | no `email: mailAdapter()` / empty Emails tab of the form / the transport fails | Site integrations → E-mail sending: read the block "How e-mails are sent" and the banner's code, then **Send test e-mail**; rows below; email.md | | emails are not sent | no `email: mailAdapter()` / empty Emails tab of the form / the transport fails | Site integrations → E-mail sending: read the block "How e-mails are sent" and the banner's code, then **Send test e-mail**; rows below; email.md |
| e-mails are not sent; state block: "Your SMTP server is chosen, but its settings are incomplete" / "Microsoft Graph is chosen, but it is not set up on this server" (status `smtp-incomplete` / `graph-not-set-up`, doctor `mail-method` error) | the chosen "Sending method" cannot be used, and since 1.17.1 nothing is sent another way | fill in server, user name and password / set the `GRAPH_*` variables — or choose another method (IWSN needs nothing) and save |
| Site integrations does not open after the upgrade to 1.17.1 (Postgres / SQLite); log: "the column for \"emailMethod\" … is missing"; doctor `mail-method` error | the migration that adds the column has not run (mail still leaves the old way) | `pnpm payload migrate:create`, commit, apply at container start |
| the site switched how it sends after a field or a variable changed | nobody has chosen the "Sending method" yet (doctor `mail-method` info): the site still picks by the order of 1.17.0 | nothing, if that is wanted (the owner's rule: no change until another option is picked); to fix it: pick the method (another option, then this one) or `setMailMethod(payload, '<method>')` |
| state block: "Not connected yet" on the production domain | no e-mail was sent yet | **Send test e-mail** (the site enrols on its first send) or "Connect again" | | state block: "Not connected yet" on the production domain | no e-mail was sent yet | **Send test e-mail** (the site enrols on its first send) or "Connect again" |
| `relay-refused` / "The mail service could not reach this site at …" (cause `callback-failed`) | `unreachable` / `timeout`: firewall, private network, wrong public host in `serverURL`; `redirect`: `trailingSlash: true`, apex → `www`, a language redirect; `status`: route blocked, missing (`mail: { relay: false }`?) or another `routes.api`; `confirmation`: a proxy rewrites the answer | `curl -i -X POST https://<host>/api/iapl/mail-relay/confirm -d '{}' -H 'content-type: application/json'` must answer **404 with an empty body, no redirect**; fix `serverURL` / `mail.relay.host`, or ask Intecion to set the site's confirm address (path ending in `/confirm/` with trailing slashes); then "Connect again" (the site does not retry by itself for 15 min). email.md "When the site cannot be confirmed" | | `relay-refused` / "The mail service could not reach this site at …" (cause `callback-failed`) | `unreachable` / `timeout`: firewall, private network, wrong public host in `serverURL`; `redirect`: `trailingSlash: true`, apex → `www`, a language redirect; `status`: route blocked, missing (`mail: { relay: false }`?) or another `routes.api`; `confirmation`: a proxy rewrites the answer | `curl -i -X POST https://<host>/api/iapl/mail-relay/confirm -d '{}' -H 'content-type: application/json'` must answer **404 with an empty body, no redirect**; fix `serverURL` / `mail.relay.host`, or ask Intecion to set the site's confirm address (path ending in `/confirm/` with trailing slashes); then "Connect again" (the site does not retry by itself for 15 min). email.md "When the site cannot be confirmed" |
| `relay-refused`, cause `host-not-allowed` / "This site has no public address yet" | the site runs on `localhost`, a private name, or `serverURL` is empty | expected in development (use SMTP / Mailpit there); in production set `serverURL` | | `relay-refused`, cause `host-not-allowed` / "This site has no public address yet" | the site runs on `localhost`, a private name, or `serverURL` is empty | expected in development (use SMTP / Mailpit there); in production set `serverURL` |
@@ -107,7 +122,7 @@ through this procedure. Ask only when you are missing something you cannot get y
| a site sends nothing: "The data comes from another site (…), so this copy does not send e-mails by itself" / `relay-refused`, cause `client-other-host` | the site is non-public — its host matches `developmentHosts` (built in: `*.dev.netscale.pl`) or `IAPL_NOINDEX=1` is set; `iapl-doctor --deep` says which (`mail-non-public`) — and its database holds another host's connection: a staging copy of production, or production's data copied back onto the development address. Expected — a copy with production's data must not mail real people by itself | should it send: "Connect again" in the state block, once (until the data is replaced). A copy that must never send: `mail: { relay: false }` or SMTP to a catcher. **The production site itself says this:** `IAPL_NOINDEX` was left set after launch — remove it; or its host matches a development pattern — take it out of `iapl({ developmentHosts })` | | a site sends nothing: "The data comes from another site (…), so this copy does not send e-mails by itself" / `relay-refused`, cause `client-other-host` | the site is non-public — its host matches `developmentHosts` (built in: `*.dev.netscale.pl`) or `IAPL_NOINDEX=1` is set; `iapl-doctor --deep` says which (`mail-non-public`) — and its database holds another host's connection: a staging copy of production, or production's data copied back onto the development address. Expected — a copy with production's data must not mail real people by itself | should it send: "Connect again" in the state block, once (until the data is replaced). A copy that must never send: `mail: { relay: false }` or SMTP to a catcher. **The production site itself says this:** `IAPL_NOINDEX` was left set after launch — remove it; or its host matches a development pattern — take it out of `iapl({ developmentHosts })` |
| the site does not start: "[iapl] … developmentHosts must be an array of host patterns …" | the list is not an array of non-empty host patterns (a single string, `null`, `['']`), or holds a lone `*` | write it as `['*.dev.netscale.pl', 'staging.client.pl']`; `[]` = none; to change who waits use `mail.relay.otherHosts` | | the site does not start: "[iapl] … developmentHosts must be an array of host patterns …" | the list is not an array of non-empty host patterns (a single string, `null`, `['']`), or holds a lone `*` | write it as `['*.dev.netscale.pl', 'staging.client.pl']`; `[]` = none; to change who waits use `mail.relay.otherHosts` |
| a staging or test copy **does** send, to real addresses | its host matches no development pattern and it has no `IAPL_NOINDEX=1`, so it looks like a launch (a public site enrols by itself); the doctor's deep run notes "the database also holds the mail-service connection of another host" | name its host in `iapl({ developmentHosts: ['*.dev.netscale.pl', '<the copy's pattern>'] })`, or `IAPL_NOINDEX=1` on the copy; to be sure: `mail: { relay: false }` or SMTP to a catcher | | a staging or test copy **does** send, to real addresses | its host matches no development pattern and it has no `IAPL_NOINDEX=1`, so it looks like a launch (a public site enrols by itself); the doctor's deep run notes "the database also holds the mail-service connection of another host" | name its host in `iapl({ developmentHosts: ['*.dev.netscale.pl', '<the copy's pattern>'] })`, or `IAPL_NOINDEX=1` on the copy; to be sure: `mail: { relay: false }` or SMTP to a catcher |
| `relay-pending` / "waiting for approval" | while the service runs with enrolment "pending" (from its launch until Intecion switches to open enrolment), every new site waits for approval; after that, the exception (many new sites at once, or approval by hand) | Intecion approves it on the service; nothing to change on the site; the same token then works | | `relay-pending` / "Waiting for confirmation" / doctor `mail-relay-connect` | a new site waits until a person of Intecion confirms it (contract 1.8.0) | Site integrations → E-mail sending → "Połącz z IWSN"; the person signs in with an @intecion.com address on the page that opens and presses "Potwierdź"; the block turns "Connected" by itself. "Waiting for approval" with no button, or "the confirmation page is not available": Intecion confirms the host by hand. "Too many confirmation links": wait the minutes it says. The same token works afterwards |
| `relay-suspended` | Intecion stopped the site (abuse, a flood from a form) | contact Intecion; fill in SMTP meanwhile | | `relay-suspended` | Intecion stopped the site (abuse, a flood from a form) | contact Intecion; fill in SMTP meanwhile |
| `relay-disconnected` | an admin pressed "Disconnect" | "Connect again", or SMTP | | `relay-disconnected` | an admin pressed "Disconnect" | "Connect again", or SMTP |
| `relay-quota` | the site's hour or day is used up (30 / 200 by default), more than 10 recipients, more than 10 confirmations to one address a day, too many new addresses, or the site's own limit on account mail (`mail.relay.accountMail`) | the server log names the limit; look for a form being abused (Turnstile on? rate limit?); a site that really sends more: Intecion raises the limits, or SMTP | | `relay-quota` | the site's hour or day is used up (30 / 200 by default), more than 10 recipients, more than 10 confirmations to one address a day, too many new addresses, or the site's own limit on account mail (`mail.relay.accountMail`) | the server log names the limit; look for a form being abused (Turnstile on? rate limit?); a site that really sends more: Intecion raises the limits, or SMTP |
+22 -2
View File
@@ -1,6 +1,6 @@
--- ---
name: iapl-doctor name: iapl-doctor
description: Checks the whole site against the IAPL team standard with one command (`pnpm exec iapl-doctor`) — plugin, Next, sharp and Node versions, the AGENT.md §3 folder layout and naming, database names (<domain>_dev/_prod), env rules, security headers, X-Powered-By, CSP, 2FA, the cookie scanner, adminMeta/agency, AGENTS.md "Project decisions", current iapl-* skills, seeds (createSeeder, SEED_ONLY, no deletes), the block library, pnpm audit, hardcoded texts, and with --url / --deep the running site and the database. Use after setting up a site, after an IAPL upgrade, before a deploy, in CI of a new site, and when asked whether a site follows the team rules. description: Checks the whole site against the IAPL team standard with one command (`pnpm exec iapl-doctor`) — plugin, Next, sharp and Node versions, the AGENT.md §3 folder layout and naming, database names (<domain>_dev/_prod), env rules, security headers, X-Powered-By, CSP, 2FA, the cookie scanner, adminMeta/agency, AGENTS.md "Project decisions", current iapl-* skills, seeds (createSeeder, SEED_ONLY, no deletes), the block library, pnpm audit, hardcoded texts, speed (the performance rules — errors) and what grows (sizes, versions, retention, unused media), and with --url / --deep the running site and the database. Use after setting up a site, after an IAPL upgrade, before a deploy, in CI of a new site, and when asked whether a site follows the team rules.
--- ---
# iapl-doctor # iapl-doctor
@@ -25,11 +25,16 @@ Full reference: `node_modules/@intecion/ipal-kit/docs/doctor.md`.
with the Intecion mail service (IWSN in the panel): waiting for approval, stopped, refused, disconnected, a replaced sender name), with the Intecion mail service (IWSN in the panel): waiting for approval, stopped, refused, disconnected, a replaced sender name),
`mail-reply-address`, `mail-graph-deprecated`, `mail-relay-route` (trailing slashes, another API route, a redirect or a `mail-reply-address`, `mail-graph-deprecated`, `mail-relay-route` (trailing slashes, another API route, a redirect or a
block in front of `/api/iapl/mail-relay/confirm`) — fixes: `iapl-debug` "Consent / analytics / forms / email". block in front of `/api/iapl/mail-relay/confirm`) — fixes: `iapl-debug` "Consent / analytics / forms / email".
**Speed (`perf-*`) findings are errors since 1.18.0** (images config, fonts, render-blocking, embeds, animations,
a budget test; `--url`: compression, blocking scripts, font preloads, a lazy first image, HTML size; `--deep`:
oversized stored images) — the `iapl-performance` skill. The `growth-*` findings stay warnings and infos.
4. A deliberate exception (the owner's decision) goes into `iapl-doctor.json` **with a reason** — the same reason as in 4. A deliberate exception (the owner's decision) goes into `iapl-doctor.json` **with a reason** — the same reason as in
AGENTS.md "Project decisions". Never silence a rule just to make the run pass: AGENTS.md "Project decisions". Never silence a rule just to make the run pass:
```json ```json
{ "rules": { "i18n-literals": { "off": true, "files": ["src/components/design/**"], "reason": "approved exception: styleguide labels" } } } { "rules": { "i18n-literals": { "off": true, "files": ["src/components/design/**"], "reason": "approved exception: styleguide labels" } } }
``` ```
A speed rule the client accepts is lowered rather than silenced, so it stays in the report:
`"perf-fonts": { "severity": "warning", "reason": "the client's brand font, replaced in Q1" }`.
Keys: `off`, `severity`, `reason` (required), `until` (ISO date), `files` (globs). Top level: `domain`, `launched`, Keys: `off`, `severity`, `reason` (required), `until` (ISO date), `files` (globs). Top level: `domain`, `launched`,
`layout.allow`, `layout.frontend` (the pages' folder, e.g. `src/app/(site)` — found by structure otherwise; any route `layout.allow`, `layout.frontend` (the pages' folder, e.g. `src/app/(site)` — found by structure otherwise; any route
group name works), `seen` (written by the doctor), `extraRules`. group name works), `seen` (written by the doctor), `extraRules`.
@@ -41,6 +46,19 @@ Full reference: `node_modules/@intecion/ipal-kit/docs/doctor.md`.
`--url <url>` · `--staging` (must be noindex) · `--admin-route <path>` · `--deep` · `--env-file <prod export>` (checks `--url <url>` · `--staging` (must be noindex) · `--admin-route <path>` · `--deep` · `--env-file <prod export>` (checks
`<domain>_prod`) · `--only` / `--skip <ids,groups>` · `--sites '../*-web'` (a read-only rule × site table, exit 0). `<domain>_prod`) · `--only` / `--skip <ids,groups>` · `--sites '../*-web'` (a read-only rule × site table, exit 0).
**Security checks only** (security.md "Security suites"): `pnpm exec iapl-doctor --only security` — headers, CSP,
2FA, account rules, plus the static rules over the project's own code (`code-patterns`: unescaped HTML / JSON-LD,
`overrideAccess: true` or a Local API `user` without `overrideAccess: false` where a request reaches, a `where` from
the request, `eval`, `NEXT_PUBLIC_` secrets, redirects and fetches to an address from the request) and its configs
(`config-dangerous`). With `--url https://<domain>` also `live-probes`: the plugin's attack probes that change
nothing, run against the real site (secret files, bundle secrets, proxy bypass, open redirects, cache poisoning,
NoSQL operators, anonymous where / draft / GraphQL reads, error leaks, unbounded lists, `/_next/image`). Verify: on a
fresh starter site the run lists no `code-*` finding; add `eval(x)` to a page and `code-eval` appears. A correct
place is marked `// iapl-security-ok: <why>`. From 1.18.0 a site on IAPL's defaults passes every probe; `markdown-vary`,
`unbounded-list` or `sort-operator` on such a site means a fix was turned off (`markdown: { negotiate }` with a proxy
of its own, `listLimit: false`, `refuseOperatorSort: false`) — security.md "Lists and sorting"; silence the rule with
the reason when that was the decision.
Exit `0` ok · `1` findings at or above `--fail-on` · `2` could not run · `3` a rule crashed. Exit `0` ok · `1` findings at or above `--fail-on` · `2` could not run · `3` a rule crashed.
## CI of a new site (starter, reference site) ## CI of a new site (starter, reference site)
@@ -56,7 +74,9 @@ Existing client sites are not gated on it; run it there as a report only.
`GET /api/ipal/doctor` is added by `iapl` and answers 404 until the site has `IAPL_DOCTOR_TOKEN` (≥ 32 characters). `GET /api/ipal/doctor` is added by `iapl` and answers 404 until the site has `IAPL_DOCTOR_TOKEN` (≥ 32 characters).
Then `Authorization: Bearer <token>`; counts and states only (`usersWithout2fa`, `usersSetupClosed` = of those, blocked because the 2FA setup window has passed, `pendingCookies`, `openSignUp` = slugs of auth collections with open sign-up, `turnstile` = the recorded state of the Turnstile check, `turnstileSecretFromEnv`, `plugin`, `node`) — never a key or a name. With the same Then `Authorization: Bearer <token>`; counts and states only (`usersWithout2fa`, `usersSetupClosed` = of those, blocked because the 2FA setup window has passed, `pendingCookies`, `openSignUp` = slugs of auth collections with open sign-up, `turnstile` = the recorded state of the Turnstile check, `turnstileSecretFromEnv`, `plugin`, `node`) — never a key or a name. With the same
`IAPL_DOCTOR_TOKEN` in the doctor's environment, `--url` reads it. Off: `iapl({ doctor: false })`; adapt: `IAPL_DOCTOR_TOKEN` in the doctor's environment, `--url` reads it. Off: `iapl({ doctor: false })`; adapt:
`iapl({ doctor: { tokenVar, access } })`. `iapl({ doctor: { tokenVar, access } })`. `access` returns a boolean (`({ req }) => isAdmin(req.user, req.payload)`):
since 1.18.0 only a literal `true` allows — `({ req }) => req.user` (an object) refuses — and any other answer is
reported once in the server log (`strictAccessAnswers: false` gives the old truthy reading back).
## Env the doctor reads ## Env the doctor reads
+3 -1
View File
@@ -35,4 +35,6 @@ Requires the UI primitives from `../iapl-block/resources/section-code.md` (like
## Verification ## Verification
The **iapl-audit** skill. By hand: a menu item added in the panel is visible right after The **iapl-audit** skill. By hand: a menu item added in the panel is visible right after
saving; the mobile menu works with the keyboard (Tab, Enter, Esc). saving; the mobile menu works with the keyboard (Tab, Enter, Esc). A menu item that points at a page never
published is not shown (since 1.18.0 the helpers leave draft pages out; `createContentHelpers({ draftRelations:
'keep' })` shows it as before): publish the page and the item appears.
@@ -0,0 +1,72 @@
---
name: iapl-performance
description: Makes and keeps an IAPL site fast — page loading (LCP image, fonts, nothing render-blocking, static rendering), elements (lazy below the fold, reserved space, click-to-load embeds), animations (transform/opacity, reduced motion, no scroll handlers), resources (only the JS a page uses, compression, no third-party request before consent), images (AVIF/WebP, sizes, upload limits) and the server (queries per render, depth, select, caching); what grows in the database and on disk over the years (logs and their retention, form submissions, versions, KV, unused media, the image cache). Measures the built site, runs the doctor's performance group, and adds the budget gate that fails when a change makes the site slower. Use when building pages or blocks, before handing over, after an IAPL upgrade, and whenever "slow", PageSpeed, Lighthouse, Core Web Vitals, LCP, CLS, INP, a growing database or disk come up.
---
# iapl-performance
The handbook is `node_modules/@intecion/ipal-kit/docs/performance.md`: what the plugin does for you, what the project
must do, how to measure, how to read the findings. This skill is the order of work.
## 1. Check what the plugin cannot do for you (code)
```bash
pnpm exec iapl-doctor --only performance # images config, fonts, render-blocking, embeds, animations, budget test
bash .agents/skills/iapl-audit/scripts/audit.sh --quick # <img>/<video> outside Media, priority outside the hero, YouTube iframe, h-screen
```
These are **errors** since 1.18.0 (`iapl-doctor` fails). Fix each — it names the file, the fix and the doc. When the
client accepts one (a brand font, a map that is the page's content), lower it with a reason in `iapl-doctor.json`
(`"perf-fonts": { "severity": "warning", "reason": "…" }`) or silence it (`"off": true`, optionally `until`), and record
it in AGENTS.md → Project decisions. The rules that matter most:
| Area | Do | Never |
|---|---|---|
| LCP image | `<Media priority>` on the first image of the page — **one** per page; a header logo gets `eager` | `priority` on many images; a lazy hero; the hero as a CSS background |
| layout shift | content that arrives late keeps its space: the lazy 404's `placeholder` (its content's height), the Turnstile widget's 73 px (kept by the plugin) | an empty box a widget or a server action fills later |
| other images | `<Media sizes={MEDIA_SIZES.third}>` — the width on screen; lazy by default | no `sizes`; a plain `<img>` |
| fonts | `next/font` (self-hosted), ≤ 2 families, variable, `display: 'swap'`, the heading font `preload: false` | a `<link>` to Google Fonts; `display: 'block'` |
| scripts | the plugin's `Analytics` / `ConsentScript`; `next/script` for anything else | a `<script src>` without `async` in the layout |
| embeds | `<YouTubeEmbed>`; a map or widget behind a click (a picture + a button) | an `<iframe>` that loads with the page |
| animations | `transform` / `opacity` only; the token durations (`duration-fast`) or `motion-reduce:` | animating `height`, `top`, `margin`; `transition-all`; a `scroll` listener (use IntersectionObserver) |
| client code | small `'use client'` leaves; server components by default; forms through `RenderForm` / `BuilderForm` from `/client` (their code loads only where a form is shown) | a whole section `'use client'`; importing `/client/eager` without a reason |
| server | the plugin's cached helpers (`lib/content`), `depth` as low as the page needs, `select` for one field | `findGlobal` without `cache()`; `depth: 2` "to be safe"; a query per list item |
## 2. Measure the built site
```bash
pnpm build && pnpm start # dev numbers mean nothing
pnpm exec iapl-doctor --url http://localhost:3000 --only perf-live # compression, blocking scripts, preloads, lazy hero, HTML size
pnpm exec iapl-doctor --deep --only perf-images # stored images over 1.5 MB / 2560 px
```
Lab numbers per page (phone on Slow 4G with a 4× slower CPU, and desktop): copy `resources/perf-lab.mjs` and
`resources/performance.spec.template.ts` (→ `e2e/performance.spec.ts`), list one page of each template, run
`pnpm test:e2e e2e/performance.spec`, then set each budget to what you measured plus ~20 %. From then on the test fails when
a change makes a page slower. PageSpeed Insights on the deployed site shows the field data (real visitors).
## 3. Read the result
- **LCP** > 2.5 s on the phone: the LCP element is named in the measurement (`lcpElement`). An image → `priority`,
`sizes`, a smaller upload; text → a font that arrives late (fewer preloaded files).
- **CLS** > 0.1: an image without dimensions (use `Media`), content that arrives after hydration (the lazy 404 —
`createNotFoundPage({ load, placeholder })`), a font swap (next/font sets fallback metrics).
- **TBT / INP**: long tasks — a big client component, a scroll handler, a third-party widget at start.
- **JS bytes**: what the page ships; import client components from `@intecion/ipal-kit/client` freely — since
1.18.0 a page carries only the ones it renders.
- **Queries per render** (the reference gate counts them): over 30 for an ordinary page → a missing `cache()`, a
`depth` too high, or a loop of `findByID`.
## 4. What grows (performance.md §6)
```bash
pnpm exec iapl-doctor --deep --only growth # counts and sizes per collection, oldest records, versions, expired KV, unused media, disk
```
- Logs purge themselves (consent log 1095 days, statistics 90). Form submissions are kept unless
`iapl({ forms: { submissionRetentionDays } })` — ask the client (personal data) and record it in AGENTS.md.
- Versions: where you turn them on, `versions: { maxPerDoc: 20 }` (globals `max`); never `0`.
- Unused media: `iapl({ unusedMedia: true })` (then `pnpm generate:importmap`) shows them above the Media list with a
link to Payload's filtered list; the editor deletes them there. The plugin never deletes media or submissions by itself.
- MongoDB: the consent log and statistics are deleted by TTL indexes at their retention (`ttlIndex: false` turns that off).
- Coolify: no persistent volume on `.next` (the image cache starts empty on each deploy); database backups on the
MongoDB resource.
- Thresholds of the findings: `iapl-doctor.json` → `growth`.
## 5. Before "done"
`iapl-doctor --only performance` without errors (each exception lowered or silenced with a reason in `iapl-doctor.json`),
the budget test green, and the numbers in `AGENTS.md` → "Project decisions" when the client accepted an exception
(a heavy font, a third-party widget).
@@ -0,0 +1,175 @@
/**
* Lab measurements of one page in Chromium (Playwright + the DevTools protocol) — used by `pnpm perf:measure`
* (scripts/perf-measure.mjs, numbers for docs/performance.md) and by the budget gate (e2e/performance.spec.ts).
*
* Profiles follow Lighthouse's defaults so the numbers compare with PageSpeed Insights' lab data:
* - mobile: 412×823 at DPR 1.75, "Slow 4G" (150 ms RTT, 1.6 Mbit/s down, 750 kbit/s up), CPU 4× slower;
* - desktop: 1350×940, 40 ms RTT, 10 Mbit/s, CPU 1×.
* Every run is a fresh browser context (empty HTTP cache, no cookies): a first visit, the worst ordinary case.
*
* What is measured (all from the browser itself, web.dev/articles/vitals):
* ttfb, fcp, lcp (+ the LCP element: tag, src, loading, fetchpriority), cls (session windows, as web-vitals does),
* tbt (sum of long-task time over 50 ms between FCP and the end of the run: the lab stand-in for INP),
* inp (the longest Event Timing entry of one scripted interaction: a click on the page's first visible button),
* scriptMs (CDP Performance.ScriptDuration: parse, compile, run and hydrate), requests, bytes per type
* (transfer size, compressed), renderBlocking (resource timing renderBlockingStatus), thirdParty (requests to
* another origin before any consent is given). Next's link prefetches (`?_rsc=`, made when the browser is idle) are
* counted apart (`prefetches`): they are not part of the page's load and come at a different moment each run.
* Option `blockThirdParty` (the gate): requests to another origin are recorded, then aborted — a slow external host
* cannot hold the page's load event, and the numbers are the site's own.
*/
import { chromium } from '@playwright/test'
export const PROFILES = {
desktop: { cpu: 1, network: { downloadThroughput: (10 * 1024 * 1024) / 8, latency: 40, uploadThroughput: (10 * 1024 * 1024) / 8 }, viewport: { deviceScaleFactor: 1, height: 940, isMobile: false, width: 1350 } },
mobile: { cpu: 4, network: { downloadThroughput: (1.6 * 1024 * 1024) / 8, latency: 150, uploadThroughput: (750 * 1024) / 8 }, viewport: { deviceScaleFactor: 1.75, hasTouch: true, height: 823, isMobile: true, width: 412 } },
}
const OBSERVERS = `(() => {
const v = (window.__perf = { cls: 0, events: [], lcp: null, longTasks: [] })
let win = 0, winStart = 0, winLast = 0
new PerformanceObserver((l) => { for (const e of l.getEntries()) {
const el = e.element
v.lcp = { at: e.startTime, size: e.size, tag: el ? el.tagName.toLowerCase() : null, src: e.url || null,
loading: el && el.getAttribute ? el.getAttribute('loading') : null,
fetchpriority: el && el.getAttribute ? el.getAttribute('fetchpriority') : null }
} }).observe({ buffered: true, type: 'largest-contentful-paint' })
new PerformanceObserver((l) => { for (const e of l.getEntries()) {
if (e.hadRecentInput) continue
if (win && e.startTime - winLast < 1000 && e.startTime - winStart < 5000) { win += e.value } else { win = e.value; winStart = e.startTime }
winLast = e.startTime
v.cls = Math.max(v.cls, win)
} }).observe({ buffered: true, type: 'layout-shift' })
new PerformanceObserver((l) => { for (const e of l.getEntries()) v.longTasks.push([e.startTime, e.duration]) }).observe({ buffered: true, type: 'longtask' })
new PerformanceObserver((l) => { for (const e of l.getEntries()) v.events.push({ d: e.duration, n: e.name }) }).observe({ buffered: true, durationThreshold: 16, type: 'event' })
})()`
/**
* @typedef {{ bytes: { css: number, font: number, html: number, image: number, js: number, other: number }, cls: number,
* fcp: null | number, inp: null | number, interaction: null | string, lcp: null | number,
* lcpElement: null | { fetchpriority: null | string, loading: null | string, src: null | string, tag: null | string },
* load: null | number, prefetches: number, profile: string, renderBlocking: string[], requests: number, runs?: number, scriptMs: null | number,
* status: null | number, tbt: null | number, thirdParty: string[], ttfb: null | number, url: string }} PageMeasurement
*/
const typeOf = (resourceType, mime = '') => {
if (resourceType === 'Document') {return 'html'}
if (resourceType === 'Script') {return 'js'}
if (resourceType === 'Stylesheet') {return 'css'}
if (resourceType === 'Font') {return 'font'}
if (resourceType === 'Image' || mime.startsWith('image/')) {return 'image'}
return 'other'
}
/**
* @param {import('@playwright/test').Browser} browser
* @param {string} url
* @param {'mobile'|'desktop'} profileName
* @param {{ blockThirdParty?: boolean, interact?: boolean, settleMs?: number }} [options]
* @returns {Promise<PageMeasurement>}
*/
export async function measurePage(browser, url, profileName, options = {}) {
const profile = PROFILES[profileName]
const context = await browser.newContext({ ...profile.viewport, viewport: { height: profile.viewport.height, width: profile.viewport.width } })
const page = await context.newPage()
const cdp = await context.newCDPSession(page)
await cdp.send('Network.enable')
await cdp.send('Network.setCacheDisabled', { cacheDisabled: true })
await cdp.send('Network.emulateNetworkConditions', { offline: false, ...profile.network })
await cdp.send('Emulation.setCPUThrottlingRate', { rate: profile.cpu })
await cdp.send('Performance.enable')
await page.addInitScript(OBSERVERS)
const origin = new URL(url).origin
if (options.blockThirdParty) {await context.route((u) => u.origin !== origin, (route) => route.abort())}
const requests = new Map()
let prefetches = 0
cdp.on('Network.requestWillBeSent', (e) => {
if (e.request.url.startsWith('data:')) {return}
if (/[?&]_rsc=/.test(e.request.url)) {prefetches++; return}
requests.set(e.requestId, { bytes: 0, type: typeOf(e.type), url: e.request.url })
})
cdp.on('Network.responseReceived', (e) => { const r = requests.get(e.requestId); if (r) {r.type = typeOf(e.type, e.response.mimeType); r.status = e.response.status} })
cdp.on('Network.loadingFinished', (e) => { const r = requests.get(e.requestId); if (r) {r.bytes = e.encodedDataLength} })
const response = await page.goto(url, { timeout: 60_000, waitUntil: 'load' })
await page.waitForLoadState('networkidle', { timeout: 15_000 }).catch(() => {})
await page.waitForTimeout(options.settleMs ?? 1000)
let interaction = null
if (options.interact !== false) {
// INP stand-in: one click on the first visible button (menu toggle, cookie settings, theme): a real handler runs
const button = page.locator('button:visible').first()
if (await button.count()) {
interaction = (await button.getAttribute('aria-label')) ?? (await button.innerText()).slice(0, 40)
await button.click({ timeout: 5000 }).catch(() => { interaction = null })
await page.waitForTimeout(500)
}
}
const nav = await page.evaluate(() => {
const n = performance.getEntriesByType('navigation')[0]
const fcp = performance.getEntriesByName('first-contentful-paint')[0]
const blocking = performance.getEntriesByType('resource').filter((r) => r.renderBlockingStatus === 'blocking').map((r) => r.name)
return { blocking, domContentLoaded: n.domContentLoadedEventEnd, fcp: fcp ? fcp.startTime : null, load: n.loadEventEnd, ttfb: n.responseStart }
})
const vitals = await page.evaluate(() => window.__perf)
const { metrics } = await cdp.send('Performance.getMetrics')
const metric = (name) => metrics.find((m) => m.name === name)?.value ?? 0
await context.close()
const list = [...requests.values()]
const bytes = { css: 0, font: 0, html: 0, image: 0, js: 0, other: 0 }
for (const r of list) {bytes[r.type] += r.bytes}
const fcp = nav.fcp ?? 0
const tbt = vitals.longTasks.filter(([start]) => start >= fcp).reduce((sum, [, d]) => sum + Math.max(0, d - 50), 0)
const round = (n) => (n == null ? null : Math.round(n))
return {
bytes: Object.fromEntries(Object.entries(bytes).map(([k, b]) => [k, Math.round(b)])),
cls: Math.round(vitals.cls * 1000) / 1000,
fcp: round(nav.fcp),
inp: vitals.events.length ? round(Math.max(...vitals.events.map((e) => e.d))) : interaction ? 0 : null,
interaction,
lcp: round(vitals.lcp?.at),
lcpElement: vitals.lcp ? { fetchpriority: vitals.lcp.fetchpriority, loading: vitals.lcp.loading, src: vitals.lcp.src ? vitals.lcp.src.replace(origin, '') : null, tag: vitals.lcp.tag } : null,
load: round(nav.load),
prefetches,
profile: profileName,
renderBlocking: nav.blocking.map((u) => u.replace(origin, '')),
requests: list.length,
scriptMs: round(metric('ScriptDuration') * 1000),
status: response?.status() ?? null,
tbt: round(tbt),
thirdParty: [...new Set(list.filter((r) => !r.url.startsWith(origin)).map((r) => new URL(r.url).origin))],
ttfb: round(nav.ttfb),
url: url.replace(origin, ''),
}
}
export const median = (values) => {
const sorted = values.filter((v) => typeof v === 'number').sort((a, b) => a - b)
if (!sorted.length) {return null}
const mid = Math.floor(sorted.length / 2)
return sorted.length % 2 ? sorted[mid] : Math.round(((sorted[mid - 1] + sorted[mid]) / 2) * 1000) / 1000
}
/**
* The median of `runs` measurements for every number; the rest from the last run.
* @param {import('@playwright/test').Browser} browser
* @param {string} url
* @param {'mobile'|'desktop'} profileName
* @param {number} [runs]
* @param {{ blockThirdParty?: boolean, interact?: boolean, settleMs?: number }} [options]
* @returns {Promise<PageMeasurement>}
*/
export async function measureMedian(browser, url, profileName, runs = 3, options = {}) {
const all = []
for (let i = 0; i < runs; i++) {all.push(await measurePage(browser, url, profileName, options))}
const last = all.at(-1)
const out = { ...last, runs }
for (const key of ['cls', 'fcp', 'inp', 'lcp', 'load', 'requests', 'scriptMs', 'tbt', 'ttfb']) {out[key] = median(all.map((r) => r[key]))}
out.bytes = Object.fromEntries(Object.keys(last.bytes).map((k) => [k, median(all.map((r) => r.bytes[k]))]))
return out
}
export const launch = () => chromium.launch()
@@ -0,0 +1,48 @@
// e2e/performance.spec.ts — the project's performance budget gate (iapl-performance skill, docs/performance.md).
// Copy this file and perf-lab.mjs (same folder) to e2e/. Runs against the BUILT site: pnpm build && pnpm test:e2e.
// It fails when a page breaks a budget: the plugin's defaults (Core Web Vitals "good", bytes, requests), tightened
// below to what this site measured, so a change that makes it slower fails. Loosen a number only with a reason.
import type { Browser } from '@playwright/test'
import { overBudget, perfBudgets } from '@intecion/ipal-kit/doctor'
import { chromium, expect, test } from '@playwright/test'
// a plain ES module (JSDoc types) — perf-lab.mjs from the skill's resources
import { measureMedian } from './perf-lab.mjs'
const runs = Number(process.env.PERF_RUNS ?? 1)
// Start from the defaults; after the first run, set each number to what you measured plus ~20 % (the lab is noisy).
const budgets = perfBudgets({
desktop: {},
mobile: {},
})
// One page of each template the site has (AGENTS.md → Site map). `budget` changes a number for one page, with a reason.
const PAGES: Array<{ budget?: Partial<typeof budgets.mobile>; name: string; path: string }> = [
{ name: 'home', path: '/pl' },
// { name: 'page', path: '/pl/o-nas' },
// { name: 'post', path: '/pl/blog/<a-post>' },
// { name: 'form', path: '/pl/kontakt', budget: { thirdParty: ['https://challenges.cloudflare.com'] } }, // Turnstile
]
let browser: Browser
test.beforeAll(async () => {
browser = await chromium.launch()
})
test.afterAll(async () => {
await browser?.close()
})
for (const page of PAGES) {
for (const profile of ['mobile', 'desktop'] as const) {
test(`${page.name} (${profile}) stays within its performance budget`, async ({ baseURL }) => {
test.setTimeout(120_000)
// third-party requests are recorded, then aborted: an external host cannot fail or hang the test
const measured = await measureMedian(browser, `${baseURL}${page.path}`, profile, runs, { blockThirdParty: true })
test.info().annotations.push({ description: JSON.stringify({ bytes: measured.bytes, cls: measured.cls, inp: measured.inp, lcp: measured.lcp, requests: measured.requests }), type: 'measured' })
expect(overBudget(measured, { ...budgets[profile], ...page.budget }), `${page.path} ${profile}`).toEqual([])
if (measured.lcpElement?.tag === 'img') {expect(measured.lcpElement.loading, 'the LCP image is lazy').not.toBe('lazy')}
})
}
}
+27 -4
View File
@@ -38,9 +38,19 @@ description: Complete map of everything @intecion/ipal-kit provides — every ia
| `accounts.staffOnlyRead` | on | `read` and `readVersions` on a staff collection without those rules: a fully signed-in account of a staff collection (Payload's default let a visitor account list the staff accounts) | `false` = Payload's default; a `read` rule you wrote wins | | `accounts.staffOnlyRead` | on | `read` and `readVersions` on a staff collection without those rules: a fully signed-in account of a staff collection (Payload's default let a visitor account list the staff accounts) | `false` = Payload's default; a `read` rule you wrote wins |
| `accounts.firstUserRoute` | `'panel'` | which auth collections `POST /api/<slug>/first-register` answers for while they are empty: only the one the panel logs in with (the first account of a site → admin). Others get `403`, a second staff collection included, in any spelling of the URL (the plugin's own endpoint sits in front of Payload's); a collection whose own `create` allows an anonymous request keeps its route. With `access.firstUserAdmin: false` and a default role below the panel role, the default `panelRole` is not applied (logged) and an explicit one is refused at start | a list of slugs; `'all'` = Payload's behaviour | | `accounts.firstUserRoute` | `'panel'` | which auth collections `POST /api/<slug>/first-register` answers for while they are empty: only the one the panel logs in with (the first account of a site → admin). Others get `403`, a second staff collection included, in any spelling of the URL (the plugin's own endpoint sits in front of Payload's); a collection whose own `create` allows an anonymous request keeps its route. With `access.firstUserAdmin: false` and a default role below the panel role, the default `panelRole` is not applied (logged) and an explicit one is refused at start | a list of slugs; `'all'` = Payload's behaviour |
| `accounts.password` | `{ minLength: 12 }` | when a password is SET on a staff collection (create, first-user screen, change, reset by e-mail; panel, API and Local API): at least `minLength` characters, not the account's e-mail address. Existing passwords are never checked — a shorter one keeps logging in | `{ minLength }`; `false` = Payload's rule (3 characters) | | `accounts.password` | `{ minLength: 12 }` | when a password is SET on a staff collection (create, first-user screen, change, reset by e-mail; panel, API and Local API): at least `minLength` characters, not the account's e-mail address. Existing passwords are never checked — a shorter one keeps logging in | `{ minLength }`; `false` = Payload's rule (3 characters) |
| `accounts.lockedAnswer` | `'wrong'` (1.18.0) | a staff account Payload has locked (too many wrong passwords) gets exactly the wrong-password answer on login (REST, GraphQL, the panel): nobody tells which addresses have an account; the lock itself is unchanged | `'payload'` = Payload's "This user is locked…"; any other value stops the start |
| `accounts.signInLimit` | `{ perAddress: 5, windowMinutes: 15, accountLock: { maxLoginAttempts: 50, lockTime: 3_600_000 } }` (1.18.0) | failed staff sign-ins per client IP + typed address (folded): over the limit `429` for that IP and address only; only failures count; Payload's per-account lock raised where the project set none | `{ perAddress, windowMinutes, accountLock }`; `accountLock: false` = Payload's lock; `false` = as before 1.18 |
| `accounts.signInSameOrigin` | on (1.18.0) | staff login / forgot / reset password: `403` for a request a browser marks as coming from another origin | `{ origins: [...] }`; `false` |
| `accounts.confirmOwnChanges` | on (1.18.0) | own e-mail / username / password change needs `currentPassword` (panel field, REST, GraphQL) | `false` |
| `secrets.writeOnly` | on | `smtpPassword` and `turnstileSecretKey` (Site integrations) are never returned: REST, GraphQL and the panel get `'********'` when a value is stored; a save with nothing / empty / the mask keeps it, a new value replaces it, `'[[clear]]'` removes it; the Local API with access control off reads the real value. The panel is the source of these secrets — no env variable. A restore of a version is masked too | `false` = returned to whoever may read the global, as before | | `secrets.writeOnly` | on | `smtpPassword` and `turnstileSecretKey` (Site integrations) are never returned: REST, GraphQL and the panel get `'********'` when a value is stored; a save with nothing / empty / the mask keeps it, a new value replaces it, `'[[clear]]'` removes it; the Local API with access control off reads the real value. The panel is the source of these secrets — no env variable. A restore of a version is masked too | `false` = returned to whoever may read the global, as before |
| "Sending method" (`emailMethod`; `getMailMethod` / `setMailMethod`) | nobody has chosen: the order of 1.17.0, shown as selected | `relay` (IWSN), `smtp`, `graph` (deprecated): what is chosen is what is used, no fallback; a stored field (Postgres / SQLite: one migration) |
| `secrets.reenterOnChange` | on | a save through access control that changes `smtpHost`, `smtpPort` or `smtpUser` while a password is stored must send the password again or remove it (`400` on the field otherwise), whatever `emailTransport` says — so an admin session cannot send the stored password to a server of its own. A change of the transport alone, and the Local API with access control off, are not asked | `false` = the stored password follows the new server | | `secrets.reenterOnChange` | on | a save through access control that changes `smtpHost`, `smtpPort` or `smtpUser` while a password is stored must send the password again or remove it (`400` on the field otherwise), whatever `emailTransport` says — so an admin session cannot send the stored password to a server of its own. A change of the transport alone, and the Local API with access control off, are not asked | `false` = the stored password follows the new server |
| `dashboardAlerts` | `{ integrations: 'admin', cookies: 'editor' }` | who sees the plugin's dashboard alerts: integration details (error text, link) for `integrations` and above, a neutral "ask an administrator" for editors below it, nothing for others; the cookie crawl / approval alert for `cookies` and above. With a role, a session that owes its second factor sees none | `integrations: 'editor' | 'all'`, `cookies: 'all'` (`'all'` = as before: no role and no second factor is checked) | | `dashboardAlerts` | `{ integrations: 'admin', cookies: 'editor' }` | who sees the plugin's dashboard alerts: integration details (error text, link) for `integrations` and above, a neutral "ask an administrator" for editors below it, nothing for others; the cookie crawl / approval alert for `cookies` and above. With a role, a session that owes its second factor sees none | `integrations: 'editor' | 'all'`, `cookies: 'all'` (`'all'` = as before: no role and no second factor is checked) |
| `strictAccessAnswers` | `true` (1.18.0) | a project's access callback (`cookieScanner.access`, the doctor's `access`) allows only on a literal `true`; `req.user`, `1`, a string, an un-awaited Promise refuse; a non-boolean answer is reported once per option | `false` = any truthy answer allows (as before 1.18.0) |
| `listLimit` | `{ max: 100, staff: false }` (1.18.0, audit F4) | a REST / GraphQL list (`find`, versions, distinct) from a caller that is not staff gets at most `max` documents; `pagination=false` / `limit=0` become one page; staff, the Local API and server reads with `overrideAccess: true` that pass a request on untouched | `false` (Payload's behaviour); `{ max, staff: true, exclude: ['slug'] }`; `buildQueryGuardHook` for a collection added after iapl |
| `refuseOperatorSort` | `true` (1.18.0, audit F5) | a `sort` naming a database operator (`$where`, `-$natural`, `a.$ne`) → `400` for everyone, logged as one `info` line (`RefusedSortError`) | `false`; `loggingLevels: { RefusedSortError: false }` hides the log line |
| `lockedDocuments` | staff only (1.18.0) | Payload's document locks (`payload-locked-documents`) for staff accounts with the second factor; Payload's default was any signed-in account | `false` (Payload's default); `{ access: { read, create, update, delete } }` |
| `adminSameOrigin` | on (1.18.0) | `POST` mail service connect / disconnect, test e-mail, cookie scan / approval / crawl refuse (`403`) a request a browser marks as coming from another origin; own origins: the request's host, `serverURL`, `csrf`, `cors`, `origins` | `{ origins: [...] }` adds origins; `false` = no check; any other value stops the start |
| `adminRoute` | `'/admin'` | `config.routes.admin`; stats link and views, `IntegrationAlerts` | the project moves `app/(payload)/<route>/` itself and adds the route to the proxy matcher (security.md) | | `adminRoute` | `'/admin'` | `config.routes.admin`; stats link and views, `IntegrationAlerts` | the project moves `app/(payload)/<route>/` itself and adds the route to the proxy matcher (security.md) |
| `twoFactor` | **none = error** | `@clocklimited/payload-2fa` with `forceSetup: true` (TOTP enforced, also checked in the API) | `twoFactor: false` (discouraged); omitting the option throws `[iapl] twoFactor.issuer is required` | | `twoFactor` | **none = error** | `@clocklimited/payload-2fa` with `forceSetup: true` (TOTP enforced, also checked in the API) | `twoFactor: false` (discouraged); omitting the option throws `[iapl] twoFactor.issuer is required` |
| `twoFactor.issuer` | — (required) | name in the authenticator app | — | | `twoFactor.issuer` | — (required) | name in the authenticator app | — |
@@ -51,8 +61,8 @@ description: Complete map of everything @intecion/ipal-kit provides — every ia
| `twoFactor.importMapCheck` | on | production only: at start searches the `importMap.js` on disk (where Payload looks for it) for `@intecion/ipal-kit/admin#SafeTotpView`; when not found, logs `[iapl] The admin import map may be out of date …` and IAPL's `TotpRedirectProvider` puts the notice "Two-step verification may not be available" above the 2FA screens (never instead of them). A hint only — the map in the build can differ from the file on disk (Dockerfile runner stage, re-exporting map); a file that is not found is not reported | `false` = no file read, log line or notice | | `twoFactor.importMapCheck` | on | production only: at start searches the `importMap.js` on disk (where Payload looks for it) for `@intecion/ipal-kit/admin#SafeTotpView`; when not found, logs `[iapl] The admin import map may be out of date …` and IAPL's `TotpRedirectProvider` puts the notice "Two-step verification may not be available" above the 2FA screens (never instead of them). A hint only — the map in the build can differ from the file on disk (Dockerfile runner stage, re-exporting map); a file that is not found is not reported | `false` = no file read, log line or notice |
| `twoFactor.texts` | IAPL's en/pl texts (`TOTP_TEXTS`) over the package's; 2FA screens titled "Two-step verification" / "Weryfikacja dwuetapowa" (site's language) | `false` = the package's texts; one text: `i18n.translations.<lang>.totpPlugin.<key>` (security.md) | | `twoFactor.texts` | IAPL's en/pl texts (`TOTP_TEXTS`) over the package's; 2FA screens titled "Two-step verification" / "Weryfikacja dwuetapowa" (site's language) | `false` = the package's texts; one text: `i18n.translations.<lang>.totpPlugin.<key>` (security.md) |
| `twoFactor.guard` | on | IAPL's own second-factor check on every collection and global (also the plugin's own and those of plugins listed after iapl) and in `userMeetsRole`; startup fails with `[iapl] twoFactor: the injected 2FA plugin did not add …` when the 2FA package lacks the `totp` strategy / `hasTotp` / `totpSecret` | per entity: `custom.ipal.secondFactor: false` / `{ read: false }` or the package's `custom.totp.disableAccessWrapper.<op>`; `false` = the package's wrapper only (the plugin's own data then opens to a password without the code; not recommended). The package's endpoints stay limited to accounts of the 2FA collection either way | | `twoFactor.guard` | on | IAPL's own second-factor check on every collection and global (also the plugin's own and those of plugins listed after iapl) and in `userMeetsRole`; startup fails with `[iapl] twoFactor: the injected 2FA plugin did not add …` when the 2FA package lacks the `totp` strategy / `hasTotp` / `totpSecret` | per entity: `custom.ipal.secondFactor: false` / `{ read: false }` or the package's `custom.totp.disableAccessWrapper.<op>`; `false` = the package's wrapper only (the plugin's own data then opens to a password without the code; not recommended). The package's endpoints stay limited to accounts of the 2FA collection either way |
| `twoFactor.verifyLimit` | `{ max: 5, windowMinutes: 10, store: 'database' }` | attempts per account on `POST /api/verify-totp` (the 2FA package counts none): the sixth in the window, right or wrong, gets `429` + `Retry-After`. Counted in memory and in the database (`payload.kv`, the `payload-kv` collection Payload adds), so a restart or a second instance does not reset it; a failing store never opens the gate | `{ max, windowMinutes }`; `{ store: 'memory' }` = this instance only; `false` = no limit | | `twoFactor.verifyLimit` | `{ max: 5, windowMinutes: 10, store: 'database' }` | wrong codes per account on `POST /api/verify-totp` (the 2FA package counts none): after five wrong ones in the window the next attempt, right or wrong, gets `429` + `Retry-After`; a right code gives its place back (1.17.1); an attempt held out only by others still being checked gets `429` + `Retry-After: 2`. Counted in memory and in the database (`payload.kv`, the `payload-kv` collection Payload adds), so a restart or a second instance does not reset it; a failing store never opens the gate | `{ max, windowMinutes }`; `{ store: 'memory' }` = this instance only; `false` = no limit |
| `twoFactor.sameOrigin` | on | `POST /api/verify-totp` and `/api/setup-totp` refuse (`403`, not counted) a request a browser marks as coming from another origin (`Origin`, else `Sec-Fetch-Site`). Own origins: the request's host (`Host`, `X-Forwarded-Host`, a default port written out is ignored), `serverURL`, Payload's `csrf` / `cors`. Requests without those headers pass. A refusal is logged once per origin with how to allow it — behind a proxy that hides the address set `serverURL` | `{ origins: ['https://app.example.com'] }` adds origins; `false` = off | | `twoFactor.sameOrigin` | on | `POST /api/verify-totp`, `/api/setup-totp` and (1.17.1) the admin's `/api/ipal/two-factor/reset` refuse (`403`, not counted) a request a browser marks as coming from another origin (`Origin`, else `Sec-Fetch-Site`). Own origins: the request's host (`Host`, `X-Forwarded-Host`, a default port written out is ignored), `serverURL`, Payload's `csrf` / `cors`. Requests without those headers pass. A refusal is logged once per origin with how to allow it — behind a proxy that hides the address set `serverURL` | `{ origins: ['https://app.example.com'] }` adds origins; `false` = off |
| `twoFactor.requireSetup` | on, `{ windowHours: 72 }` | an account without TOTP reaches nothing but the setup screen and `/api/setup-totp` (REST, GraphQL and the panel's data answer 403); it has `windowHours` from its creation or from an admin's reset, then it is blocked until an admin reopens setup. Adds the field `totpSetupStatus` (panel) to the 2FA collection, a dashboard notice and `POST /api/ipal/two-factor/reset`; the date field `totpSetupFrom` is there whenever 2FA is on (also with `requireSetup: false` / `guard: false`). Existing accounts get their window at the first start after the upgrade, written once. **Postgres/SQLite: the migration must be applied when the new container starts — `prodMigrations` or `pnpm payload migrate && pnpm start`, not a pre-deployment command (deployment.md §4.3) — or every login answers 500**; `generate:importmap`. `exempt` must return exactly `true` at once (an `async` one, or a `windowHours` that is not a number / `false`, stops the start) | `false` = the package's rule (API open until setup); `{ windowHours: 24 }`, `{ windowHours: false }` (no limit), `{ exempt: ({ user }) => … }` (a service account) | | `twoFactor.requireSetup` | on, `{ windowHours: 72 }` | an account without TOTP reaches nothing but the setup screen and `/api/setup-totp` (REST, GraphQL and the panel's data answer 403); it has `windowHours` from its creation or from an admin's reset, then it is blocked until an admin reopens setup. Adds the field `totpSetupStatus` (panel) to the 2FA collection, a dashboard notice and `POST /api/ipal/two-factor/reset`; the date field `totpSetupFrom` is there whenever 2FA is on (also with `requireSetup: false` / `guard: false`). Existing accounts get their window at the first start after the upgrade, written once. **Postgres/SQLite: the migration must be applied when the new container starts — `prodMigrations` or `pnpm payload migrate && pnpm start`, not a pre-deployment command (deployment.md §4.3) — or every login answers 500**; `generate:importmap`. `exempt` must return exactly `true` at once (an `async` one, or a `windowHours` that is not a number / `false`, stops the start) | `false` = the package's rule (API open until setup); `{ windowHours: 24 }`, `{ windowHours: false }` (no limit), `{ exempt: ({ user }) => … }` (a service account) |
| `twoFactor.requireSetup.dashboardNotice` / `.statusField` / `.setupNotice` | on | the administrators' notice on the dashboard; the status and reset control on the account page; the notice on the setup screen | `false` each (the lock and the reset endpoint stay) | | `twoFactor.requireSetup.dashboardNotice` / `.statusField` / `.setupNotice` | on | the administrators' notice on the dashboard; the status and reset control on the account page; the notice on the setup screen | `false` each (the lock and the reset endpoint stay) |
| `twoFactor.resetAccess` (the endpoint exists with `twoFactor.guard` on; `guard: false` = no endpoint, 404) | a staff admin whose session entered its own TOTP code (not an API key, not an `exempt` account) | who may reset another account's TOTP / reopen its setup (the button on the account page, `POST /api/ipal/two-factor/reset`). The reset clears the secret and the account's sessions. A session that still owes its code is always refused | `({ req }) => boolean` — replaces the rule, so keep `req.user?._strategy === 'totp' &&` in it unless API-key / exempt admins should reset; only `true` allows; `req.user._strategy` tells `'totp'`, `'api-key'`, `'local-jwt'` apart | | `twoFactor.resetAccess` (the endpoint exists with `twoFactor.guard` on; `guard: false` = no endpoint, 404) | a staff admin whose session entered its own TOTP code (not an API key, not an `exempt` account) | who may reset another account's TOTP / reopen its setup (the button on the account page, `POST /api/ipal/two-factor/reset`). The reset clears the secret and the account's sessions. A session that still owes its code is always refused | `({ req }) => boolean` — replaces the rule, so keep `req.user?._strategy === 'totp' &&` in it unless API-key / exempt admins should reset; only `true` allows; `req.user._strategy` tells `'totp'`, `'api-key'`, `'local-jwt'` apart |
@@ -64,6 +74,14 @@ description: Complete map of everything @intecion/ipal-kit provides — every ia
| `whiteLabel.logoField` / `iconField` / `nameField` | `'logo'` / `'favicon'` / `'siteName'` | fields in Site settings | any upload/text field | | `whiteLabel.logoField` / `iconField` / `nameField` | `'logo'` / `'favicon'` / `'siteName'` | fields in Site settings | any upload/text field |
| `whiteLabel.titleSuffix` | none | `admin.meta.titleSuffix` (tab title) | — | | `whiteLabel.titleSuffix` | none | `admin.meta.titleSuffix` (tab title) | — |
| `whiteLabel.credit` | on | `IntecionCredit` in `afterLogin` and `afterNavLinks`: "Technology support: Intecion.com" (en/pl, from `agency`) | `false`; `{ text, url }` overrides | | `whiteLabel.credit` | on | `IntecionCredit` in `afterLogin` and `afterNavLinks`: "Technology support: Intecion.com" (en/pl, from `agency`) | `false`; `{ text, url }` overrides |
| `whiteLabel.signIn` | on (with `whiteLabel`) | the sign-in look: a dark panel with the client's logo (Site settings → Logo, any picture it holds — an SVG too — as `<img>`, exactly what the login screen showed before; fits 240 × 72, no plate) or the site's name beside the form, "Administration panel", language links; both themes, a band above the form on a phone. Login, the 2FA screens and e-mail verification get it through `AdminLogo` / `SafeTotpView` (already in the import map: an upgrade needs no edit). No env var, no new field, no migration | `false` = Payload's own screens |
| `whiteLabel.signIn.allScreens` | `false` (the starter writes `true`) | the look on forgot / reset password, create first user, logout and "unauthorized" too: adds the provider `SignInLook` — ONE new import-map entry, run `pnpm payload generate:importmap`. Production start: when `importMap.js` on disk lacks it, the provider is left out and the log says `[iapl] The sign-in look covers only the login and 2FA screens …` | `true` |
| `whiteLabel.signIn.accent` | `#0070c0` | hex colour of the button, links and focus ring (anything that is not a hex colour is ignored); or CSS variables `--iapl-signin-*` on `:root` in the admin's `custom.scss` | `'#0b6e4f'` |
| `whiteLabel.signIn.logoPlate` | `false` (the logo straight on the dark panel: upload one that works on dark) | `true` = a white plate behind the logo (dark letters) | — |
| `whiteLabel.signIn.checkLogo` | on | only against a broken picture: the logo's address is asked once as an anonymous visitor would (no redirect followed, 4 s, ≤ 512 KB read, 10-minute memory); a file that is gone (404 / 410) or is no picture (HTML, PDF) → the site's name; anything else (nothing answers, a redirect, another status, over 512 KB) → the upload is believed | `false` = no fetch |
| `whiteLabel.signIn.languages` | shown with 2+ admin languages | links on the panel; `GET /api/ipal/admin-language?lng=<code>` writes Payload's `payload-lng` cookie and redirects (303) back to the admin path of the `Referer`; unknown language → 400 | `false` = no links, no endpoint |
| `whiteLabel.signIn.svgLogo` | `true`: an SVG logo is shown as a picture (`<img>` runs no script), as on the login screen before | `false` = an SVG logo is not shown on the sign-in screens (the site's name is) | — |
| `whiteLabel.brandAccess` | `'admin'` with the sign-in look (else `'editor'`) | field-level `access.update` on the name, logo and icon fields of Site settings: only admins change what the sign-in screens show; editors keep the rest. No schema change | `'editor'` = whoever edits Site settings |
| `agency` | `{ name: 'Intecion.com', url: 'https://intecion.com' }` | the credit line, the panel's link description and preview image | `{ name, url }` = another agency; `false` = none anywhere | | `agency` | `{ name: 'Intecion.com', url: 'https://intecion.com' }` | the credit line, the panel's link description and preview image | `{ name, url }` = another agency; `false` = none anywhere |
| `adminMeta` | on (with or without `whiteLabel`) | panel `<head>`: `robots` noindex/nofollow, `titleSuffix` "— <site> \| Panel", `og:site_name` + description from Site settings (refreshed on save), `og:image` `GET /api/ipal/admin-og` (1200×630 from the logo or name), icon `GET /api/ipal/admin-icon` (favicon or initials); no import map step | `false` = Payload defaults; `{ robots, titleSuffix, description, image, icons, language }` (each `false` or your value; `{site}`, `{agency}` placeholders); your own `admin.meta` keys always win. Check: `curl -s $URL/admin/login \| grep -E 'og:\|robots'` (white-label.md) | | `adminMeta` | on (with or without `whiteLabel`) | panel `<head>`: `robots` noindex/nofollow, `titleSuffix` "— <site> \| Panel", `og:site_name` + description from Site settings (refreshed on save), `og:image` `GET /api/ipal/admin-og` (1200×630 from the logo or name), icon `GET /api/ipal/admin-icon` (favicon or initials); no import map step | `false` = Payload defaults; `{ robots, titleSuffix, description, image, icons, language }` (each `false` or your value; `{site}`, `{agency}` placeholders); your own `admin.meta` keys always win. Check: `curl -s $URL/admin/login \| grep -E 'og:\|robots'` (white-label.md) |
| `pages` | none | Site settings → **System pages** (page roles) and **Maintenance** tabs | omit → neither tab | | `pages` | none | Site settings → **System pages** (page roles) and **Maintenance** tabs | omit → neither tab |
@@ -84,15 +102,17 @@ description: Complete map of everything @intecion/ipal-kit provides — every ia
| `forms.adminGroup` | `'Forms'` | sidebar group | `false` = Payload default; `admin.group` in overrides wins | | `forms.adminGroup` | `'Forms'` | sidebar group | `false` = Payload default; `admin.group` in overrides wins |
| `forms.fields.*` | on: `checkbox`, `checkboxGroup`, `country`, `date`, `email`, `message`, `number`, `radio`, `select`, `state`, `step`, `text`, `textarea`, `time`; off: `payment` | block types in the builder (all with "Show only when") | `<type>: false`; a block object replaces it; `payment: true` **does nothing** (filtered out) — pass a block object | | `forms.fields.*` | on: `checkbox`, `checkboxGroup`, `country`, `date`, `email`, `message`, `number`, `radio`, `select`, `state`, `step`, `text`, `textarea`, `time`; off: `payment` | block types in the builder (all with "Show only when") | `<type>: false`; a block object replaces it; `payment: true` **does nothing** (filtered out) — pass a block object |
| `forms.formOverrides` | Form/Forms labels, `emails` readable by logged-in users only | overrides the `forms` collection (`fields: ({ defaultFields }) => …`, `slug`, `admin`, `access`…) | any `CollectionConfig` | | `forms.formOverrides` | Form/Forms labels, `emails` readable by logged-in users only | overrides the `forms` collection (`fields: ({ defaultFields }) => …`, `slug`, `admin`, `access`…) | any `CollectionConfig` |
| `forms.formSubmissionOverrides` | create: logged-in, read: editor+, delete: admin | overrides `form-submissions` | `access.create` etc. wins | | `forms.formSubmissionOverrides` | create: a staff account with its second factor (since 1.18.0; before: any signed-in account), read: editor+, delete: admin | overrides `form-submissions` | `access.create` etc. wins |
| `forms.redirectRelationships` | none | collections a form can redirect to | `['pages']` | | `forms.redirectRelationships` | none | collections a form can redirect to | `['pages']` |
| `forms.emailLayout` | `false` | `beforeEmail` with a layout (logo, colour, footer) + Site settings → **Emails** tab; `{{*:table}}` readable | `true` | | `forms.emailLayout` | `false` | `beforeEmail` with a layout (logo, colour, footer) + Site settings → **Emails** tab; `{{*:table}}` readable | `true` |
| `forms.beforeEmail` | none | your own e-mail changes (after the layout) | form-builder function | | `forms.beforeEmail` | none | your own e-mail changes (after the layout) | form-builder function |
| `forms.turnstileOnConfigError` | `{ text: 'allow', files: 'reject' }` | what a form does while Turnstile CANNOT check (wrong / missing secret, Cloudflare down): a text form is accepted, a submission to the file endpoint is refused. Not involved while Turnstile is off | `'allow'` / `'reject'` for every form, or `{ text, files }`; `turnstileOnConfigError` at a call site (`createSubmitAction`, `attachments.submit`) wins | | `forms.turnstileOnConfigError` | `{ text: 'allow', files: 'reject' }` | what a form does while Turnstile CANNOT check (wrong / missing secret, Cloudflare down): a text form is accepted, a submission to the file endpoint is refused. Not involved while Turnstile is off | `'allow'` / `'reject'` for every form, or `{ text, files }`; `turnstileOnConfigError` at a call site (`createSubmitAction`, `attachments.submit`) wins |
| `forms.attachments` | off | **File** field in the form builder; a file is checked (size, count, type by content, refused extensions), attached to the company e-mail and dropped — **never stored**; adds `POST /api/ipal/forms/submit`, the fields `submissionFiles` / `filesDelivery` / `filesDeliveryNote` / `attemptKey` on `form-submissions`, and the **Files** texts in Form messages | `true` / `FormAttachmentsOption`: `maxSizeMB` (10), `maxTotalMB`, `maxFiles` (3), `fileTypes`, `allowRisky`, `scan` (antivirus hook — none built in), `strictPdf`, `notice`, `maxConcurrent` (2), `path`, `submit` (`maxPerMinute`, `clientIp`, `honeypotField`, `turnstileHostnames`, `turnstileOnConfigError`, `allowedOrigins`, `idleTimeoutMs`, `timeoutMs`); block only: `forms.fields.file: false` or `buildFileBlock(…)`. Postgres: `migrate:create`. Check: submit a PDF → attached to the company e-mail, absent from the customer e-mail, submission shows *File delivery: Handed to the mail server* (forms.md "Files") | | `forms.attachments` | off | **File** field in the form builder; a file is checked (size, count, type by content, refused extensions), attached to the company e-mail and dropped — **never stored**; adds `POST /api/ipal/forms/submit`, the fields `submissionFiles` / `filesDelivery` / `filesDeliveryNote` / `attemptKey` on `form-submissions`, and the **Files** texts in Form messages | `true` / `FormAttachmentsOption`: `maxSizeMB` (10), `maxTotalMB`, `maxFiles` (3), `fileTypes`, `allowRisky`, `scan` (antivirus hook — none built in), `strictPdf`, `notice`, `maxConcurrent` (2), `path`, `submit` (`maxPerMinute`, `clientIp`, `honeypotField`, `turnstileHostnames`, `turnstileOnConfigError`, `allowedOrigins`, `idleTimeoutMs`, `timeoutMs`); block only: `forms.fields.file: false` or `buildFileBlock(…)`. Postgres: `migrate:create`. Check: submit a PDF → attached to the company e-mail, absent from the customer e-mail, submission shows *File delivery: Handed to the mail server* (forms.md "Files") |
| `forms.consentFieldName` | `'consent'` | name of the GDPR consent field `submitForm` requires (read from `config.custom.ipal`) | `createSubmitAction({ consentFieldName })` / `submitForm` argument wins | | `forms.consentFieldName` | `'consent'` | name of the GDPR consent field `submitForm` requires (read from `config.custom.ipal`) | `createSubmitAction({ consentFieldName })` / `submitForm` argument wins |
| `consentLog` | **on** (since 1.17.0) | `consent-records` collection + `POST /api/ipal/consent` (rate limit 20/min); Postgres / SQLite: a table, migration in the same deploy | `false` / `{ retentionDays }` (default 1095) | | `consentLog` | **on** (since 1.17.0) | `consent-records` collection + `POST /api/ipal/consent` (rate limit 20/min); Postgres / SQLite: a table, migration in the same deploy; MongoDB: a TTL index deletes records older than the retention (1.18.0) | `false` / `{ retentionDays }` (default 1095) / `{ ttlIndex: false }` |
| `unusedMedia` | off | 1.18.0: a notice above upload lists with a link to the files nothing uses (manual delete); then `pnpm generate:importmap` | `true` / `{ collections: ['media'] }` |
| `consentLog.collectionOverrides` | none | changes `consent-records`: an object merges `access` / `admin` / `hooks` key by key (your keys win), a function `(collection) => collection` takes over (keep the slug) | e.g. `{ access: { read: ({ req }) => req.user?.email === '[email protected]' } }` — narrows who reads records in a project without roles | | `consentLog.collectionOverrides` | none | changes `consent-records`: an object merges `access` / `admin` / `hooks` key by key (your keys win), a function `(collection) => collection` takes over (keep the slug) | e.g. `{ access: { read: ({ req }) => req.user?.email === '[email protected]' } }` — narrows who reads records in a project without roles |
| `jobsRunAccess` | on (since 1.18.0), only when the project writes no `jobs.access.run` | Payload's job queue over HTTP (`/api/payload-jobs/run`, `/handle-schedules`): an admin with the second factor (an admin API key counts) or `Authorization: Bearer <CRON_SECRET>` (16+ chars); before: any signed-in account of any auth collection. In-process runs (`jobs.autoRun`, `payload jobs:run`) unaffected | `false` = Payload's default; `{ secretVar }` = another variable; your own `jobs.access.run` wins. Check: `curl -H "Authorization: Bearer $CRON_SECRET" $URL/api/payload-jobs/run` → 200, without it 401 (security.md "Payload's job queue") |
| `doctor` | on (404 until `IAPL_DOCTOR_TOKEN` is set) | `GET /api/ipal/doctor` — read-only counts for `iapl-doctor --url` (users without TOTP, cookies waiting for approval, versions); Bearer token ≥ 32 characters, rate-limited, never names or values | `false` = no endpoint; `{ tokenVar, access }` (doctor.md) | | `doctor` | on (404 until `IAPL_DOCTOR_TOKEN` is set) | `GET /api/ipal/doctor` — read-only counts for `iapl-doctor --url` (users without TOTP, cookies waiting for approval, versions); Bearer token ≥ 32 characters, rate-limited, never names or values | `false` = no endpoint; `{ tokenVar, access }` (doctor.md) |
| `cookieScanner` | off | `cookie-review` collection, "Scan cookies" box above its list (`CookieScanButton`), `GET`/`POST /api/ipal/cookie-scan`, and (unless `approval: false`) the *Approve cookies* view `/admin/cookie-approval` (`CookieApprovalView`) + `GET`/`POST /api/ipal/cookie-approval` + the dashboard reminder; a scan lists the cookies of the integrations switched on + names looked up in the bundled Open Cookie Database; one **Approve and add** puts the ticked cookies into Cookies → Cookie list (so `<CookieTable>` and the detailed window); never deletes, never overwrites edited text, never duplicates, nothing reaches the banner before approval | `true` / object; after switching on: `pnpm generate:importmap` + `migrate:create`. Check: *Privacy → Cookie review* → **Scan cookies** → "Waiting for approval: N" → **Review and approve** → **Approve and add** → the cookies are in Cookies → Cookie list (cookie-scanner.md) | | `cookieScanner` | off | `cookie-review` collection, "Scan cookies" box above its list (`CookieScanButton`), `GET`/`POST /api/ipal/cookie-scan`, and (unless `approval: false`) the *Approve cookies* view `/admin/cookie-approval` (`CookieApprovalView`) + `GET`/`POST /api/ipal/cookie-approval` + the dashboard reminder; a scan lists the cookies of the integrations switched on + names looked up in the bundled Open Cookie Database; one **Approve and add** puts the ticked cookies into Cookies → Cookie list (so `<CookieTable>` and the detailed window); never deletes, never overwrites edited text, never duplicates, nothing reaches the banner before approval | `true` / object; after switching on: `pnpm generate:importmap` + `migrate:create`. Check: *Privacy → Cookie review* → **Scan cookies** → "Waiting for approval: N" → **Review and approve** → **Approve and add** → the cookies are in Cookies → Cookie list (cookie-scanner.md) |
| `cookieScanner.adminLayout` | `'combined'` | one *Cookies* entry: *Review and approve* and (with `crawl`) *Site check* tabs on the `cookie-settings` global (`ui` fields, `CookieReviewTab` / `CookieSiteCheckTab`); `cookie-review` and `cookie-crawl` get `admin.group: false` (out of the nav, pages and API kept) | `'separate'`; no migration, `generate:importmap` | | `cookieScanner.adminLayout` | `'combined'` | one *Cookies* entry: *Review and approve* and (with `crawl`) *Site check* tabs on the `cookie-settings` global (`ui` fields, `CookieReviewTab` / `CookieSiteCheckTab`); `cookie-review` and `cookie-crawl` get `admin.group: false` (out of the nav, pages and API kept) | `'separate'`; no migration, `generate:importmap` |
@@ -153,6 +173,7 @@ description: Complete map of everything @intecion/ipal-kit provides — every ia
|---|---|---| |---|---|---|
| `AdminLogo`, `AdminIcon` | `graphics.Logo/Icon` | `whiteLabel` | | `AdminLogo`, `AdminIcon` | `graphics.Logo/Icon` | `whiteLabel` |
| `IntecionCredit` | `afterLogin`, `afterNavLinks` | `whiteLabel` and `credit !== false` | | `IntecionCredit` | `afterLogin`, `afterNavLinks` | `whiteLabel` and `credit !== false` |
| `SignInLook` | `providers` (last) | `whiteLabel.signIn.allScreens` — the only entry the sign-in look adds; without it nothing new is needed |
| `StatsNavLink`, `StatsView` (`views.ipalStats`, `/stats`), `StatsWidget` (`beforeDashboard`) | nav, view, dashboard | `stats` (`dashboard: false` without the widget) | | `StatsNavLink`, `StatsView` (`views.ipalStats`, `/stats`), `StatsWidget` (`beforeDashboard`) | nav, view, dashboard | `stats` (`dashboard: false` without the widget) |
| `CookieScanButton` | `beforeListTable` of `cookie-review` (with **Check site** when `crawl` is on) | `cookieScanner` | | `CookieScanButton` | `beforeListTable` of `cookie-review` (with **Check site** when `crawl` is on) | `cookieScanner` |
| `CookieReviewTab`, `CookieSiteCheckTab` | `ui` fields in the `cookie-settings` tabs | `cookieScanner` with `adminLayout !== 'separate'` (Site check: `crawl`) | | `CookieReviewTab`, `CookieSiteCheckTab` | `ui` fields in the `cookie-settings` tabs | `cookieScanner` with `adminLayout !== 'separate'` (Site check: `crawl`) |
@@ -202,6 +223,7 @@ Mandatory set: AGENT.md §0b, skill **iapl-setup**; checks: **iapl-audit**, **ia
| storage | `payload.config.ts` | `buildR2Storage(['media'], { s3Storage })` — always (without `R2_*` = local disk) | upload → URL from `R2_PUBLIC_URL` | storage.md | | storage | `payload.config.ts` | `buildR2Storage(['media'], { s3Storage })` — always (without `R2_*` = local disk) | upload → URL from `R2_PUBLIC_URL` | storage.md |
| e-mail | `payload.config.ts` | `email: mailAdapter()` (SMTP from the panel / Graph from env; also `panelSmtpAdapter`, `graphAdapter`, `sendEmail` from `/server`) | Site integrations → E-mail sending → **Send test** | email.md | | e-mail | `payload.config.ts` | `email: mailAdapter()` (SMTP from the panel / Graph from env; also `panelSmtpAdapter`, `graphAdapter`, `sendEmail` from `/server`) | Site integrations → E-mail sending → **Send test** | email.md |
| forms — action | `app/(frontend)/[locale]/actions.ts` | `'use server'`; `export const sendForm = createSubmitAction({ getCachedPayload, headers })` (`/server`) | submit → document in Form Submissions + e-mails | forms.md, skill **iapl-form** | | forms — action | `app/(frontend)/[locale]/actions.ts` | `'use server'`; `export const sendForm = createSubmitAction({ getCachedPayload, headers })` (`/server`) | submit → document in Form Submissions + e-mails | forms.md, skill **iapl-form** |
| forms — retention | config (client decision) | `forms: { submissionRetentionDays: 365 }` (1.18.0; default: kept) | `iapl-doctor --deep --only growth-submissions` quiet; old submissions gone a day after the next submission | performance.md §6, forms.md |
| forms — files | config + panel | `forms: { attachments: true }`; a **File** field on the form; an e-mail with fixed recipients in Forms → E-mails; `mailAdapter({ graph: { largeAttachments } })` when Graph must stay under 3 MB; Azure: `Mail.ReadWrite` limited to the forms mailbox for files of 3 MB and more over Graph | Test e-mail with "Attach a 10 MB test file" arrives; a submission with a PDF arrives with the attachment; nothing in Media | forms.md "Files", email.md "Attachments" | | forms — files | config + panel | `forms: { attachments: true }`; a **File** field on the form; an e-mail with fixed recipients in Forms → E-mails; `mailAdapter({ graph: { largeAttachments } })` when Graph must stay under 3 MB; Azure: `Mail.ReadWrite` limited to the forms mailbox for files of 3 MB and more over Graph | Test e-mail with "Attach a 10 MB test file" arrives; a submission with a PDF arrives with the attachment; nothing in Media | forms.md "Files", email.md "Attachments" |
| forms — render | form block | `<RenderForm form={form} action={sendForm} locale={locale} texts={formTexts} classNames={formClasses} />` (`/rsc`) | form from the panel, Turnstile, message from Notifications | forms.md | | forms — render | form block | `<RenderForm form={form} action={sendForm} locale={locale} texts={formTexts} classNames={formClasses} />` (`/rsc`) | form from the panel, Turnstile, message from Notifications | forms.md |
| Turnstile | panel / env | `SiteProviders` wires `TurnstileProvider`; keys in Site integrations → Spam protection or env; server: `verifyTurnstile` (`/server`) | widget in the form; dashboard alert on a bad key | turnstile.md | | Turnstile | panel / env | `SiteProviders` wires `TurnstileProvider`; keys in Site integrations → Spam protection or env; server: `verifyTurnstile` (`/server`) | widget in the form; dashboard alert on a bad key | turnstile.md |
@@ -267,6 +289,7 @@ The plugin's own variables are `IAPL_<NAME>`; a deploy that sets the spelling fr
| `IAPL_IP_HEADER` | `ipHeader: true` + production | rate limit trusts any IP header (spoofing) + warning in prod | env: `cf-connecting-ip` (Cloudflare) / `x-forwarded-for` (Traefik/nginx) | | `IAPL_IP_HEADER` | `ipHeader: true` + production | rate limit trusts any IP header (spoofing) + warning in prod | env: `cf-connecting-ip` (Cloudflare) / `x-forwarded-for` (Traefik/nginx) |
| `IAPL_COOKIE_SCAN_URL`, `IAPL_COOKIE_SCAN_TOKEN` | `cookieScanner.crawl` (`iaplEnvRules({ cookieCrawl: true })` requires both in production; token ≥ 16 chars) | **Check site** disabled, the box names the missing variable | env; the token also goes into the scanner service's `IAPL_CRAWLER_SITES` as `host=token` | | `IAPL_COOKIE_SCAN_URL`, `IAPL_COOKIE_SCAN_TOKEN` | `cookieScanner.crawl` (`iaplEnvRules({ cookieCrawl: true })` requires both in production; token ≥ 16 chars) | **Check site** disabled, the box names the missing variable | env; the token also goes into the scanner service's `IAPL_CRAWLER_SITES` as `host=token` |
| `IAPL_DOCTOR_TOKEN` | no; ≥ 32 characters | `GET /api/ipal/doctor` answers 404; with it the endpoint answers a Bearer token, and `iapl-doctor --url` with the same variable reads the deep counts | env (Coolify) and the doctor's shell; also read by the doctor: `CI`, `NO_COLOR`, `PAYLOAD_CONFIG_PATH` (`--deep`), `IAPL_DOCTOR_IMPORT_MAP` (internal) — doctor.md | | `IAPL_DOCTOR_TOKEN` | no; ≥ 32 characters | `GET /api/ipal/doctor` answers 404; with it the endpoint answers a Bearer token, and `iapl-doctor --url` with the same variable reads the deep counts | env (Coolify) and the doctor's shell; also read by the doctor: `CI`, `NO_COLOR`, `PAYLOAD_CONFIG_PATH` (`--deep`), `IAPL_DOCTOR_IMPORT_MAP` (internal) — doctor.md |
| `CRON_SECRET` | no; ≥ 16 characters (name: `jobsRunAccess.secretVar`) | Payload's job queue runs over HTTP only for an admin; the start log says so when the queue is on | env (Coolify); the cron sends `Authorization: Bearer <CRON_SECRET>` to `/api/payload-jobs/run` |
| `IAPL_NOINDEX` | no; `1`/`true`/`yes` **staging/preview only** | — (when set: robots Disallow, meta noindex, `X-Robots-Tag`, IndexNow sends nothing) | staging env | | `IAPL_NOINDEX` | no; `1`/`true`/`yes` **staging/preview only** | — (when set: robots Disallow, meta noindex, `X-Robots-Tag`, IndexNow sends nothing) | staging env |
| `NEXT_PHASE` | set by Next | only tells `next build` from runtime: during the build an unreachable database gives an empty sitemap; at runtime the sitemap throws (route → 503) | do not set by hand | | `NEXT_PHASE` | set by Next | only tells `next build` from runtime: during the build an unreachable database gives an empty sitemap; at runtime the sitemap throws (route → 503) | do not set by hand |
| `NEXT_RUNTIME` | set by Next | `instrumentation.ts` checks for `nodejs`; missing (scripts, seed) → `buildRevalidateHook` does not revalidate | do not set by hand | | `NEXT_RUNTIME` | set by Next | `instrumentation.ts` checks for `nodejs`; missing (scripts, seed) → `buildRevalidateHook` does not revalidate | do not set by hand |
@@ -1,7 +1,7 @@
# IAPL — export index # IAPL — export index
Every public export of `@intecion/ipal-kit` (all entries: root, `/client`, `/rsc`, Every public export of `@intecion/ipal-kit` (all entries: root, `/client`, `/rsc`,
`/server`, `/seed`, `/starter`, `/next/middleware`, `/admin`, `/env`, `/blocks`, `/blocks/rsc`, `/templates`, `/tokens`, `/doctor`), grouped by module. Search with grep `/client/eager`, `/server`, `/seed`, `/starter`, `/next/middleware`, `/admin`, `/env`, `/blocks`, `/blocks/rsc`, `/templates`, `/tokens`, `/doctor`), grouped by module. Search with grep
(`grep -n "name" .agents/skills/iapl-reference/resources/api.md`) before you write anything yourself. (`grep -n "name" .agents/skills/iapl-reference/resources/api.md`) before you write anything yourself.
"Import from" column — the first entry is preferred. Plugin options, env, routes and what the "Import from" column — the first entry is preferred. Plugin options, env, routes and what the
project wires: `../SKILL.md`. Module details: `node_modules/@intecion/ipal-kit/docs/<page>.md`. project wires: `../SKILL.md`. Module details: `node_modules/@intecion/ipal-kit/docs/<page>.md`.
@@ -13,7 +13,7 @@ project wires: `../SKILL.md`. Module details: `node_modules/@intecion/ipal-kit/d
| `ipalKit`, `IpalOptions`, `ipalEnvRules`, `IpalEnvFeatures`, `ipalT`, `ipalVar`, `IPAL_TOKENS`, `IPAL_BREAKPOINTS`, `IpalTokenName`, `IpalGlobalSlug` | as their new names | The names before 1.17.0 of `iapl`, `IaplOptions`, `iaplEnvRules`, `IaplEnvFeatures`, `iaplT`, `iaplVar`, `IAPL_TOKENS`, `IAPL_BREAKPOINTS`, `IaplTokenName`, `IaplGlobalSlug`: the same values, deprecated, removed in 2.0. Existing code keeps them; new code uses the new names (AGENT.md "Names: IAPL and ipal-kit"). | | `ipalKit`, `IpalOptions`, `ipalEnvRules`, `IpalEnvFeatures`, `ipalT`, `ipalVar`, `IPAL_TOKENS`, `IPAL_BREAKPOINTS`, `IpalTokenName`, `IpalGlobalSlug` | as their new names | The names before 1.17.0 of `iapl`, `IaplOptions`, `iaplEnvRules`, `IaplEnvFeatures`, `iaplT`, `iaplVar`, `IAPL_TOKENS`, `IAPL_BREAKPOINTS`, `IaplTokenName`, `IaplGlobalSlug`: the same values, deprecated, removed in 2.0. Existing code keeps them; new code uses the new names (AGENT.md "Names: IAPL and ipal-kit"). |
| `iapl(options)` | `@intecion/ipal-kit` | Payload 3 plugin (`plugins: [iapl({...})]`) — the only wiring point: adds globals (SiteSettings, SiteIntegrations, CookieSettings, Notifications), roles, enforced 2FA, SEO, forms, i18n (localization), white-label, stats, consent log, `/api/ipal/*` endpoints; no auth collection → injects a simple `users`. Validates `i18n` right away (fail fast). `enabled: false` = schema stays, behaviour off. | | `iapl(options)` | `@intecion/ipal-kit` | Payload 3 plugin (`plugins: [iapl({...})]`) — the only wiring point: adds globals (SiteSettings, SiteIntegrations, CookieSettings, Notifications), roles, enforced 2FA, SEO, forms, i18n (localization), white-label, stats, consent log, `/api/ipal/*` endpoints; no auth collection → injects a simple `users`. Validates `i18n` right away (fail fast). `enabled: false` = schema stays, behaviour off. |
**Types:** `IaplOptions` — `iapl()` options: `i18n`, `access`, `twoFactor` (`{ issuer, plugin: payloadTotp }` or `false`), `whiteLabel`, `adminRoute`, `consentLog`, `content`, `cookieScanner`, `forms`, `pages`, `seo`, `searchSettings`, `stats`, `indexNow`, `siteSettingsFields`, `integrationsFields`, `globalOverrides`, `revalidatePath`, `enabled`. `GlobalOverride`, `GlobalOverrides`, `IaplGlobalSlug` — see Payload globals below. **Types:** `IaplOptions` — `iapl()` options: `i18n`, `access`, `twoFactor` (`{ issuer, plugin: payloadTotp }` or `false`), `whiteLabel`, `adminRoute`, `consentLog`, `content`, `cookieScanner`, `forms`, `pages`, `seo`, `searchSettings`, `stats`, `indexNow`, `siteSettingsFields`, `integrationsFields`, `globalOverrides`, `revalidatePath`, `unusedMedia`, `enabled`. `GlobalOverride`, `GlobalOverrides`, `IaplGlobalSlug` — see Payload globals below.
## Admin (import map) (`admin`, `branding`, `admin-ui`, `globals/SiteIntegrations`) — details: `node_modules/@intecion/ipal-kit/docs/white-label.md`, `…/docs/integrations.md`, `…/docs/email.md`, `…/docs/links.md` ## Admin (import map) (`admin`, `branding`, `admin-ui`, `globals/SiteIntegrations`) — details: `node_modules/@intecion/ipal-kit/docs/white-label.md`, `…/docs/integrations.md`, `…/docs/email.md`, `…/docs/links.md`
@@ -38,6 +38,8 @@ Admin panel components from `@intecion/ipal-kit/admin` — the project does NOT
| `TwoFactorResetButton` | `@intecion/ipal-kit/admin` | Client button inside `TwoFactorStatusField`: `POST /api/ipal/two-factor/reset` `{ userId }`, then reloads the view. Props `{ kind: 'reset' \| 'reopen', userId }`. | | `TwoFactorResetButton` | `@intecion/ipal-kit/admin` | Client button inside `TwoFactorStatusField`: `POST /api/ipal/two-factor/reset` `{ userId }`, then reloads the view. Props `{ kind: 'reset' \| 'reopen', userId }`. |
| `TwoFactorAlert` | `@intecion/ipal-kit/admin` | Server component on the dashboard (`beforeDashboard`), administrators only: accounts without two-step verification and how many are blocked. Wired by the plugin with `twoFactor.requireSetup`; renders nothing when every account has it. | | `TwoFactorAlert` | `@intecion/ipal-kit/admin` | Server component on the dashboard (`beforeDashboard`), administrators only: accounts without two-step verification and how many are blocked. Wired by the plugin with `twoFactor.requireSetup`; renders nothing when every account has it. |
| `IntecionCredit` | `@intecion/ipal-kit/admin` | The line "Technology support: Intecion.com" (admin language; `agency` prop = the name) below the nav and below the login form (`variant: 'nav' \| 'login'`). Injected by the plugin with `whiteLabel`; turn off: `whiteLabel: { credit: false }` or `agency: false`. | | `IntecionCredit` | `@intecion/ipal-kit/admin` | The line "Technology support: Intecion.com" (admin language; `agency` prop = the name) below the nav and below the login form (`variant: 'nav' \| 'login'`). Injected by the plugin with `whiteLabel`; turn off: `whiteLabel: { credit: false }` or `agency: false`. |
| `SignInPanel` | `@intecion/ipal-kit/admin` | Server component: the dark sign-in panel with its stylesheet (`<style>` deduplicated by React) — label, the logo or the site's name from Site settings as a link to the site, language links. Props `look` (`SignInLookProps`) plus what Payload injects (`payload`, `i18n`, `locale`, `user`); `SignInPanelProps`. Hidden by its own CSS on any page that is not Payload's minimal template. `AdminLogo` (prop `signIn`) and `SafeTotpView` (prop `iaplSignIn`) render it when the provider does not. |
| `SignInLook` | `@intecion/ipal-kit/admin` | Admin provider (`admin.components.providers`, `serverProps: { look }`; `SignInLookProviderProps`): prints `SignInPanel` on every admin page so that every minimal screen has it. Registered by `whiteLabel: { signIn: { allScreens: true } }`. |
| `buildAdminMeta({ agency, apiRoute?, defaultLocale?, meta?, options? })` | `@intecion/ipal-kit` | The `adminMeta` step: static panel meta (robots, preview image, icon) without overwriting keys in `meta`; returns `{ meta, resolved }` | | `buildAdminMeta({ agency, apiRoute?, defaultLocale?, meta?, options? })` | `@intecion/ipal-kit` | The `adminMeta` step: static panel meta (robots, preview image, icon) without overwriting keys in `meta`; returns `{ meta, resolved }` |
| `adminMetaForSite(site, resolved)`, `syncAdminMeta(payload, resolved, { nameField?, settingsSlug? })` | `@intecion/ipal-kit` | Site-name parts (suffix, description, siteName); `syncAdminMeta` writes them into the live config (onInit + Site settings afterChange, never throws) | | `adminMetaForSite(site, resolved)`, `syncAdminMeta(payload, resolved, { nameField?, settingsSlug? })` | `@intecion/ipal-kit` | Site-name parts (suffix, description, siteName); `syncAdminMeta` writes them into the live config (onInit + Site settings afterChange, never throws) |
| `buildAdminImageEndpoints(resolved, { settingsSlug?, nameField?, logoField?, iconField? })` | `@intecion/ipal-kit` | `GET /api/ipal/admin-og` (1200×630 PNG via `next/og`) and `GET /api/ipal/admin-icon` (the favicon itself, or initials) — already added by `adminMeta` | | `buildAdminImageEndpoints(resolved, { settingsSlug?, nameField?, logoField?, iconField? })` | `@intecion/ipal-kit` | `GET /api/ipal/admin-og` (1200×630 PNG via `next/og`) and `GET /api/ipal/admin-icon` (the favicon itself, or initials) — already added by `adminMeta` |
@@ -75,7 +77,7 @@ Admin panel components from `@intecion/ipal-kit/admin` — the project does NOT
| `writeOnlySecret(field, options?)`, `writeOnlySecrets(fields, names, optionsByName?)`, `maskSecretAfterRead`, `keepSecretBeforeValidate`, `buildKeepSecret(options?)`, `SECRET_MASK`, `SECRET_CLEAR`, `isSecretMask(value)`, `INTEGRATION_SECRET_FIELDS`, `SMTP_PASSWORD_BOUND_TO` | `@intecion/ipal-kit` | Write-only secret fields (`secrets.writeOnly`): the wrapper for one field and for named fields anywhere in a tree (tabs, rows, groups); the two field hooks (reads through access control get `'********'`, the Local API with access control off gets the value; a save with nothing / empty / the mask keeps the stored value, `'[[clear]]'` removes it); the hook builder with options — `{ boundTo: ['siblingField'], appliesWhen?: (siblingData) => boolean }`: a save through access control that changes a bound sibling field without sending the secret throws a `ValidationError` on the secret (`secrets.reenterOnChange`); the two constants; the plugin's own secret field names (`smtpPassword`, `turnstileSecretKey`); the fields the SMTP password is bound to (`smtpHost`, `smtpPort`, `smtpUser` — not the transport: the mail adapter may fall back to SMTP). | | `writeOnlySecret(field, options?)`, `writeOnlySecrets(fields, names, optionsByName?)`, `maskSecretAfterRead`, `keepSecretBeforeValidate`, `buildKeepSecret(options?)`, `SECRET_MASK`, `SECRET_CLEAR`, `isSecretMask(value)`, `INTEGRATION_SECRET_FIELDS`, `SMTP_PASSWORD_BOUND_TO` | `@intecion/ipal-kit` | Write-only secret fields (`secrets.writeOnly`): the wrapper for one field and for named fields anywhere in a tree (tabs, rows, groups); the two field hooks (reads through access control get `'********'`, the Local API with access control off gets the value; a save with nothing / empty / the mask keeps the stored value, `'[[clear]]'` removes it); the hook builder with options — `{ boundTo: ['siblingField'], appliesWhen?: (siblingData) => boolean }`: a save through access control that changes a bound sibling field without sending the secret throws a `ValidationError` on the secret (`secrets.reenterOnChange`); the two constants; the plugin's own secret field names (`smtpPassword`, `turnstileSecretKey`); the fields the SMTP password is bound to (`smtpHost`, `smtpPort`, `smtpUser` — not the transport: the mail adapter may fall back to SMTP). |
| `maskSecretsOnRestore`, `maskWriteOnlySecrets(data, fields)` | `@intecion/ipal-kit` | Versions and write-only secrets: the `afterRead` hook for a global or a collection (a restore answers with the version document, fields under `version`, where field hooks do not run — it masks them there for reads through access control); the walker it uses (masks every write-only field in `data`, following tabs, rows, groups, arrays and blocks). On Site integrations by default; add the hook to your own entity that has both. | | `maskSecretsOnRestore`, `maskWriteOnlySecrets(data, fields)` | `@intecion/ipal-kit` | Versions and write-only secrets: the `afterRead` hook for a global or a collection (a restore answers with the version document, fields under `version`, where field hooks do not run — it masks them there for reads through access control); the walker it uses (masks every write-only field in `data`, following tabs, rows, groups, arrays and blocks). On Site integrations by default; add the hook to your own entity that has both. |
| `requestFromOwnOrigin(req, extraOrigins?)`, `ownOrigins(req, extraOrigins?)`, `reportRefusedOrigin(req, extraOrigins?)` | `@intecion/ipal-kit` | `twoFactor.sameOrigin`: `false` when a browser marks the request as coming from another origin (`Origin` not among the request's host, `serverURL`, `csrf`, `cors`, the extras; a default port written out on the host is ignored; else `Sec-Fetch-Site` not `same-origin` / `none`); `true` without those headers. `ownOrigins` → `{ hosts, origins }`. `reportRefusedOrigin` writes one log line per refused origin and process (at most 50) with the ways to allow it, and returns whether it wrote. For your own state-changing endpoint. | | `requestFromOwnOrigin(req, extraOrigins?)`, `ownOrigins(req, extraOrigins?)`, `reportRefusedOrigin(req, extraOrigins?)` | `@intecion/ipal-kit` | `twoFactor.sameOrigin`: `false` when a browser marks the request as coming from another origin (`Origin` not among the request's host, `serverURL`, `csrf`, `cors`, the extras; a default port written out on the host is ignored; else `Sec-Fetch-Site` not `same-origin` / `none`); `true` without those headers. `ownOrigins` → `{ hosts, origins }`. `reportRefusedOrigin` writes one log line per refused origin and process (at most 50) with the ways to allow it, and returns whether it wrote. For your own state-changing endpoint. |
| `buildVerifyLimit(collection, { max?, windowMinutes?, store?, keyPrefix? })`, `verifyLimitKey(collection, id, keyPrefix?)`, `clearVerifyLimits()` | `@intecion/ipal-kit` | `twoFactor.verifyLimit`: `async (req) => Response \| null` — counts an attempt of `req.user` in memory and, unless `store: 'memory'`, in `payload.kv`; a `429` with `Retry-After` past `max`. The kv key of an account's count; emptying the in-memory counts (tests). | | `buildVerifyLimit(collection, { max?, windowMinutes?, store?, keyPrefix? })`, `verifyLimitKey(collection, id, keyPrefix?)`, `clearVerifyLimits()` | `@intecion/ipal-kit` | `twoFactor.verifyLimit`: `async (req) => Response \| null` — takes a place for an attempt of `req.user` in memory and, unless `store: 'memory'`, in `payload.kv`; a `429` with `Retry-After` past `max` (`Retry-After: 2` when only attempts still being checked hold it). `limit.settle(req, correct)` after the check: a right code gives its place back (unsettled = wrong). The kv key of an account's count; emptying the in-memory counts (tests). |
| `turnstileSecretFromEnv(integrations)`, `TURNSTILE_SECRET_ENV` | `@intecion/ipal-kit` | `true` when the Turnstile secret in use comes from the environment because the panel field is empty (**deprecated** path; the doctor's `turnstile-env-key`); the variable's name, `'TURNSTILE_SECRET_KEY'`. | | `turnstileSecretFromEnv(integrations)`, `TURNSTILE_SECRET_ENV` | `@intecion/ipal-kit` | `true` when the Turnstile secret in use comes from the environment because the panel field is empty (**deprecated** path; the doctor's `turnstile-env-key`); the variable's name, `'TURNSTILE_SECRET_KEY'`. |
| `userMeetsRole(req, minimum)` | `@intecion/ipal-kit` | Predicate → `boolean` with `req` (`{ payload, user }`), in this order: the account belongs to a **staff collection** (`admin.user`, `access.authCollection`, `access.staffCollections`); with 2FA on it has passed the second factor (`secondFactorPassed`); it has a role ≥ `minimum`, **or** its collection has no `roles` field (the project omitted `access`). An account of any other auth collection never passes, whatever fields it has. The plugin's staff features (Site integrations, settings globals, form submissions, consent records, stats, cookie scanner, the e-mail test) use it; use it in your own endpoints. | | `userMeetsRole(req, minimum)` | `@intecion/ipal-kit` | Predicate → `boolean` with `req` (`{ payload, user }`), in this order: the account belongs to a **staff collection** (`admin.user`, `access.authCollection`, `access.staffCollections`); with 2FA on it has passed the second factor (`secondFactorPassed`); it has a role ≥ `minimum`, **or** its collection has no `roles` field (the project omitted `access`). An account of any other auth collection never passes, whatever fields it has. The plugin's staff features (Site integrations, settings globals, form submissions, consent records, stats, cookie scanner, the e-mail test) use it; use it in your own endpoints. |
| `staffCollectionSlugs(source?)` | `@intecion/ipal-kit` | `string[]`: the staff collections — `admin.user`, `access.authCollection` and `access.staffCollections` — from `req.payload`, a config or `{ staffCollections }`; without an argument what the configs built in this process agree on (`[]` when there is none). Roles and staff checks count only for accounts of these. | | `staffCollectionSlugs(source?)` | `@intecion/ipal-kit` | `string[]`: the staff collections — `admin.user`, `access.authCollection` and `access.staffCollections` — from `req.payload`, a config or `{ staffCollections }`; without an argument what the configs built in this process agree on (`[]` when there is none). Roles and staff checks count only for accounts of these. |
@@ -83,7 +85,12 @@ Admin panel components from `@intecion/ipal-kit/admin` — the project does NOT
| `buildRolesField(defaultRole?, { firstUserAdmin? })` | `@intecion/ipal-kit` | The `roles` select field the plugin injects (only admins set roles; `firstUserAdmin` default `true` = the account made on "Create first user" gets `admin`). The plugin wires it itself — use it only for an auth collection the plugin does not manage. | | `buildRolesField(defaultRole?, { firstUserAdmin? })` | `@intecion/ipal-kit` | The `roles` select field the plugin injects (only admins set roles; `firstUserAdmin` default `true` = the account made on "Create first user" gets `admin`). The plugin wires it itself — use it only for an auth collection the plugin does not manage. |
| `injectRoles(config, accessOption)` | `@intecion/ipal-kit` | Adds `roles` to `accessOption.authCollection` in a config. The plugin calls it itself with `access` — do not call. | | `injectRoles(config, accessOption)` | `@intecion/ipal-kit` | Adds `roles` to `accessOption.authCollection` in a config. The plugin calls it itself with `access` — do not call. |
**Types:** `AccountsOptions` (`accounts`: `panelRole`, `adminOnlyCreate`, `adminOnlyWrite`, `staffOnlyRead`, `firstUserRoute`, `password`), `StaffAccountAccessOptions` (`{ create?, write?, read?, pluginRoles? }`), `StaffRuleMark` (`{ slug, self }`), `AccountsMarker` (`{ slug, staff, own? }`, in `custom.ipalAccounts`; `own`: the operations that had a rule of the project's at config time, kept when the collection becomes staff later), `LateAdoption` (`{ slug, applied, kept, known, password, firstUser }`; `known`: in the config when iapl ran and staff only afterwards, `kept`: its operations whose own rule was left as written), `StaffAccountRules` (what the plugin put on a staff collection, in `custom.ipalAccountRules`: `{ applied, ownRoles }`), `WriteOnlySecretOptions` (`{ boundTo?, appliesWhen? }`), `PasswordRuleOptions` (`{ minLength? }`), `FirstUserRouteOption` (`'panel' \| 'all' \| string[]`), `TurnstileOnConfigError` / `TurnstileOnConfigErrorOption` / `TurnstileFormKind` (`@intecion/ipal-kit/server`), `VerifyLimitOptions` (`twoFactor.verifyLimit`: `{ max?, windowMinutes?, store? }`), `RequireSetupOptions` (`twoFactor.requireSetup`), `TwoFactorResetOptions`, `TwoFactorSetupState`, `SafeBackRule` / `SafeBackContext` (`twoFactor.safeBack` as a function: `(back, { adminRoute, origin? }) => string`), `TotpViewComponent` (a view component as registered: a path or `{ path, exportName?, clientProps?, serverProps? }`), `SafeTotpViewProps` (`@intecion/ipal-kit/admin`), `Role` (`'user' \| 'editor' \| 'admin'`), `AccessOption` (the plugin's `access` option: `authCollection`, `defaultRole`, `authAccess`, `firstUserAdmin`, `staffCollections`). | `requireOwnOrigin(endpoint, origins?)`, `guardAdminEndpoints(config, projectEndpoints, option)`, `ADMIN_POST_ENDPOINTS`, type `AdminSameOriginOption` | `@intecion/ipal-kit` | `adminSameOrigin` (1.18.0): wraps an endpoint so a request a browser marks as coming from another origin gets `403` (logged once per origin); applies it to the plugin's panel actions it added; the list of `[method, path]` covered. `reportRefusedOrigin(req, origins?, { what, option, docs }?)` names your option in the log line. |
| `lockedLooksWrong`, `withLockedAnswer(config)`, `graphqlLoginName(collection)` | `@intecion/ipal-kit` | `accounts.lockedAnswer` (1.18.0): the config-level `afterError` hook that answers Payload's `LockedAuth` on a staff collection's login (REST, GraphQL) exactly like `AuthenticationError`; adding it to a config (idempotent); the GraphQL login mutation's name of a collection. |
| `applySignInRules(collection, accounts?)`, `buildSignInBeforeOperation(slug, rules)`, `releaseSignInPlace`, `settleFailedSignIn`, `buildCurrentPasswordField()`, `resolveSignInRules(accounts?)`, `foldSignInName(value)`, `passwordMatches({ hash, salt }, password)`, `CURRENT_PASSWORD_FIELD`, `SIGN_IN_RULES_MARK` (the mark on the `beforeOperation` hook); types `SignInRulesOptions`, `SignInLimitOptions`, `SignInSameOriginOptions` | `@intecion/ipal-kit` | 1.18.0, `accounts.signInLimit` / `signInSameOrigin` / `confirmOwnChanges`: the three rules on one staff collection (hooks, field, Payload lock defaults); the `beforeOperation` hook; the `afterLogin` hook that gives a sign-in's place back; the config `afterError` hook that ends a failed one; the virtual "Current password" field; the options with defaults; the address folding (NFKC, lower case, trim); Payload's stored-hash check (unknown formats refused). |
| `releaseRateLimit({ key, scope, max?, windowMs?, cost? })` | `@intecion/ipal-kit` | Gives back a place `consumeRateLimit` took (memory: never below 0; a store: `hit(id, -cost)`) — for a limiter that counts failures only. |
**Types:** `AccountsOptions` (`accounts`: `panelRole`, `adminOnlyCreate`, `adminOnlyWrite`, `staffOnlyRead`, `firstUserRoute`, `password`, `lockedAnswer`, `signInLimit`, `signInSameOrigin`, `confirmOwnChanges`), `LockedAnswerOption`, `StaffAccountAccessOptions` (`{ create?, write?, read?, pluginRoles? }`), `StaffRuleMark` (`{ slug, self }`), `AccountsMarker` (`{ slug, staff, own? }`, in `custom.ipalAccounts`; `own`: the operations that had a rule of the project's at config time, kept when the collection becomes staff later), `LateAdoption` (`{ slug, applied, kept, known, password, firstUser }`; `known`: in the config when iapl ran and staff only afterwards, `kept`: its operations whose own rule was left as written), `StaffAccountRules` (what the plugin put on a staff collection, in `custom.ipalAccountRules`: `{ applied, ownRoles }`), `WriteOnlySecretOptions` (`{ boundTo?, appliesWhen? }`), `PasswordRuleOptions` (`{ minLength? }`), `FirstUserRouteOption` (`'panel' \| 'all' \| string[]`), `TurnstileOnConfigError` / `TurnstileOnConfigErrorOption` / `TurnstileFormKind` (`@intecion/ipal-kit/server`), `VerifyLimitOptions` (`twoFactor.verifyLimit`: `{ max?, windowMinutes?, store? }`), `RequireSetupOptions` (`twoFactor.requireSetup`), `TwoFactorResetOptions`, `TwoFactorSetupState`, `SafeBackRule` / `SafeBackContext` (`twoFactor.safeBack` as a function: `(back, { adminRoute, origin? }) => string`), `TotpViewComponent` (a view component as registered: a path or `{ path, exportName?, clientProps?, serverProps? }`), `SafeTotpViewProps` (`@intecion/ipal-kit/admin`), `Role` (`'user' \| 'editor' \| 'admin'`), `AccessOption` (the plugin's `access` option: `authCollection`, `defaultRole`, `authAccess`, `firstUserAdmin`, `staffCollections`).
## Accessibility — widget (`accessibility`) — details: `node_modules/@intecion/ipal-kit/docs/accessibility.md` ## Accessibility — widget (`accessibility`) — details: `node_modules/@intecion/ipal-kit/docs/accessibility.md`
@@ -148,7 +155,7 @@ Fifteen ready blocks and ten page templates. **Use a library block (or a variant
| `HeroBlock`, `TextMediaBlock`, `FeatureGridBlock`, `GalleryBlock`, `FaqBlock`, `CtaBlock`, `ContactBlock`, `TeamBlock`, `PricingBlock`, `LogosBlock`, `TestimonialsBlock`, `StatsBlock`, `RichTextBlock`, `StepsBlock`, `EntryListBlock` | `@intecion/ipal-kit/blocks/rsc` | The block components (server; props `LibraryBlockProps`: data + `locale`, `isFirst`, `ui`, `ctx`, `classNames`). | | `HeroBlock`, `TextMediaBlock`, `FeatureGridBlock`, `GalleryBlock`, `FaqBlock`, `CtaBlock`, `ContactBlock`, `TeamBlock`, `PricingBlock`, `LogosBlock`, `TestimonialsBlock`, `StatsBlock`, `RichTextBlock`, `StepsBlock`, `EntryListBlock` | `@intecion/ipal-kit/blocks/rsc` | The block components (server; props `LibraryBlockProps`: data + `locale`, `isFirst`, `ui`, `ctx`, `classNames`). |
| `HERO_PARTS`, `TEXT_MEDIA_PARTS`, `FEATURE_GRID_PARTS`, `GALLERY_PARTS`, `FAQ_PARTS`, `CTA_PARTS`, `CONTACT_PARTS`, `TEAM_PARTS`, `PRICING_PARTS`, `LOGOS_PARTS`, `TESTIMONIALS_PARTS`, `STATS_PARTS`, `RICH_TEXT_PARTS`, `STEPS_PARTS`, `ENTRY_LIST_PARTS` | `@intecion/ipal-kit/blocks/rsc` | Default token classes per block part — the keys of `classNames`. | | `HERO_PARTS`, `TEXT_MEDIA_PARTS`, `FEATURE_GRID_PARTS`, `GALLERY_PARTS`, `FAQ_PARTS`, `CTA_PARTS`, `CONTACT_PARTS`, `TEAM_PARTS`, `PRICING_PARTS`, `LOGOS_PARTS`, `TESTIMONIALS_PARTS`, `STATS_PARTS`, `RICH_TEXT_PARTS`, `STEPS_PARTS`, `ENTRY_LIST_PARTS` | `@intecion/ipal-kit/blocks/rsc` | Default token classes per block part — the keys of `classNames`. |
| `defaultEntryCard(doc)`, `defaultTestimonial(doc)` | `@intecion/ipal-kit/blocks/rsc` | Default mapping of a collection document to an entry card / a testimonial (`entryCard`, `mapTestimonial` replace them). | | `defaultEntryCard(doc)`, `defaultTestimonial(doc)` | `@intecion/ipal-kit/blocks/rsc` | Default mapping of a collection document to an entry card / a testimonial (`entryCard`, `mapTestimonial` replace them). |
| `Section`, `SECTION_BACKGROUNDS`, `SectionHeader`, `Media`, `CMSLink`, `Anchor`, `buttonClass`, `BUTTON_CLASSES`, `Container`, `CONTAINER_WIDTHS`, `Card`, `CARD_CLASS`, `CARD_INTERACTIVE_CLASS` | `@intecion/ipal-kit/blocks/rsc` | UI primitives, token utilities only: section (anchor, background, `data-surface`), heading group, image/video, panel link, link element, button looks, page column, card. | | `Section`, `SECTION_BACKGROUNDS`, `SectionHeader`, `Media`, `CMSLink`, `Anchor`, `buttonClass`, `BUTTON_CLASSES`, `Container`, `CONTAINER_WIDTHS`, `Card`, `CARD_CLASS`, `CARD_INTERACTIVE_CLASS`, `CARD_INTERACTIVE_SHADOW_CLASS` | `@intecion/ipal-kit/blocks/rsc` | UI primitives, token utilities only: section (anchor, background, `data-surface`), heading group, image/video (`Media`: `priority`, `eager`, `sizes`, `videoMode`, `pauseForReducedMotion` — a background video paused for "reduce motion", default true), panel link, link element, button looks, page column, card (hover: an `::after` shadow layer fading with `opacity`; the 1.17 `box-shadow` transition is `CARD_INTERACTIVE_SHADOW_CLASS`). |
| `itemHeadingLevel(slug, props)`, `leadsWithImage(props)` | `@intecion/ipal-kit/blocks/rsc` | Item heading tag (one below the section heading; `h2` without one; `itemHeadings` overrides) and whether the block's first image is the page's LCP image (`isFirst` / `firstImage`; `priorityImage: false` turns it off). | | `itemHeadingLevel(slug, props)`, `leadsWithImage(props)` | `@intecion/ipal-kit/blocks/rsc` | Item heading tag (one below the section heading; `h2` without one; `itemHeadings` overrides) and whether the block's first image is the page's LCP image (`isFirst` / `firstImage`; `priorityImage: false` turns it off). |
| `Buttons`, `headingId(block)`, `TitleLink`, `GRID_COLUMNS`, `cx`, `parts(defaults, overrides)` | `@intecion/ipal-kit/blocks/rsc` | Helpers for own blocks: button row, heading id for `aria-labelledby`, card title link (plain text when the link is dead), grid columns, class joining, part classes. | | `Buttons`, `headingId(block)`, `TitleLink`, `GRID_COLUMNS`, `cx`, `parts(defaults, overrides)` | `@intecion/ipal-kit/blocks/rsc` | Helpers for own blocks: button row, heading id for `aria-labelledby`, card title link (plain text when the link is dead), grid columns, class joining, part classes. |
| `BLOCK_TEXTS`, `blockTexts(locale, own?)`, `fillText(text, value)` | `@intecion/ipal-kit/blocks/rsc` | Visitor texts the blocks write (rating, step) in en/pl; override with `texts`. | | `BLOCK_TEXTS`, `blockTexts(locale, own?)`, `fillText(text, value)` | `@intecion/ipal-kit/blocks/rsc` | Visitor texts the blocks write (rating, step) in en/pl; override with `texts`. |
@@ -163,8 +170,10 @@ Fifteen ready blocks and ten page templates. **Use a library block (or a variant
|---|---|---| |---|---|---|
| `ConsentProvider` | `@intecion/ipal-kit/client` | Consent provider: `{ texts, cookieMap?, logEndpoint?, nonce?, cookieValue?, gpc?, maxAgeDays? }` (`gpc`: Global Privacy Control `'honour'` default / `'ask'` / `false`; `maxAgeDays`: re-ask period, default 180; withdrawal also removes the panel's listed storage keys and tells Meta / TikTok / Clarity) (`nonce`: CSP nonce for the banner's first-paint script; `cookieValue`: optional server-read consent cookie → exact HTML, dynamic pages) — consent state, cookie, Consent Mode, deleting cookies after consent is withdrawn, optional POST of the decision to the log (`'/api/ipal/consent'`). Wrap the layout once; required by the banner, `Analytics`, `ConsentScript`. | | `ConsentProvider` | `@intecion/ipal-kit/client` | Consent provider: `{ texts, cookieMap?, logEndpoint?, nonce?, cookieValue?, gpc?, maxAgeDays? }` (`gpc`: Global Privacy Control `'honour'` default / `'ask'` / `false`; `maxAgeDays`: re-ask period, default 180; withdrawal also removes the panel's listed storage keys and tells Meta / TikTok / Clarity) (`nonce`: CSP nonce for the banner's first-paint script; `cookieValue`: optional server-read consent cookie → exact HTML, dynamic pages) — consent state, cookie, Consent Mode, deleting cookies after consent is withdrawn, optional POST of the decision to the log (`'/api/ipal/consent'`). Wrap the layout once; required by the banner, `Analytics`, `ConsentScript`. |
| `CookieBanner` | `@intecion/ipal-kit/client` | Consent banner + category settings: `settings: 'inline' \| 'modal' \| 'detailed'`, `controls`, `equalChoice` (recommended `true`), `order`, `settingsActions`, `icon`, `classNames`, `firstPaint` (default `true`: in the server HTML, decided before the first paint by an inline script; pages stay static), `nonce`; colours from `--ipal-*` CSS vars. Do not write your own banner. | | `CookieBanner` | `@intecion/ipal-kit/client` | Consent banner + category settings: `settings: 'inline' \| 'modal' \| 'detailed'`, `controls`, `equalChoice` (recommended `true`), `order`, `settingsActions`, `icon`, `classNames`, `firstPaint` (default `true`: in the server HTML, decided before the first paint by an inline script; pages stay static), `nonce`; colours from `--ipal-*` CSS vars. Do not write your own banner. |
| `CookieButton` | `@intecion/ipal-kit/client` | Floating button that reopens the cookie settings (withdrawing consent); hidden while the banner is visible. Props `className`, `side` (`'left' \| 'right'`), `avoid` (selector it lifts above, default `COOKIE_BUTTON_AVOID` = footer; `false`). Tokens `--ipal-cookie-button-offset`, `--ipal-cookie-button-inset`. Type `CookieButtonProps`. | | `CookieButton` | `@intecion/ipal-kit/client` | Floating button that reopens the cookie settings (withdrawing consent); hidden while the banner is visible. Fixed in the bottom corner of the window on every page and never moves (1.18.0: it no longer climbs above the footer). While it is shown the footer gets just enough bottom padding for its last row to end above the button (measured; the footer's own padding counts; nothing where the corner is empty; made before the first paint for a returning visitor). Props `className`, `side` (`'left' \| 'right'`), `reserve` (selector of the block that gets the room, default `COOKIE_BUTTON_RESERVE` = footer; `false` = none), `avoid` (placement before 1.18.0: selector it lifts above — `COOKIE_BUTTON_AVOID`). Amount by hand: `--ipal-cookie-button-space` on the footer (`0` = none). Tokens `--ipal-cookie-button-offset`, `--ipal-cookie-button-inset`. Type `CookieButtonProps`. |
| `COOKIE_BUTTON_AVOID`, `bottomOverlap(tops, viewportHeight)` | `@intecion/ipal-kit/client` | Default footer selector; pixels the footer covers at the bottom of the screen (how far the button moves up) | | `COOKIE_BUTTON_AVOID`, `bottomOverlap(tops, viewportHeight)` | `@intecion/ipal-kit/client` | Footer selector for the placement before 1.18.0 (`<CookieButton avoid={COOKIE_BUTTON_AVOID} />`); pixels the footer covers at the bottom of the screen (how far the button moves up then) |
| `COOKIE_BUTTON_RESERVE`, `COOKIE_BUTTON_SPACE_ATTRIBUTE`, `reserveCookieButtonSpace(options)` | `@intecion/ipal-kit/client` | Default selector of the block that gets room for the cookie button (the footer); the attribute that marks it while the room is there; the function that measures and applies (or, with `release: true`, removes) it — options type `CookieButtonSpaceOptions` (`selector`, `side`, `button?`, `release?`, `sheet?`). For a button of your own |
| `consentDecidedScript({ version?, gpc?, cookieName? })` | `@intecion/ipal-kit` | JavaScript statements for an inline script: leave `true` in `d` when the browser holds a current consent decision (as `readConsentRecord` decides). The shared start of the plugin's pre-paint scripts |
| `TOTP_TEXTS`, `TOTP_VIEW_TITLE` | `@intecion/ipal-kit` | en/pl texts of the 2FA screens (`totpPlugin:*`, merged by `twoFactor`) and their tab title | | `TOTP_TEXTS`, `TOTP_VIEW_TITLE` | `@intecion/ipal-kit` | en/pl texts of the 2FA screens (`totpPlugin:*`, merged by `twoFactor`) and their tab title |
| `ConsentScript` | `@intecion/ipal-kit/client` | Loads an external script (`src` or `code`) only after consent for `category` — for vendors without Consent Mode (chat, Plausible etc.). Inside `ConsentProvider`. | | `ConsentScript` | `@intecion/ipal-kit/client` | Loads an external script (`src` or `code`) only after consent for `category` — for vendors without Consent Mode (chat, Plausible etc.). Inside `ConsentProvider`. |
| `CookieTable` | `@intecion/ipal-kit/rsc` | Server Component: cookie table for the cookie policy page — `{ rows, labels?, locale?, categories?, caption?, classNames?, storageColumn?, storageTypes? }`; `rows` from `getCookieTable()`; a **Type** column when a row is local / session storage (`storageColumn: 'auto' \| boolean`). | | `CookieTable` | `@intecion/ipal-kit/rsc` | Server Component: cookie table for the cookie policy page — `{ rows, labels?, locale?, categories?, caption?, classNames?, storageColumn?, storageTypes? }`; `rows` from `getCookieTable()`; a **Type** column when a row is local / session storage (`storageColumn: 'auto' \| boolean`). |
@@ -195,7 +204,7 @@ Fifteen ready blocks and ten page templates. **Use a library block (or a variant
| `readEffectiveConsent(version, gpc?)` | `@intecion/ipal-kit/client` | The stored choice under `version` with Global Privacy Control applied, read live from the cookie and `navigator` (not React state) — for your own tag loader's effects. | | `readEffectiveConsent(version, gpc?)` | `@intecion/ipal-kit/client` | The stored choice under `version` with Global Privacy Control applied, read live from the cookie and `navigator` (not React state) — for your own tag loader's effects. |
| `signalVendors(prev, next)` / `clarityConsent(state)` | `@intecion/ipal-kit/client` | Tells the running Meta Pixel (`fbq('consent', …)`), TikTok (`ttq.revokeConsent` / `grantConsent`) and Clarity (`consentv2` / `consent false`) about a change; `useConsent` calls it on every decision — for your own banner. `clarityConsent` → Clarity's `{ ad_Storage, analytics_Storage }`. | | `signalVendors(prev, next)` / `clarityConsent(state)` | `@intecion/ipal-kit/client` | Tells the running Meta Pixel (`fbq('consent', …)`), TikTok (`ttq.revokeConsent` / `grantConsent`) and Clarity (`consentv2` / `consent false`) about a change; `useConsent` calls it on every decision — for your own banner. `clarityConsent` → Clarity's `{ ad_Storage, analytics_Storage }`. |
| `buildConsentLogCollection()` | `@intecion/ipal-kit` | Consent log collection (id, choices, version, time — no IP/personal data; proof of consent under GDPR Art. 7(1)). The plugin wires it itself with `consentLog: true` — do not call. | | `buildConsentLogCollection()` | `@intecion/ipal-kit` | Consent log collection (id, choices, version, time — no IP/personal data; proof of consent under GDPR Art. 7(1)). The plugin wires it itself with `consentLog: true` — do not call. |
| `buildConsentLogEndpoint({ retentionDays? })` | `@intecion/ipal-kit` | `POST /api/ipal/consent` endpoint that saves decisions and deletes records older than `retentionDays` (default 1095). The plugin wires it itself with `consentLog` — do not call. | | `buildConsentLogEndpoint({ retentionDays? })` | `@intecion/ipal-kit` | `POST /api/ipal/consent` endpoint that saves decisions and deletes records older than `retentionDays` (default 1095). The plugin wires it itself with `consentLog` — do not call. On MongoDB a TTL index (`consentLog.ttlIndex`, default true) deletes them too, also without new records. |
**Built-in texts:** `CONSENT_FALLBACK`, `CONSENT_FALLBACK_PL`, `consentFallback(locale)` (banner defaults by page language), `CONSENT_CATEGORY_LABELS` / `consentCategoryOptions()` (category names `{ en, pl }`), `COOKIE_TABLE_LABELS` (`/rsc`, `<CookieTable locale>` defaults), `COOKIE_STORAGE_LABELS` (`/rsc`, type names per language). **Built-in texts:** `CONSENT_FALLBACK`, `CONSENT_FALLBACK_PL`, `consentFallback(locale)` (banner defaults by page language), `CONSENT_CATEGORY_LABELS` / `consentCategoryOptions()` (category names `{ en, pl }`), `COOKIE_TABLE_LABELS` (`/rsc`, `<CookieTable locale>` defaults), `COOKIE_STORAGE_LABELS` (`/rsc`, type names per language).
@@ -292,6 +301,7 @@ Opt-in with `iapl({ cookieScanner: true })`; the plugin wires the collection, en
| `MARKDOWN_PREFIX` | `@intecion/ipal-kit` | constant `'/md'` — default prefix of Markdown routes | | `MARKDOWN_PREFIX` | `@intecion/ipal-kit` | constant `'/md'` — default prefix of Markdown routes |
| `markdownHref(pathname, prefix?)` | `@intecion/ipal-kit` | page path → Markdown version address (`/pl/o-nas` → `/md/pl/o-nas`), e.g. for `alternates.types` | | `markdownHref(pathname, prefix?)` | `@intecion/ipal-kit` | page path → Markdown version address (`/pl/o-nas` → `/md/pl/o-nas`), e.g. for `alternates.types` |
| `prefersMarkdown(request \| headers \| accept)` | `@intecion/ipal-kit` | whether the `Accept` header prefers `text/markdown` (q-values); for your own proxy — `createProxy({ markdown: true })` does it itself | | `prefersMarkdown(request \| headers \| accept)` | `@intecion/ipal-kit` | whether the `Accept` header prefers `text/markdown` (q-values); for your own proxy — `createProxy({ markdown: true })` does it itself |
| `MARKDOWN_NEGOTIATED_HEADER`, `NEGOTIATED_CACHE_CONTROL`, `appendVary(headers, token)` | `@intecion/ipal-kit` | 1.18.0 (audit F3): the request marker the proxy sets on a negotiated rewrite (the route then answers `private, no-store` + `Vary: Accept`), that cache-control, and `Vary` with a token added once — for your own proxy (content.md "content negotiation"). `markdownResponse(md, { negotiated: true })` gives the same headers. `createProxy({ markdown: { prefix?, negotiate? } })`: `negotiate: false` = no rewrite. |
| `searchContent({ payload, query, config, locale?, limit?, baseUrl?, collection?, summaryField? })` | `@intecion/ipal-kit` | searches published, indexable pages by title/description → `SearchResult[]`; does not throw | | `searchContent({ payload, query, config, locale?, limit?, baseUrl?, collection?, summaryField? })` | `@intecion/ipal-kit` | searches published, indexable pages by title/description → `SearchResult[]`; does not throw |
| `listContent({ payload, config, locale?, limit? })` | `@intecion/ipal-kit` | list of published, indexable pages (no query) — used by MCP `list_pages` | | `listContent({ payload, config, locale?, limit? })` | `@intecion/ipal-kit` | list of published, indexable pages (no query) — used by MCP `list_pages` |
| `createSearchRoute({ getCachedPayload, config, baseUrl, defaultLimit?, rateLimit?, clientIp?, isPathVisible? })` | `@intecion/ipal-kit` | `GET` handler for the JSON search endpoint (`?q=&locale=&limit=`), with a per-IP rate limit; pass `isPathVisible` from `@/lib/content` so construction mode hides pages here too | | `createSearchRoute({ getCachedPayload, config, baseUrl, defaultLimit?, rateLimit?, clientIp?, isPathVisible? })` | `@intecion/ipal-kit` | `GET` handler for the JSON search endpoint (`?q=&locale=&limit=`), with a per-IP rate limit; pass `isPathVisible` from `@/lib/content` so construction mode hides pages here too |
@@ -329,7 +339,7 @@ Opt-in with `iapl({ cookieScanner: true })`; the plugin wires the collection, en
|---|---|---| |---|---|---|
| `createContentHelpers({ config, content?, i18n?, baseUrl?, … })` | `@intecion/ipal-kit` | factory for `src/lib/content.ts`: cached `getCachedPayload`, `getSettings`, `resolveRoute`, `getEntries`, `generatePageMetadata`, `getSiteShell`, `sitemap`, `robots`, `getRobots`, `isPathVisible`, `markdownRoute`, `healthRoute`, `mcpGET`/`mcpPOST`… — do not write these wrappers yourself | | `createContentHelpers({ config, content?, i18n?, baseUrl?, … })` | `@intecion/ipal-kit` | factory for `src/lib/content.ts`: cached `getCachedPayload`, `getSettings`, `resolveRoute`, `getEntries`, `generatePageMetadata`, `getSiteShell`, `sitemap`, `robots`, `getRobots`, `isPathVisible`, `markdownRoute`, `healthRoute`, `mcpGET`/`mcpPOST`… — do not write these wrappers yourself |
| `createPageRoute(content, { blocks, notFound, permanentRedirect, redirect?, … })` | `@intecion/ipal-kit/rsc` | ready `[[...slug]]` catch-all page → `{ Page, generateMetadata, generateStaticParams }` (blocks, slug history redirects, JSON-LD, under-construction mode); does not paginate `?page=` | | `createPageRoute(content, { blocks, notFound, permanentRedirect, redirect?, … })` | `@intecion/ipal-kit/rsc` | ready `[[...slug]]` catch-all page → `{ Page, generateMetadata, generateStaticParams }` (blocks, slug history redirects, JSON-LD, under-construction mode); does not paginate `?page=` |
| `createNotFoundPage(content, { load } \| { blocks, fallback?, … })` | `@intecion/ipal-kit/rsc` | default export of `not-found.tsx` — the 404 page chosen in the panel or a fallback (the lazy `load` variant is recommended) | | `createNotFoundPage(content, { load, placeholder? } \| { blocks, fallback?, … })` | `@intecion/ipal-kit/rsc` | default export of `not-found.tsx` — the 404 page chosen in the panel or a fallback (the lazy `load` variant is recommended; `placeholder` (1.18.0) reserves the 404 content's height until it arrives — no layout shift, performance.md) |
| `renderNotFoundView(content, { blocks, fallback?, blockProps?, layoutField? }, locale)` | `@intecion/ipal-kit/rsc` | 404 content in one language — called from a server action for the lazy `createNotFoundPage({ load })` (pages.md) | | `renderNotFoundView(content, { blocks, fallback?, blockProps?, layoutField? }, locale)` | `@intecion/ipal-kit/rsc` | 404 content in one language — called from a server action for the lazy `createNotFoundPage({ load })` (pages.md) |
| `SiteProviders` | `@intecion/ipal-kit/rsc` | layout component: `shell={await getSiteShell(locale)}` mounts consent, cookie banner, analytics, Turnstile, site JSON-LD, theme script (and `lightbox` → `LightboxProvider`); `nonce` (from `x-nonce`) goes on the theme script and the GA4/GTM tag; does not mount `AlternateLinksProvider` | | `SiteProviders` | `@intecion/ipal-kit/rsc` | layout component: `shell={await getSiteShell(locale)}` mounts consent, cookie banner, analytics, Turnstile, site JSON-LD, theme script (and `lightbox` → `LightboxProvider`); `nonce` (from `x-nonce`) goes on the theme script and the GA4/GTM tag; does not mount `AlternateLinksProvider` |
@@ -392,6 +402,7 @@ Full option lists of `createContentHelpers` / `createPageRoute` / `SiteProviders
| `recordIntegrationStatus(payload, field, previous, { state, code?, message? })` | `@intecion/ipal-kit` | saves the state of your own integration in Site integrations (only on change / every 10 min); does not throw. For e-mail and Turnstile the plugin calls it itself — do not call | | `recordIntegrationStatus(payload, field, previous, { state, code?, message? })` | `@intecion/ipal-kit` | saves the state of your own integration in Site integrations (only on change / every 10 min); does not throw. For e-mail and Turnstile the plugin calls it itself — do not call |
| `buildIntegrationStatusField(name)` | `@intecion/ipal-kit` | hidden status group field (`state`, `code`, `message`, `since`, `checkedAt`) for `integrationsFields` | | `buildIntegrationStatusField(name)` | `@intecion/ipal-kit` | hidden status group field (`state`, `code`, `message`, `since`, `checkedAt`) for `integrationsFields` |
| `buildIntegrationStatusBanner(statusField, label, texts?)` | `@intecion/ipal-kit` | UI field with a status banner on the integration tab (`label` string or `{ en, pl }`; `texts` = `{ failing, hint }` keys of your own `ipal` translations) (`integrationsFields`; then `pnpm generate:importmap`) | | `buildIntegrationStatusBanner(statusField, label, texts?)` | `@intecion/ipal-kit` | UI field with a status banner on the integration tab (`label` string or `{ en, pl }`; `texts` = `{ failing, hint }` keys of your own `ipal` translations) (`integrationsFields`; then `pnpm generate:importmap`) |
| `UnusedMediaNotice`, `UNUSED_MEDIA_LINK_LIMIT` | `@intecion/ipal-kit/admin` | `iapl({ unusedMedia })` (1.18.0, opt-in): above an upload collection's list, how many files nothing uses (`findUnusedMedia` from `/doctor`) and a link to Payload's list filtered to them (first 100); editors and admins; deletes nothing; a hint only when the site is too big to check here |
| `IntegrationAlerts` | `@intecion/ipal-kit/admin` | dashboard alert about integrations in the `degraded` state; always injected by the plugin (`beforeDashboard`); your own integrations: a second instance with `checks`. By role: the detail (error text, link) for `details` and above (`'admin'` default, `'editor'`, `'all'`), a neutral "ask an administrator" for editors below it, nothing for others or for a session that owes its second factor (`dashboardAlerts.integrations`). `CookieCrawlAlert` takes `audience: 'editor' \| 'all'` the same way | | `IntegrationAlerts` | `@intecion/ipal-kit/admin` | dashboard alert about integrations in the `degraded` state; always injected by the plugin (`beforeDashboard`); your own integrations: a second instance with `checks`. By role: the detail (error text, link) for `details` and above (`'admin'` default, `'editor'`, `'all'`), a neutral "ask an administrator" for editors below it, nothing for others or for a session that owes its second factor (`dashboardAlerts.integrations`). `CookieCrawlAlert` takes `audience: 'editor' \| 'all'` the same way |
| `IntegrationStatusBanner` | `@intecion/ipal-kit/admin` | status banner on the tab; injected by the plugin / `buildIntegrationStatusBanner` through the import map (`pnpm generate:importmap`), the project does not import it | | `IntegrationStatusBanner` | `@intecion/ipal-kit/admin` | status banner on the tab; injected by the plugin / `buildIntegrationStatusBanner` through the import map (`pnpm generate:importmap`), the project does not import it |
@@ -422,10 +433,11 @@ The editor builds forms in the panel (Forms collection). The project does NOT wr
| Export | Import from | What it does / when | | Export | Import from | What it does / when |
|---|---|---| |---|---|---|
| `RenderForm({ form, action, locale, texts, classNames?, values?, … })` | `@intecion/ipal-kit/rsc` | A panel form in a block in one line (RSC): renders message blocks and the confirmation, binds `sendForm` to the form and language, resolves the redirect, sends only `publicForm` to the browser; `form` not populated → nothing | | `RenderForm({ form, action, locale, texts, classNames?, values?, Form?, turnstileReserveHeight?, … })` | `@intecion/ipal-kit/rsc` | A panel form in a block in one line (RSC): renders message blocks and the confirmation, binds `sendForm` to the form and language, resolves the redirect, sends only `publicForm` to the browser; `form` not populated → nothing. Renders the lazy `BuilderForm` (its code only on pages with a form, the HTML complete); `Form` swaps the component (the eager one from `/client/eager`); `turnstileReserveHeight` (default 73, 0 for an invisible widget) |
| `prepareBuilderForm({ form, action, locale, … })` | `@intecion/ipal-kit/rsc` | The server half of `RenderForm` without markup → `PreparedBuilderForm` (or `null`) to spread into `<BuilderForm>` in a client component (e.g. a configurator with changing `values`) | | `prepareBuilderForm({ form, action, locale, … })` | `@intecion/ipal-kit/rsc` | The server half of `RenderForm` without markup → `PreparedBuilderForm` (or `null`) to spread into `<BuilderForm>` in a client component (e.g. a configurator with changing `values`) |
| `publicForm(form)` | `@intecion/ipal-kit/rsc` | Public part of the form document (no Emails tab, no message rich text, safe redirect URL) — when you pass the form to the client yourself; never pass the raw document | | `publicForm(form)` | `@intecion/ipal-kit/rsc` | Public part of the form document (no Emails tab, no message rich text, safe redirect URL) — when you pass the form to the client yourself; never pass the raw document |
| `BuilderForm(props)` | `@intecion/ipal-kit/client` | Client renderer for any panel form (steps, all field types, Turnstile, honeypot, a11y), unstyled — look via `classNames`, field replacement via `renderField`; usually used indirectly through `RenderForm` | | `BuilderForm(props)` | `@intecion/ipal-kit/client` | Client renderer for any panel form (steps, all field types, Turnstile, honeypot, a11y), unstyled — look via `classNames`, field replacement via `renderField`; usually used indirectly through `RenderForm`. Since 1.18.0 the `/client` export is a lazy wrapper with the same props (the code loads where a form is shown; SSR complete); `turnstileReserveHeight` keeps the widget's space |
| `BuilderForm`, `Turnstile` | `@intecion/ipal-kit/client/eager` | The same components without lazy loading — in every page's bundle. Only when a project needs them eager: `<RenderForm Form={BuilderForm}>` |
| `useBuilderForm({ form, action, texts, values?, onSuccess?, navigate?, redirectHref? })` | `@intecion/ipal-kit/client` | Panel form engine without markup (steps, `next/back/goTo`, per-step validation, server errors, redirect, analytics, `getInputProps`/`getSelectProps`/…, `TurnstileWidget`) — for your own markup of an unusual form | | `useBuilderForm({ form, action, texts, values?, onSuccess?, navigate?, redirectHref? })` | `@intecion/ipal-kit/client` | Panel form engine without markup (steps, `next/back/goTo`, per-step validation, server errors, redirect, analytics, `getInputProps`/`getSelectProps`/…, `TurnstileWidget`) — for your own markup of an unusual form |
### Pure panel form logic (client and server) ### Pure panel form logic (client and server)
@@ -445,7 +457,7 @@ The editor builds forms in the panel (Forms collection). The project does NOT wr
| Export | Import from | What it does / when | | Export | Import from | What it does / when |
|---|---|---| |---|---|---|
| `createSubmitAction({ getCachedPayload, headers, … })` | `@intecion/ipal-kit/server` | Creates the server action `sendForm(formId, locale, values, token?)`: honeypot → `clientIp` → `submitForm` → text from Notifications; returns `SubmitActionResult`. Standard: `export const sendForm = createSubmitAction({ getCachedPayload, headers })` in `actions.ts` | | `createSubmitAction({ getCachedPayload, headers, … })` | `@intecion/ipal-kit/server` | Creates the server action `sendForm(formId, locale, values, token?)`: honeypot → `clientIp` → `submitForm` → text from Notifications; returns `SubmitActionResult`. Standard: `export const sendForm = createSubmitAction({ getCachedPayload, headers })` in `actions.ts` |
| `submitForm({ payload, formId, data, files?, attemptKey?, turnstileToken?, ip?, locale?, maxPerMinute?, consentFieldName?, turnstileHostnames? })` | `@intecion/ipal-kit/server` | Server core (`consentFieldName`: argument → `iapl({ forms: { consentFieldName } })` → `'consent'`; `turnstileHostnames` rejects a token solved on another domain): rate limit → Turnstile → validation against the panel definition (+ GDPR consent) → saves the submission; returns a `SubmitFormResult` code, not text. Usually through `createSubmitAction`; server-only | | `submitForm({ payload, formId, data, files?, attemptKey?, turnstileToken?, ip?, locale?, maxPerMinute?, consentFieldName?, turnstileHostnames? })` | `@intecion/ipal-kit/server` | Server core (`consentFieldName`: argument → `iapl({ forms: { consentFieldName } })` → `'consent'`; `turnstileHostnames` rejects a token solved on another domain): rate limit → Turnstile → validation against the panel definition (+ GDPR consent) → saves the submission (and, with `forms.submissionRetentionDays`, deletes older ones at most once a day); returns a `SubmitFormResult` code, not text. Usually through `createSubmitAction`; server-only |
### Honeypot ### Honeypot
@@ -492,6 +504,7 @@ The editor builds forms in the panel (Forms collection). The project does NOT wr
| `resolveSystemLinks(settings, { locale, config, roles?, … })` | `@intecion/ipal-kit` | Links to system pages from Site settings (privacy/cookies/terms) with the page title as the label → `SystemLink[]`; in a project usually `getSystemLinks` from `lib/content` | | `resolveSystemLinks(settings, { locale, config, roles?, … })` | `@intecion/ipal-kit` | Links to system pages from Site settings (privacy/cookies/terms) with the page title as the label → `SystemLink[]`; in a project usually `getSystemLinks` from `lib/content` |
| `homeSlugFrom(settings, field?)` | `@intecion/ipal-kit` | Homepage slug from `SiteSettings.homepage` (populated) or `undefined` | | `homeSlugFrom(settings, field?)` | `@intecion/ipal-kit` | Homepage slug from `SiteSettings.homepage` (populated) or `undefined` |
| `safeHref(url)` | `@intecion/ipal-kit` | The URL when safe (http(s), mailto, tel, sms, #, `/` path), otherwise `null` — blocks `javascript:`/`data:` | | `safeHref(url)` | `@intecion/ipal-kit` | The URL when safe (http(s), mailto, tel, sms, #, `/` path), otherwise `null` — blocks `javascript:`/`data:` |
| `buildUrlField({ name?, label?, required?, schemes?, description?, overrides? })`, `isAllowedUrl(value, schemes?)` | `@intecion/ipal-kit` | 1.18.0 (audit F2): a text field for an address rendered into `href` — `https://` / `http://` pass, plus the `schemes` you list (`mailto`, `tel`, `sms`, `hash`, `relative`); `javascript:`, `data:`, `//host` never. Render the value with `safeHref` too. Types `BuildUrlFieldOptions`, `UrlScheme`. |
**Types:** `BuildLinkFieldOptions`, `BuildLinksFieldOptions`, `LinkAppearance`, `LinkAppearanceOption` — link field options and styles; `LinkValue`, `ResolveLinkHrefOptions`, `ResolvedLink`, `NavItem`, `ResolveNavOptions`, `SystemLink` — panel link value, resolver options and results. **Types:** `BuildLinkFieldOptions`, `BuildLinksFieldOptions`, `LinkAppearance`, `LinkAppearanceOption` — link field options and styles; `LinkValue`, `ResolveLinkHrefOptions`, `ResolvedLink`, `NavItem`, `ResolveNavOptions`, `SystemLink` — panel link value, resolver options and results.
@@ -523,12 +536,13 @@ The editor builds forms in the panel (Forms collection). The project does NOT wr
| Export | Import from | What it does / when | | Export | Import from | What it does / when |
|---|---|---| |---|---|---|
| `mediaImageProps(resource, { sizes?, priority?, alt?, placeholderColor? })` | `@intecion/ipal-kit` | `next/image` props for an image upload (dimensions, focal point → `objectPosition`, blur placeholder, `preload` for LCP) or `null` (video/PDF/ID) — for your own `<Media>` | | `mediaImageProps(resource, { sizes?, priority?, eager?, alt?, placeholderColor? })` | `@intecion/ipal-kit` | `next/image` props for an image upload (dimensions, focal point → `objectPosition`, blur placeholder, `preload` for LCP) or `null` (video/PDF/ID) — for your own `<Media>`. `eager` (1.18.0): above the fold but not the LCP image (a logo) — eager without high priority or a preload |
| `videoProps(resource, { mode?, poster?, reducedMotion? })` | `@intecion/ipal-kit` | `<video>` attributes for a video upload (`'background'`: autoplay/muted/loop; `'player'`: controls, `preload="none"`) or `null` | | `videoProps(resource, { mode?, poster?, reducedMotion? })` | `@intecion/ipal-kit` | `<video>` attributes for a video upload (`'background'`: autoplay/muted/loop; `'player'`: controls, `preload="none"`) or `null` |
| `MEDIA_SIZES` | `@intecion/ipal-kit` | Ready constant `sizes` values: `full`, `half`, `third`, `quarter`, `thumb` | | `MEDIA_SIZES` | `@intecion/ipal-kit` | Ready constant `sizes` values: `full`, `half`, `third`, `quarter`, `thumb` |
| `normalizeFilename(filename)` | `@intecion/ipal-kit` | Slugifies a file name, keeping the extension (`"Zdjęcie 1.JPG"` → `"zdjecie-1.jpg"`) | | `normalizeFilename(filename)` | `@intecion/ipal-kit` | Slugifies a file name, keeping the extension (`"Zdjęcie 1.JPG"` → `"zdjecie-1.jpg"`) |
| `normalizeFilenameHook` | `@intecion/ipal-kit` | `beforeOperation` hook for an upload collection (Media) that normalizes the file name; the project adds it to its Media collection | | `normalizeFilenameHook` | `@intecion/ipal-kit` | `beforeOperation` hook for an upload collection (Media) that normalizes the file name; the project adds it to its Media collection |
| `buildOptimizeUploadHook(options?)` | `@intecion/ipal-kit` | `beforeOperation` hook: blocks oversized JPG/PNG/video, converts the image to WebP after the editor agrees (sharp from `buildConfig`); the project adds it to Media | | `buildOptimizeUploadHook(options?)` | `@intecion/ipal-kit` | `beforeOperation` hook: blocks oversized JPG/PNG/video, converts the image to WebP after the editor agrees (sharp from `buildConfig`); removes the metadata of JPEG/PNG uploads that pass without re-encoding (`stripMetadata`, default true; 1.18.0); the project adds it to Media |
| `stripImageMetadata(buffer, mimeType)`, `exifOrientation(app1)` | `@intecion/ipal-kit` | Lossless metadata removal: JPEG APP1/APP13/COM, PNG tEXt/zTXt/iTXt/eXIf/tIME → `{ buffer, changed, orientation }` (the EXIF rotation, to apply before); anything unreadable comes back unchanged. Type `StripResult` |
| `buildOptimizeUploadField(name?)` | `@intecion/ipal-kit` | "Optimize this upload" consent checkbox (default `optimizeOnUpload`) for Media, paired with `buildOptimizeUploadHook` | | `buildOptimizeUploadField(name?)` | `@intecion/ipal-kit` | "Optimize this upload" consent checkbox (default `optimizeOnUpload`) for Media, paired with `buildOptimizeUploadHook` |
| `buildMediaPlaceholderHook({ field?, size? })` | `@intecion/ipal-kit` | `beforeOperation` hook that computes a tiny blur preview (base64 WebP) and the dominant colour on upload; the project adds it to Media | | `buildMediaPlaceholderHook({ field?, size? })` | `@intecion/ipal-kit` | `beforeOperation` hook that computes a tiny blur preview (base64 WebP) and the dominant colour on upload; the project adds it to Media |
| `buildMediaPlaceholderField(name?)` | `@intecion/ipal-kit` | Hidden field group for the placeholder (read by `mediaImageProps`), paired with `buildMediaPlaceholderHook` | | `buildMediaPlaceholderField(name?)` | `@intecion/ipal-kit` | Hidden field group for the placeholder (read by `mediaImageProps`), paired with `buildMediaPlaceholderHook` |
@@ -619,10 +633,18 @@ Server only (`pnpm payload run`); never import it from client code, the Payload
| `SAFE_TOTP_VIEW` / `totpViewImportKey(component)` | `@intecion/ipal-kit` | `'@intecion/ipal-kit/admin#SafeTotpView'`, the wrapper's import-map path (the default `wrapper` of `wrapTotpViews`); and the import-map key (`path#export`) of a component given as a string or `{ path, exportName }`. | | `SAFE_TOTP_VIEW` / `totpViewImportKey(component)` | `@intecion/ipal-kit` | `'@intecion/ipal-kit/admin#SafeTotpView'`, the wrapper's import-map path (the default `wrapper` of `wrapTotpViews`); and the import-map key (`path#export`) of a component given as a string or `{ path, exportName }`. |
| `findImportMapFile(config, cwd?)` / `missingImportMapEntries(config, entries, cwd?)` | `@intecion/ipal-kit` | Where the project's `importMap.js` is on disk (`admin.importMap.importMapFile`, else `app/(payload)<admin route>/` or `src/app/…` under `admin.importMap.baseDir` / the working directory; `null` when not found), and which of `entries` its text does not contain (`{ file, missing }`). A hint from the file on disk, not the map in the build: warn on it, never block on it. Behind `twoFactor.importMapCheck`. | | `findImportMapFile(config, cwd?)` / `missingImportMapEntries(config, entries, cwd?)` | `@intecion/ipal-kit` | Where the project's `importMap.js` is on disk (`admin.importMap.importMapFile`, else `app/(payload)<admin route>/` or `src/app/…` under `admin.importMap.baseDir` / the working directory; `null` when not found), and which of `entries` its text does not contain (`{ file, missing }`). A hint from the file on disk, not the map in the build: warn on it, never block on it. Behind `twoFactor.importMapCheck`. |
| `buildSetupFields({ statusField? })`, `stampSetupFrom`, `backfillSetupFrom(payload, collection)` | `@intecion/ipal-kit` | The parts of "2FA setup required" for a project that wires them itself: the fields for the 2FA collection (`totpSetupFrom`, and the panel's `totpSetupStatus` unless `statusField: false`), the `beforeChange` hook that stamps the window start (on create, and when an account loses its TOTP secret), and the start-up step that gives accounts without TOTP and without a start their window (returns how many; once per account). | | `buildSetupFields({ statusField? })`, `stampSetupFrom`, `backfillSetupFrom(payload, collection)` | `@intecion/ipal-kit` | The parts of "2FA setup required" for a project that wires them itself: the fields for the 2FA collection (`totpSetupFrom`, and the panel's `totpSetupStatus` unless `statusField: false`), the `beforeChange` hook that stamps the window start (on create, and when an account loses its TOTP secret), and the start-up step that gives accounts without TOTP and without a start their window (returns how many; once per account). |
| `buildTwoFactorResetEndpoint(collection, { access? })`, `TWO_FACTOR_RESET_PATH` | `@intecion/ipal-kit` | `POST /api/ipal/two-factor/reset` `{ userId }`: clears the account's TOTP secret and sessions and starts a new window. Default: a staff admin whose session entered its own TOTP code; `access` replaces that (only `true` allows; a session that owes its code is always refused). `iapl` registers it only with `twoFactor.guard` on. | | `resolveConfirmByEmail(option)`, `startEnrolment(req, { collection, options, totp? })`, `buildEnrolmentEndpoints({ collection, options, ownOrigin?, resetAccess? })`, `ENROL_CONFIRM_PATH`, `ENROL_ADMIN_CONFIRM_PATH` | `@intecion/ipal-kit` | `twoFactor.confirmByEmail` (1.18.0, on by default; security.md "Set-up confirmed by e-mail"): the option read strictly (null = off); the `/setup-totp` answer for an account without a factor (checks the code, keeps the secret pending, mails the link, sets the browser cookie, `202 { ok: false, pending: true, mailed, message }`); the link's page `GET /api/iapl/two-factor/confirm`, its button `POST` (single use, 30 min, same browser, own origin; writes the factor, ends the sessions, signs nobody in) and the admin's `POST /api/iapl/two-factor/confirm-pending { userId }`. Types `ConfirmByEmailOptions`, `ResolvedConfirmByEmail`, `EnrolmentContext`, `EnrolmentEndpointsOptions`. |
| `readPendingEnrolment(payload, collection, id)`, `pendingEnrolmentInfo(…)`, `dropPendingEnrolment(…)`, `countPendingEnrolments(payload, collection)`, `pendingEnrolmentKey(collection, id)` | `@intecion/ipal-kit` | The waiting set-up in payload-kv (`iapl:2fa-enrol:<collection>:<id>`; memory when there is no kv): read (null when expired), `{ createdAt, expiresAt }` for screens, end it, count them (the doctor). Type `PendingEnrolment` (`{ secret, token, browser, createdAt, expiresAt }`, token and browser as sha256). |
| `buildTotpNoticeHooks(collection, { notices })`, `sendTwoFactorNotice(payload, account, 'on' \| 'off' \| 'changed', by?)`, `verifyTotpCode(secret, token, { algorithm?, digits?, period? })`, `mailConfigured(payload)` | `@intecion/ipal-kit` | beforeChange + afterChange for the 2FA collection: a notice mail on every enrolment, change, removal / reset (any path; a removal ends a waiting set-up); the notice itself; RFC 6238 check with one period either side (as the 2FA package); whether Payload has a real mail transport (its `console` fallback = false). |
| `buildTwoFactorResetEndpoint(collection, { access?, ownOrigin? })`, `TWO_FACTOR_RESET_PATH` | `@intecion/ipal-kit` | `POST /api/ipal/two-factor/reset` `{ userId }`: clears the account's TOTP secret and sessions and starts a new window. `ownOrigin(req)` false → `403` before anything changes (the plugin passes the `twoFactor.sameOrigin` rule; wire `requestFromOwnOrigin` when you build it yourself). Default: a staff admin whose session entered its own TOTP code; `access` replaces that (only `true` allows; a session that owes its code is always refused). `iapl` registers it only with `twoFactor.guard` on. |
| `countAccountsWithoutTotp(payload, collection, setupWindowMs?)` | `@intecion/ipal-kit` | `{ without, blocked }` — accounts of the 2FA collection without TOTP, and how many are past their window. | | `countAccountsWithoutTotp(payload, collection, setupWindowMs?)` | `@intecion/ipal-kit` | `{ without, blocked }` — accounts of the 2FA collection without TOTP, and how many are past their window. |
| `resolveRequireSetup(option)`, `strictExempt(fn)`, `SETUP_FROM_FIELD`, `DEFAULT_SETUP_WINDOW_HOURS` | `@intecion/ipal-kit` | `twoFactor.requireSetup` → `{ requireSetup, setupWindowMs, exempt? }` as the guard reads it (throws on a `windowHours` that is not a number ≥ 0 or `false`, and on an `async` `exempt`); the wrapper that makes an `exempt` function answer `true` only for exactly `true`; the field name `'totpSetupFrom'`; `72`. | | `resolveRequireSetup(option)`, `strictExempt(fn)`, `SETUP_FROM_FIELD`, `DEFAULT_SETUP_WINDOW_HOURS` | `@intecion/ipal-kit` | `twoFactor.requireSetup` → `{ requireSetup, setupWindowMs, exempt? }` as the guard reads it (throws on a `windowHours` that is not a number ≥ 0 or `false`, and on an `async` `exempt`); the wrapper that makes an `exempt` function answer `true` only for exactly `true`; the field name `'totpSetupFrom'`; `72`. |
| `fetchPublicImage(url, base)`, `publicImageDataUri(url, base)`, `rasterImageType(bytes)`, `siteOrigin(serverURL)`, `PUBLIC_IMAGE_MAX_BYTES` | `@intecion/ipal-kit` | An image fetched the way an anonymous visitor gets it (no cookies; http(s) only; `image/*`; at most 512 KB, reading stops at the limit) as `{ bytes, type }` or a `data:` address, else `null`. Used for the logo and icon on the 2FA screens. `rasterImageType(bytes)` → the media type of a bitmap by its first bytes (PNG, JPEG, GIF, WebP, ICO, AVIF) or `null` — never trust a claimed type before answering a file's bytes from the site's origin; an SVG gives `null`. | | `fetchPublicImage(url, base, { timeoutMs? }?)`, `publicImageDataUri(url, base)`, `rasterImageType(bytes)`, `siteOrigin(serverURL)`, `PUBLIC_IMAGE_MAX_BYTES`, `PUBLIC_IMAGE_TIMEOUT_MS` | `@intecion/ipal-kit` | An image fetched the way an anonymous visitor gets it, as `{ bytes, type }` or a `data:` address, else `null`: no cookies; http(s) only; `image/*`; ONE address — a redirect is never followed (a 3xx is "no image"); the whole exchange within `PUBLIC_IMAGE_TIMEOUT_MS` (5000); at most `PUBLIC_IMAGE_MAX_BYTES` (512 KB), reading stops at the limit whatever `content-length` says. `base` is the site's configured origin (`siteOrigin(config.serverURL)` = `serverURL`, else `NEXT_PUBLIC_SERVER_URL`) — never build it from a request's `Host` / `X-Forwarded-Host`. Used for the logo and icon on the 2FA screens and by `/api/ipal/admin-og` and `/api/ipal/admin-icon`. `rasterImageType`: the bitmap type by the first bytes (PNG, JPEG, GIF, WebP, ICO, AVIF), `null` for anything else, SVG included. |
| `resolveSignInLook(whiteLabel)` | `@intecion/ipal-kit` | `whiteLabel` option → `null` (white-label or `signIn` off) or `{ allScreens, props }` (`ResolvedSignInLook`; `props` = `SignInLookProps`, the plain values the components get: `accent`, `checkLogo`, `imageField`, `inlineImages`, `languages`, `logoPlate`, `nameField`, `settingsSlug`, `svgLogo`). Option type: `SignInLookOptions`. |
| `loadSignInBrand({ payload, look, locale?, user? })`, `signInName(value, locale?)`, `signInLogo(media, { svgLogo? })`, `checkLogoFile(url, base, allowSvg?)`, `fitLogo(width, height, box?)`, `isSvgUpload(media)` | `@intecion/ipal-kit` | What the sign-in panel shows: `{ name, logo }` (`SignInBrand`, `SignInLogo = { src, width?, height? }`) read from Site settings, never throwing; the name as one line of plain text (control characters out, cut at `SIGN_IN_NAME_MAX` = 80); the logo of an upload document — any picture (an SVG too unless `svgLogo: false`; `null` only for an upload whose type says it is no picture, or an address that is not `http(s)` or site-relative), fitted into `SIGN_IN_LOGO_BOX` (240 × 72) without enlarging, served from the smallest generated size ≥ 2× the shown width with the same proportions; the look at the file itself (`LogoCheck`: `{ bytes, type }`; `'bad'` = certainly no picture there: 404 / 410, a 2xx answer of another type, an SVG while refused; `'unknown'` = nothing answered, a redirect (never followed), another status, no type, over 512 KB — the upload is believed). A session that owes its 2FA code gets the checked picture inlined or no logo. |
| `signInCss({ accent? })`, `isHexColour(value)`, `SIGN_IN_STYLE_ID` | `@intecion/ipal-kit` | The stylesheet of the sign-in look as a string (no `url()`, no font, no other host; every rule needs `.iapl-signin` on the page), the hex check `accent` must pass, and the `href` of its `<style>` (`'iapl-sign-in'`). |
| `languageLinks(config, current)`, `LANGUAGE_NAMES`, `buildAdminLanguageEndpoint()`, `adminPathFromReferer(referer, adminRoute)`, `ADMIN_LANGUAGE_PATH` | `@intecion/ipal-kit` | The panel's languages as links (`LanguageLink[]`: `{ code, name, current, href }`; empty with one language; names in their own language, else the code); the public endpoint `GET /api/ipal/admin-language?lng=` (`'/ipal/admin-language'`) that writes `<cookiePrefix>-lng` for a supported language (else 400) and answers 303 to a path inside the admin route taken from the `Referer` (anything else → the admin root, never another host). |
| `signInProviderActive(payload)`, `SIGN_IN_LOOK` | `@intecion/ipal-kit` | Whether the provider `'@intecion/ipal-kit/admin#SignInLook'` is in the config AND in the running import map — `AdminLogo` and `SafeTotpView` print the panel themselves only when it is not. |
| `UPLOAD_SECURITY_HEADERS` | `@intecion/ipal-kit` | The two headers of `buildUploadSecurityHeaders` (`Content-Security-Policy: default-src 'none'; … sandbox`, `X-Content-Type-Options: nosniff`) for a route of your own that returns an uploaded file's bytes from the site's origin. In a Next project a site-wide `headers()` rule with the same key overrides a header the route sets itself: add a `headers()` rule for the path after the site-wide one (as `buildUploadSecurityHeaders({ collections, adminIcon })` does for the upload routes and `/api/ipal/admin-icon`), and never answer with an SVG. | | `UPLOAD_SECURITY_HEADERS` | `@intecion/ipal-kit` | The two headers of `buildUploadSecurityHeaders` (`Content-Security-Policy: default-src 'none'; … sandbox`, `X-Content-Type-Options: nosniff`) for a route of your own that returns an uploaded file's bytes from the site's origin. In a Next project a site-wide `headers()` rule with the same key overrides a header the route sets itself: add a `headers()` rule for the path after the site-wide one (as `buildUploadSecurityHeaders({ collections, adminIcon })` does for the upload routes and `/api/ipal/admin-icon`), and never answer with an SVG. |
| `twoFactorSetupState(req)`, `twoFactorSetupDeadline(req)` | `@intecion/ipal-kit` | Where an account stands with TOTP setup, from `{ payload, user }`: `'set-up'`, `'open'` (may set it up now), `'closed'` (the setup window has passed: blocked until an admin reopens it), `'exempt'` (`requireSetup.exempt`, or `requireSetup: false`), `'not-applicable'` (no user, another collection, 2FA off); and the moment setup closes (`Date`, or `null` without a window). Types: `TwoFactorSetupState`, `RequireSetupOptions`. | | `twoFactorSetupState(req)`, `twoFactorSetupDeadline(req)` | `@intecion/ipal-kit` | Where an account stands with TOTP setup, from `{ payload, user }`: `'set-up'`, `'open'` (may set it up now), `'closed'` (the setup window has passed: blocked until an admin reopens it), `'exempt'` (`requireSetup.exempt`, or `requireSetup: false`), `'not-applicable'` (no user, another collection, 2FA off); and the moment setup closes (`Date`, or `null` without a window). Types: `TwoFactorSetupState`, `RequireSetupOptions`. |
| `requireSecondFactor(access?)` | `@intecion/ipal-kit` | Wraps an `Access` function: refused while the second factor is owed, otherwise the function itself (Payload's default "logged in" when none). iapl applies it to every collection and global in the config, and to those added by plugins listed after it (in `onInit` and at the start of the first request, so also after a dev hot reload); use it for access functions that are not part of the config. Per-entity opt-out: `custom.ipal.secondFactor: false \| { read: false }` or the package's `custom.totp.disableAccessWrapper`. Wrapping twice is harmless. | | `requireSecondFactor(access?)` | `@intecion/ipal-kit` | Wraps an `Access` function: refused while the second factor is owed, otherwise the function itself (Payload's default "logged in" when none). iapl applies it to every collection and global in the config, and to those added by plugins listed after it (in `onInit` and at the start of the first request, so also after a dev hot reload); use it for access functions that are not part of the config. Per-entity opt-out: `custom.ipal.secondFactor: false \| { read: false }` or the package's `custom.totp.disableAccessWrapper`. Wrapping twice is harmless. |
@@ -630,7 +652,11 @@ Server only (`pnpm payload run`); never import it from client code, the Payload
| `buildCsp({ mode?, reportUri?, reportGroup?, r2Url?, analytics?, metaPixel?, linkedIn?, tiktok?, clarity?, turnstile?, youtube?, googleMaps?, nonce?, strictDynamic?, dev?, extra?, override? })` | `@intecion/ipal-kit` | Returns `{ key, value }` with a hardened CSP (`base-uri`, `object-src`, `frame-ancestors`, `form-action`) + sources for the enabled integrations. `mode: 'report-only'` → `…-Report-Only` (start here), `'enforce'` later. `extra` adds to any directive, `override` replaces / drops one (`null`). `dev` (default `NODE_ENV === 'development'`) adds `'unsafe-eval'`. `nonce` → `'nonce-…' 'strict-dynamic'`. | | `buildCsp({ mode?, reportUri?, reportGroup?, r2Url?, analytics?, metaPixel?, linkedIn?, tiktok?, clarity?, turnstile?, youtube?, googleMaps?, nonce?, strictDynamic?, dev?, extra?, override? })` | `@intecion/ipal-kit` | Returns `{ key, value }` with a hardened CSP (`base-uri`, `object-src`, `frame-ancestors`, `form-action`) + sources for the enabled integrations. `mode: 'report-only'` → `…-Report-Only` (start here), `'enforce'` later. `extra` adds to any directive, `override` replaces / drops one (`null`). `dev` (default `NODE_ENV === 'development'`) adds `'unsafe-eval'`. `nonce` → `'nonce-…' 'strict-dynamic'`. |
| `buildCspHeaders(args)` | `@intecion/ipal-kit` | `[csp, Reporting-Endpoints]` (the second only with `reportUri`). | | `buildCspHeaders(args)` | `@intecion/ipal-kit` | `[csp, Reporting-Endpoints]` (the second only with `reportUri`). |
| `buildAdminCsp(args)` / `buildAdminCspHeaders(args)` | `@intecion/ipal-kit` | Looser policy for Payload's admin: Monaco from `cdn.jsdelivr.net`, `blob:` workers, `https:` images, Live Preview `frame-src 'self'`, `frame-ancestors 'self'`. Rule `{ source: '/admin/:path*', headers: buildAdminCspHeaders({ mode, reportUri }) }` AFTER the site-wide rule. | | `buildAdminCsp(args)` / `buildAdminCspHeaders(args)` | `@intecion/ipal-kit` | Looser policy for Payload's admin: Monaco from `cdn.jsdelivr.net`, `blob:` workers, `https:` images, Live Preview `frame-src 'self'`, `frame-ancestors 'self'`. Rule `{ source: '/admin/:path*', headers: buildAdminCspHeaders({ mode, reportUri }) }` AFTER the site-wide rule. |
| `createCspReportRoute({ onReport?, maxBytes? })` | `@intecion/ipal-kit` | `POST` handler for `reportUri` (`src/app/api/csp-report/route.ts`): both report formats, body cap 16 KB, always `204`; default sink = one `[csp] …` `console.warn` line per violation (Coolify logs). | | `createCspReportRoute({ onReport?, maxBytes?, maxReports?, rateLimit? })` | `@intecion/ipal-kit` | `POST` handler for `reportUri` (`src/app/api/csp-report/route.ts`): both report formats, body cap 16 KB, always `204`; default sink = one `[csp] …` `console.warn` line per violation (Coolify logs) made by `cspLogLine` — origin / path only, no control characters, values ≤ `CSP_LOG_VALUE_MAX` (128) (1.18.0, audit F1); at most `maxReports` (10) per request, `rateLimit` 60 / min per client (`false` = none); your `onReport` gets the raw values. |
| `accessAllowed(option, answer, { strict?, warn? })`, `strictAccessAnswers(req)` | `@intecion/ipal-kit` | how the plugin reads a project's access callback (`cookieScanner.access`, the doctor's `access`): since 1.18.0 only a literal `true` allows (`strict`, default; `iapl({ strictAccessAnswers: false })` = any truthy answer); a non-boolean answer is reported once per option with the fix `Boolean(req.user)`. `strictAccessAnswers(req)` = the reading of the request's config. Type `AccessAnswerOptions`. |
| `cspLogLine(violation)`, `CSP_LOG_VALUE_MAX` | `@intecion/ipal-kit` | the default CSP log line (safe to log) for your own sink, and its value cap. |
| `buildQueryGuardHook({ listLimit?, refuseOperatorSort? })`, `applyQueryGuard(config, options)`, `capListLimit(args, max?)`, `isOperatorSort(sort)`, `isStaffRequest(req)`, `RefusedSortError`, `DEFAULT_LIST_LIMIT`, `isQueryGuardHook`, `QUERY_GUARD_MARK` | `@intecion/ipal-kit` | 1.18.0 (audit F4, F5; security.md "Lists and sorting"): the `beforeOperation` hook iapl adds to every collection — lists from a non-staff caller over REST / GraphQL capped at 100 (`pagination=false`, `limit=0` included), a `sort` naming a database operator → `400` (logged as `info`). Options `listLimit: false \| { max, staff, exclude }`, `refuseOperatorSort: false`. Put the hook on a collection a plugin adds after iapl. Type `ListLimitOptions`. |
| `applyLockedDocumentsAccess(config, access?)`, `staffOnlyLocks`, `LOCKED_DOCUMENTS_SLUG` | `@intecion/ipal-kit` | 1.18.0: Payload's document locks (`payload-locked-documents`) for staff accounts only (with the second factor); iapl sets it at start (`lockedDocuments: false` = Payload's default, `{ access }` = your rule per operation). Type `LockedDocumentsAccess`. |
| `parseCspReports(body)` | `@intecion/ipal-kit` | Normalises a report body (`csp-report` object or Reporting API array) to `CspViolation[]` — for your own collector. | | `parseCspReports(body)` | `@intecion/ipal-kit` | Normalises a report body (`csp-report` object or Reporting API array) to `CspViolation[]` — for your own collector. |
| `buildReportingEndpoints(url, group?)`, `cspHeaderKey(mode?)`, `DEFAULT_CSP_REPORT_GROUP` | `@intecion/ipal-kit` | Building blocks: the `Reporting-Endpoints` header, the header name for a mode, the default `report-to` group (`'csp-endpoint'`). | | `buildReportingEndpoints(url, group?)`, `cspHeaderKey(mode?)`, `DEFAULT_CSP_REPORT_GROUP` | `@intecion/ipal-kit` | Building blocks: the `Reporting-Endpoints` header, the header name for a mode, the default `report-to` group (`'csp-endpoint'`). |
| `createCspNonce()`, `CSP_NONCE_HEADER` | `@intecion/ipal-kit/next/middleware`, `@intecion/ipal-kit` | A per-request nonce and the request header (`x-nonce`) `createProxy({ csp })` passes it in — for your own proxy. Nonces make pages dynamic (no ISR). | | `createCspNonce()`, `CSP_NONCE_HEADER` | `@intecion/ipal-kit/next/middleware`, `@intecion/ipal-kit` | A per-request nonce and the request header (`x-nonce`) `createProxy({ csp })` passes it in — for your own proxy. Nonces make pages dynamic (no ISR). |
@@ -737,6 +763,7 @@ Most routes and metadata are already ready in `createContentHelpers` (`generateP
| `setRateLimitStore(store \| null)` | `@intecion/ipal-kit` | Shared store (e.g. Redis) for all plugin limiters (forms, consents, MCP…); `null` = process memory. Call once at startup when several instances run. | | `setRateLimitStore(store \| null)` | `@intecion/ipal-kit` | Shared store (e.g. Redis) for all plugin limiters (forms, consents, MCP…); `null` = process memory. Call once at startup when several instances run. |
| `setUnknownIpFactor(n)` | `@intecion/ipal-kit` | Requests with no client IP share one `unknown-ip` bucket with `n` × the limit (every plugin limiter). Call once at startup; `0` = unlimited (only with a limiter in front, e.g. Cloudflare). | | `setUnknownIpFactor(n)` | `@intecion/ipal-kit` | Requests with no client IP share one `unknown-ip` bucket with `n` × the limit (every plugin limiter). Call once at startup; `0` = unlimited (only with a limiter in front, e.g. Cloudflare). |
| `UNKNOWN_IP_FACTOR` | `@intecion/ipal-kit` | `20` — the default factor of the no-IP bucket. | | `UNKNOWN_IP_FACTOR` | `@intecion/ipal-kit` | `20` — the default factor of the no-IP bucket. |
| `setIpv6Grouping({ prefix?, wide?, wideFactor? })`, `ipRateKey(ip)`, type `Ipv6Grouping` | `@intecion/ipal-kit` | 1.18.0: how every plugin limiter counts IPv6 — default one client per /64 (`prefix: 64`), no wide counter; `wide: 48` adds a counter per /48 at `wideFactor` (10) × the limit; `prefix: 128` = per address. Out-of-range values throw. `ipRateKey`: an IPv4 as it is, `::ffff:a.b.c.d` as the IPv4, an IPv6 as its network (`2001:db8:1:2:0:0:0:0/64`), anything else unchanged. |
**Types:** `ClientIpOptions` — `clientIp` options; `RateLimitStore` — store contract (`hit(id, cost, windowMs)` → `{ count, resetAt }`). **Types:** `ClientIpOptions` — `clientIp` options; `RateLimitStore` — store contract (`hit(id, cost, windowMs)` → `{ count, resetAt }`).
@@ -863,10 +890,25 @@ Bin: `iapl-doctor` (`pnpm exec iapl-doctor [dir] [--json] [--md] [--strict] [--f
| `findFrontend(ctx)` | `@intecion/ipal-kit/doctor` | The folder of the site's pages (`FrontendLayout`: `dir`, `multi`, `ambiguous`, `missingOverride`) — found by structure (any route group with the catch-all page, a localized one first); `layout.frontend` in `iapl-doctor.json` wins. | | `findFrontend(ctx)` | `@intecion/ipal-kit/doctor` | The folder of the site's pages (`FrontendLayout`: `dir`, `multi`, `ambiguous`, `missingOverride`) — found by structure (any route group with the catch-all page, a localized one first); `layout.frontend` in `iapl-doctor.json` wins. |
| `createLiveFetcher(url, { adminRoute, staging })` | `@intecion/ipal-kit/doctor` | Cached GET-only fetcher for the live rules. | | `createLiveFetcher(url, { adminRoute, staging })` | `@intecion/ipal-kit/doctor` | Cached GET-only fetcher for the live rules. |
| `runDeepProbe(ctx)` | `@intecion/ipal-kit/doctor` | `pnpm exec payload run …/dist/modules/doctor/probe.js` in the project → `DoctorStatus`. | | `runDeepProbe(ctx)` | `@intecion/ipal-kit/doctor` | `pnpm exec payload run …/dist/modules/doctor/probe.js` in the project → `DoctorStatus`. |
| `collectDoctorStatus(payload)` | `@intecion/ipal-kit/doctor` | Read-only counts: `usersWithout2fa`, `pendingCookies`, `plugin`, `node`. | | `collectDoctorStatus(payload)` | `@intecion/ipal-kit/doctor` | Read-only counts: `usersWithout2fa`, `pendingCookies`, `media` (images over `IMAGE_RULES`, 1.18.0), `plugin`, `node`. |
| `PERF_BUDGETS`, `SERVER_BUDGET`, `perfBudgets(overrides)`, `overBudget(measured, budget)`, `IMAGE_RULES` | `@intecion/ipal-kit/doctor` | Performance budgets (1.18.0, performance.md): the defaults per profile (`mobile`, `desktop`: `lcp`, `cls`, `inp`, `tbt`, `jsBytes`, `cssBytes`, `fontBytes`, `requests`, `renderBlocking`, `thirdParty`) and per render (`queriesPerRender`); a project's own on top; the broken budgets of one measurement as lines (empty = within budget); the image limits (1.5 MB, 2560 px, AVIF/WebP). Types `PerfBudget`, `PerfMeasurement`, `PerfProfile`, `ServerBudget`. The gate: `iapl-performance/resources/performance.spec.template.ts` + `perf-lab.mjs`. |
| `findUnusedMedia(payload, { limit?, only? })` → `UnusedMedia \| null` | `@intecion/ipal-kit/doctor` | Media of the upload collections no document or global mentions — by id or by file name in a text; `{ byCollection, checked, complete, total }`; reads only. The panel notice lists them only when `complete` |
| `syncTtlIndex(payload, slug, { days, enabled, from })`, `ttlField()`, `TTL_FIELD`, `TTL_INDEX`, `isMongo(config)` | `@intecion/ipal-kit` | The MongoDB TTL index the plugin keeps for the consent log and statistics (1.18.0): created / moved to the current retention (`collMod`) / dropped; records backfilled once from `from`. For a log collection of your own: add `ttlField()`, call it in `onInit`. Type `TtlSyncResult` |
| `withVersionLimit(entity, 'collection' \| 'global', limit?)`, `PLUGIN_VERSION_LIMIT` | `@intecion/ipal-kit` | A collection or global whose versions are on without a limit gets `maxPerDoc` / `max` (default 20); a limit already set wins. iapl() applies it to its own entities |
| `collectGrowth(payload)` → `GrowthStatus`, `growthRules`, `GROWTH_DEFAULTS`, `folderBytes(dir)` | `@intecion/ipal-kit/doctor` | What grows (1.18.0, performance.md §6): per collection documents, bytes (MongoDB) and the oldest record; versions per collection and global with their limit; `payload-kv` entries and expired ones; media no document points at (first 5000 documents) — counts only. The `growth` rules (`growth-size`, `-versions`, `-versions-config`, `-retention`, `-submissions`, `-kv`, `-media`, `-disk`) and their default thresholds (`iapl-doctor.json` → `growth`, type `GrowthThresholds`). |
| `performanceRules` | `@intecion/ipal-kit/doctor` | The doctor's `performance` group (`perf-images-config`, `perf-fonts`, `perf-render-blocking`, `perf-embeds`, `perf-animations`, `perf-budgets`, `perf-live`, `perf-images`) — part of `doctorRules`. |
| `buildDoctorEndpoint({ tokenVar, access })` | `@intecion/ipal-kit/doctor` | `GET /ipal/doctor` (`/api/ipal/doctor`): 404 until the token variable (default `IAPL_DOCTOR_TOKEN`, ≥ 32 chars) is set, Bearer token or `access`, rate-limited. Added by `iapl` unless `doctor: false`. | | `buildDoctorEndpoint({ tokenVar, access })` | `@intecion/ipal-kit/doctor` | `GET /ipal/doctor` (`/api/ipal/doctor`): 404 until the token variable (default `IAPL_DOCTOR_TOKEN`, ≥ 32 chars) is set, Bearer token or `access`, rate-limited. Added by `iapl` unless `doctor: false`. |
| `jobsRunAccess({ secretVar? })` | `@intecion/ipal-kit` | The rule iapl puts on `jobs.access.run` when the project writes none: `cronSecretMatches(req, process.env[secretVar])` or an admin with the second factor. Reuse it in your own rule: `run: (a) => jobsRunAccess()(a) \|\| myCheck(a)`. Type `JobsRunAccessOptions`. |
| `withJobsRunAccess(config, options \| false)` / `jobsRunNotice(config)` | `@intecion/ipal-kit` | The config with that rule (only when `jobs.access.run` is missing; marks `custom.iapl.jobsRunDefault`); the start-up line when the queue is on and the secret is missing (null otherwise). |
| `cronSecretMatches(req, secret)`, `CRON_SECRET_ENV`, `CRON_SECRET_MIN_LENGTH` | `@intecion/ipal-kit` | `Authorization: Bearer <secret>` compared in constant time; an unset or shorter-than-16 secret never matches. Default variable `CRON_SECRET`. |
| `runRouteCheck({ config, appDir?, snapshot?, update?, graphql?, cwd?, log? })` | `@intecion/ipal-kit/doctor` | `routes:check`: every public route (REST, GraphQL, Next route files) against the judged snapshot (default `e2e/routes.snapshot.json`); returns 1 on a route nobody judged or an entry without a reason; `update` writes new routes with an empty reason. Template: `iapl-audit/resources/routes.template.ts` (security.md "Routes nobody has judged"). Type `RunRouteCheckOptions`. |
| `ATTACK_PROBES`, `runAttackProbes(ctx, probes?)`, `createProbeContext(base, { page?, secrets?, timeoutMs?, userAgent? })` | `@intecion/ipal-kit/doctor` | The HTTP attack probes (secret files, bundle secrets, proxy bypass, open redirect, host-header and negotiation cache poisoning, NoSQL operators in sign-in and sort, anonymous where / draft / GraphQL reads, error leaks, unbounded lists, `/_next/image`, headers, methods, 8 MB bodies). Each `{ id, class, title, live, finding?, run(ctx) → { ok, detail, skipped? } }`; `runAttackProbes` runs the `live` ones by default. The doctor's `live-probes` rule; the Playwright template `iapl-audit/resources/attack-probes.spec.template.ts`; your own probe = an object of the same shape (security.md "Security suites"). Types `AttackProbe`, `ProbeContext`, `ProbeAnswer`, `ProbeResult`. |
| `scanCode(path, code)`, `listCodeFiles(root, start)`, `codeFindings(ctx)`, `scanConfigs(next, payload)`, `securityCodeRules`, `SECURITY_OK_MARKER`, `LIVE_PROBE_IDS` | `@intecion/ipal-kit/doctor` | The static security rules behind `code-patterns` and `config-dangerous`: every hit `{ rule, file, line, severity, message, text }` (types `CodeHit`, `CodePatternId`). A correct place is marked `// iapl-security-ok: <why>`. Use `scanCode` in a test of your own to keep a judged allow-list, as the plugin does (`test/security-patterns.allow.json`). |
| `listPublicRoutes(config, { graphqlSchema?, routeFiles? })` | `@intecion/ipal-kit` | Stable ids of every door a built config opens: `GET /api/users/me`, `graphql mutation loginUser`, `next GET /sitemap.xml`. From the config only (same on every database). Types `RouteInventoryOptions`, `GraphqlSchemaLike` (`getQueryType` / `getMutationType`). |
| `listNextRouteFiles(files, read)` | `@intecion/ipal-kit` | Next route handlers of an app directory (`route.ts` with the methods it exports, `robots.ts`, `sitemap.ts`, `manifest.ts`; route groups left out). |
| `compareRouteSnapshot(current, snapshot)` / `updateRouteSnapshot(current, snapshot)` | `@intecion/ipal-kit` | `{ unjudged, unexplained, gone }` against a `RouteSnapshot` (route id → reason); the snapshot after `--update` (new routes with `''`, gone ones dropped). Type `RouteSnapshotDiff`. |
**Types:** `DoctorRule`, `DoctorFinding`, `RuleFinding`, `DoctorReport`, `DoctorConfig`, `DoctorRuleSetting`, `DoctorSeverity`, **Types:** `AttackProbe`, `ProbeContext`, `ProbeAnswer`, `ProbeResult`, `CodeHit`, `CodePatternId`, `DoctorRule`, `DoctorFinding`, `RuleFinding`, `DoctorReport`, `DoctorConfig`, `DoctorRuleSetting`, `DoctorSeverity`,
`DoctorSource`, `DoctorStatus`, `DoctorContext`, `RunDoctorOptions`, `DoctorEndpointOptions`, `FrontendLayout`. `DoctorSource`, `DoctorStatus`, `DoctorContext`, `RunDoctorOptions`, `DoctorEndpointOptions`, `FrontendLayout`.
## Turnstile (`turnstile`) — details: `node_modules/@intecion/ipal-kit/docs/turnstile.md` ## Turnstile (`turnstile`) — details: `node_modules/@intecion/ipal-kit/docs/turnstile.md`
+34 -15
View File
@@ -94,14 +94,15 @@ legacy-peer-deps=true
pnpm add @intecion/ipal-kit @payloadcms/plugin-seo @payloadcms/plugin-form-builder \ pnpm add @intecion/ipal-kit @payloadcms/plugin-seo @payloadcms/plugin-form-builder \
@payloadcms/storage-s3 @clocklimited/payload-2fa@3.0.0-beta.7 tailwindcss @tailwindcss/postcss @payloadcms/storage-s3 @clocklimited/payload-2fa@3.0.0-beta.7 tailwindcss @tailwindcss/postcss
``` ```
**Next.js 16.4.5 or later** (minimum safe version: 16.0.0–16.4.0 have critical advisories, 16.3.0–16.4.4 have **Next.js 16.4.6 or later** (minimum safe version: 16.0.0–16.4.0 have critical advisories, 16.3.0–16.4.4 have
GHSA-mfr8-8qww-v76h — AGENT.md §4 item 11): `pnpm add [email protected] [email protected] sharp@^0.35.5` when GHSA-mfr8-8qww-v76h; 16.4.6 is the tested version — AGENT.md §4 item 11): `pnpm add [email protected] [email protected] sharp@^0.35.5` when
create-payload-app gave you an older one. create-payload-app gave you an older one.
**Payload 3.94.1** (what the reference site and the starter use; the plugin accepts `^3.90.2`): every `payload` / **Payload 3.94.1** (what the reference site and the starter use; the plugin accepts `^3.90.2`): every `payload` /
`@payloadcms/*` on the same exact version, `react` and `react-dom` 19.3.1 (Payload 3.94 requires `^19.3.1`), and `@payloadcms/*` on the same exact version, `react` and `react-dom` 19.3.1 (Payload 3.94 requires `^19.3.1`), and
**Node.js 22.23.5 or later** on the 22 line (`"engines": { "node": ">=22.23.5 <23" }`, `.nvmrc` `22`) — Payload 3.94's **Node.js 22.23.5 or later** on the 22 line (`"engines": { "node": ">=22.23.5 <23" }`, `.nvmrc` `22`) — Payload 3.94's
minimum, also in Coolify (Nixpacks picks the patch: check `node -v` in the app's Terminal after the first deploy). After the install, `pnpm audit --prod` → no high or critical; add the `dompurify` and `happy-dom` overrides minimum, also in Coolify (Nixpacks picks the patch: check `node -v` in the app's Terminal after the first deploy). After the install, `pnpm audit --prod` → no high or critical; add the `cross-spawn`, `dompurify`, `happy-dom` and `ws` overrides
from AGENT.md §4 item 12 (`"happy-dom@<21.0.4": "^21.0.4"` fixes two high advisories Lexical still brings in). On an from AGENT.md §4 item 12 (`"happy-dom@<21.0.4": "^21.0.4"` fixes two high advisories Lexical still brings in,
`"ws@>=8 <8.23.0": "^8.23.0"` one in Payload's `ws`; a Postgres site also the `esbuild` one listed there). On an
older Payload also the `mongoose` (MongoDB) and `undici` ones listed there. `pnpm exec iapl-doctor` → no older Payload also the `mongoose` (MongoDB) and `undici` ones listed there. `pnpm exec iapl-doctor` → no
`transitive-min` finding. `transitive-min` finding.
`nodemailer`, `lucide-react`, `slugify`, `server-only` come with the plugin — do not add them (your own `nodemailer`, `lucide-react`, `slugify`, `server-only` come with the plugin — do not add them (your own
@@ -111,7 +112,7 @@ plugin-seo, plugin-form-builder, storage-s3) in `pnpm.overrides` **to the exact
`"build": "cross-env NODE_OPTIONS=\"--max-old-space-size=3072\" next build --webpack"`. `"build": "cross-env NODE_OPTIONS=\"--max-old-space-size=3072\" next build --webpack"`.
**Check.** `ls node_modules/@intecion/ipal-kit/docs/agent/AGENT.md` exists; **Check.** `ls node_modules/@intecion/ipal-kit/docs/agent/AGENT.md` exists;
`pnpm ls payload @payloadcms/ui @payloadcms/plugin-seo` — one, identical version; `pnpm ls next sharp` → next ≥ 16.4.5, `pnpm ls payload @payloadcms/ui @payloadcms/plugin-seo` — one, identical version; `pnpm ls next sharp` → next ≥ 16.4.6,
sharp ≥ 0.35.5; `ls src/middleware.ts` → not found. sharp ≥ 0.35.5; `ls src/middleware.ts` → not found.
404 on `pnpm add` = missing `@intecion:registry` line; 401 = stale `_authToken` in `~/.npmrc` (PROGRAMISTA §1). 404 on `pnpm add` = missing `@intecion:registry` line; 401 = stale `_authToken` in `~/.npmrc` (PROGRAMISTA §1).
@@ -188,7 +189,7 @@ export default buildConfig({
seo: { collections: ['pages'] }, seo: { collections: ['pages'] },
forms: { redirectRelationships: ['pages'] }, forms: { redirectRelationships: ['pages'] },
twoFactor: { issuer: '<Client name>', plugin: payloadTotp }, twoFactor: { issuer: '<Client name>', plugin: payloadTotp },
whiteLabel: true, whiteLabel: { signIn: { allScreens: true } }, // client's logo / name on every sign-in screen (white-label.md)
indexNow: true, indexNow: true,
// consentLog is on by default (1.17.0): consent-records + POST /api/ipal/consent; `consentLog: false` turns it off. // consentLog is on by default (1.17.0): consent-records + POST /api/ipal/consent; `consentLog: false` turns it off.
// Postgres / SQLite: pnpm payload migrate:create consent-log, applied in the same deploy. // Postgres / SQLite: pnpm payload migrate:create consent-log, applied in the same deploy.
@@ -207,7 +208,7 @@ are never added to a new site. Local `.env` with `PAYLOAD_SECRET` ≥ 32 charact
One language: one entry in `locales`, no `[locale]` folder (i18n.md). One language: one entry in `locales`, no `[locale]` folder (i18n.md).
**Check.** `pnpm payload generate:importmap` (whiteLabel adds admin components) and `pnpm generate:types` without **Check.** `pnpm payload generate:importmap` (whiteLabel adds admin components) and `pnpm generate:types` without
errors (the import map lists `@intecion/ipal-kit/admin#TotpRedirectProvider` and `#SafeTotpView`); `pnpm dev`, `/admin`: first-user screen → after saving, TOTP setup is enforced (`/admin/setup-totp?back=%2Fadmin`, QR, no reloading); errors (the import map lists `@intecion/ipal-kit/admin#TotpRedirectProvider`, `#SafeTotpView` and `#SignInLook`); `pnpm dev`, `/admin`: first-user screen → after saving, TOTP setup is enforced (`/admin/setup-totp?back=%2Fadmin`, QR, no reloading; after the code the confirmation link is in the dev console — no mail set up yet — open it in the same browser, then sign in again);
the panel shows Site settings, Site integrations, Cookies, Form messages, the Forms group, Consent records. the panel shows Site settings, Site integrations, Cookies, Form messages, the Forms group, Consent records.
`curl -s -o /dev/null -w '%{http_code}' -X POST localhost:3000/api/ipal/consent -H 'content-type: application/json' `curl -s -o /dev/null -w '%{http_code}' -X POST localhost:3000/api/ipal/consent -H 'content-type: application/json'
-d '{"id":"0123456789abcdef","version":1,"state":{"necessary":true,"functional":false,"analytics":false,"marketing":false}}'` → `201`. -d '{"id":"0123456789abcdef","version":1,"state":{"necessary":true,"functional":false,"analytics":false,"marketing":false}}'` → `201`.
@@ -228,7 +229,7 @@ the panel shows Site settings, Site integrations, Cookies, Form messages, the Fo
`[iapl] twoFactor…` unless `allowCollectionMismatch: true`. The second factor covers every collection and global `[iapl] twoFactor…` unless `allowCollectionMismatch: true`. The second factor covers every collection and global
(the plugin's own, and those of plugins listed after `iapl`) and the plugin's endpoints; guard your own (the plugin's own, and those of plugins listed after `iapl`) and the plugin's endpoints; guard your own
endpoints with `secondFactorPassed(req)` or `userMeetsRole(req, role)` (security.md "What the second factor covers"). endpoints with `secondFactorPassed(req)` or `userMeetsRole(req, role)` (security.md "What the second factor covers").
Verify attempts: 5 per account in 10 minutes (`twoFactor.verifyLimit`). Verify attempts: 5 wrong codes per account in 10 minutes (`twoFactor.verifyLimit`); right codes do not count.
The `back` link of the setup and verify screens is checked on the server (`twoFactor.safeBack`, on by default: The `back` link of the setup and verify screens is checked on the server (`twoFactor.safeBack`, on by default:
only a path inside the admin route is kept; `false` turns it off, a function replaces the rule). It needs the only a path inside the admin route is kept; `false` turns it off, a function replaces the rule). It needs the
import map entry `@intecion/ipal-kit/admin#SafeTotpView` — run `pnpm payload generate:importmap` and commit import map entry `@intecion/ipal-kit/admin#SafeTotpView` — run `pnpm payload generate:importmap` and commit
@@ -240,13 +241,22 @@ the panel shows Site settings, Site integrations, Cookies, Form messages, the Fo
opens everything its role allows. One entity reachable without the code: `custom.ipal.secondFactor`. opens everything its role allows. One entity reachable without the code: `custom.ipal.secondFactor`.
**Setup required** (`twoFactor.requireSetup`, default): an account without TOTP reaches only the setup screen; it **Setup required** (`twoFactor.requireSetup`, default): an account without TOTP reaches only the setup screen; it
has 72 h from its creation (or an admin's "Reopen setup" on the account page), then it is blocked. So create an has 72 h from its creation (or an admin's "Reopen setup" on the account page), then it is blocked. So create an
account, hand over the password and have the owner set 2FA up at once. **Postgres/SQLite: `pnpm payload account, hand over the password and have the owner set 2FA up at once.
**Confirmed by e-mail** (`twoFactor.confirmByEmail`, default since 1.18.0): the code only starts the set-up; a link
to the account's own address, opened in the same browser within 30 min, turns it on (then sign in again). So set
up e-mail (Site integrations → E-mail sending, "Send a test e-mail") BEFORE people enrol, and keep `serverURL`
(`NEXT_PUBLIC_SERVER_URL`). The first administrator of a fresh site, with no mail yet: the link is in the dev
server's console / Coolify Logs (`[iapl] 2FA: … Link`); open it in the browser that scanned the code. Check: the
screen says "we sent a link to e…@…", the API still answers 403 until the link is opened. Off:
`confirmByEmail: false` (security.md "Set-up confirmed by e-mail"). **Postgres/SQLite: `pnpm payload
migrate:create` and have the migration applied when the container starts, before the site serves** — `prodMigrations` migrate:create` and have the migration applied when the container starts, before the site serves** — `prodMigrations`
or the start command `pnpm payload migrate && pnpm start`, never a pre-deployment command (deployment.md §4.3) or the start command `pnpm payload migrate && pnpm start`, never a pre-deployment command (deployment.md §4.3)
(column `totp_setup_from`, there whenever 2FA is (column `totp_setup_from`, there whenever 2FA is
on) — without it every login answers 500; `pnpm payload generate:importmap` (`TwoFactorStatusField`, on) — without it every login answers 500; `pnpm payload generate:importmap` (`TwoFactorStatusField`,
`TwoFactorAlert`). A service account that logs in with a password: `requireSetup: { exempt }` (a plain function `TwoFactorAlert`). A service account that logs in with a password: `requireSetup: { exempt }` (a plain function
returning exactly `true`; never `async`); an API key needs nothing. Parts to switch off: `requireSetup: returning exactly `true`; never `async`), deciding from a field only an admin can write (`serviceAccount`
checkbox with `adminOnlyField`; security.md "Decide `exempt` from a field only an administrator can write"),
never from the e-mail — every account may change its own e-mail; an API key needs nothing. Parts to switch off: `requireSetup:
{ dashboardNotice: false, statusField: false, setupNotice: false }`. An admin's reset ends the account's { dashboardNotice: false, statusField: false, setupNotice: false }`. An admin's reset ends the account's
sessions and needs the admin's own TOTP code (`twoFactor.resetAccess` changes who). Have two administrators sessions and needs the admin's own TOTP code (`twoFactor.resetAccess` changes who). Have two administrators
with 2FA: when all are blocked, only a script or a redeploy helps (security.md "Every administrator is with 2FA: when all are blocked, only a script or a redeploy helps (security.md "Every administrator is
@@ -294,6 +304,14 @@ the panel shows Site settings, Site integrations, Cookies, Form messages, the Fo
win; a function `(global) => global` takes over). Without `revalidatePath` global saves wait for the ISR window. win; a function `(global) => global` takes over). Without `revalidatePath` global saves wait for the ISR window.
- `whiteLabel: { credit: false, titleSuffix, settingsSlug, logoField, … }`; with `whiteLabel` the plugin overrides - `whiteLabel: { credit: false, titleSuffix, settingsSlug, logoField, … }`; with `whiteLabel` the plugin overrides
`graphics.Logo/Icon` — your own graphics only without it. `graphics.Logo/Icon` — your own graphics only without it.
- Sign-in screens (`whiteLabel.signIn`, on): a dark panel with the client's logo or the site's name beside the
form; the logo and name are Site settings fields (no env var, no migration). `allScreens: true` (in the config
above) adds the provider `SignInLook` to the import map and covers forgot / reset password, first user and
logout. The logo: any picture Site settings holds, an SVG too (`svgLogo: false` refuses SVG), drawn for a
DARK ground (no plate; `logoPlate: true` for a logo with dark letters). `accent: '#hex'`,
`languages: false`, `checkLogo: false`; `signIn: false` = Payload's screens. Name, logo and icon in Site
settings are admin-only with the look (`brandAccess: 'editor'` gives them back to editors).
Check: `/admin/login` and `/admin/forgot` show the panel, also at a phone width; do not write login CSS by hand.
- Panel link preview (`adminMeta`, on): noindex/nofollow, "— <site> | Panel" suffix, site name, description and - Panel link preview (`adminMeta`, on): noindex/nofollow, "— <site> | Panel" suffix, site name, description and
preview image (`/api/ipal/admin-og`) from Site settings; `agency` names who supports the technology (default preview image (`/api/ipal/admin-og`) from Site settings; `agency` names who supports the technology (default
Intecion.com). Turn off: `adminMeta: false`, `agency: false`; your own `admin.meta` keys win. Check: Intecion.com). Turn off: `adminMeta: false`, `agency: false`; your own `admin.meta` keys win. Check:
@@ -399,7 +417,7 @@ import { createProxy } from '@intecion/ipal-kit'
import { i18nConfig } from '@/i18n.config' import { i18nConfig } from '@/i18n.config'
export const proxy = createProxy(i18nConfig, { NextResponse, markdown: true }) export const proxy = createProxy(i18nConfig, { NextResponse, markdown: true })
// Inline LITERAL (importing DEFAULT_PROXY_MATCHER = 500 on /admin); with adminRoute '/its' write `its` instead of `admin` // Inline LITERAL (importing DEFAULT_PROXY_MATCHER = 500 on /admin); with adminRoute '/its' write `its` instead of `admin`
export const config = { matcher: ['/((?!api|admin|_next|.*\\..*).*)'] } export const config = { matcher: ['/((?!(?:api|admin|_next)(?:/|$)|.*\\..*).*)'] }
``` ```
`src/lib/content.ts` = PROGRAMISTA §2.7 1:1: `createContentHelpers({ config, content: contentConfig, i18n: i18nConfig, `src/lib/content.ts` = PROGRAMISTA §2.7 1:1: `createContentHelpers({ config, content: contentConfig, i18n: i18nConfig,
baseUrl: process.env.NEXT_PUBLIC_SERVER_URL, markdownAlternate: true, summaryField: 'aiSummary', mcp: { serverName: baseUrl: process.env.NEXT_PUBLIC_SERVER_URL, markdownAlternate: true, summaryField: 'aiSummary', mcp: { serverName:
@@ -470,7 +488,7 @@ and `rel="alternate" type="text/markdown"`; `/pl/nie-ma-takiej` → 404 with con
| `src/app/robots.ts` | `export { getRobots as default } from '@/lib/content'` + `force-dynamic` (AI crawler policy from Site settings → Search engines; `robots` = code only) | | `src/app/robots.ts` | `export { getRobots as default } from '@/lib/content'` + `force-dynamic` (AI crawler policy from Site settings → Search engines; `robots` = code only) |
| `src/app/manifest.ts` | `export { manifest as default } from '@/lib/content'` + `force-dynamic` | | `src/app/manifest.ts` | `export { manifest as default } from '@/lib/content'` + `force-dynamic` |
| `src/app/api/health/route.ts` | `export { healthRoute as GET } from '@/lib/content'` + `force-dynamic` | | `src/app/api/health/route.ts` | `export { healthRoute as GET } from '@/lib/content'` + `force-dynamic` |
| `src/app/api/csp-report/route.ts` | `import { createCspReportRoute } from '@intecion/ipal-kit'` + `export const POST = createCspReportRoute()` (CSP violation reports → `[csp]` lines in the logs) | | `src/app/api/csp-report/route.ts` | `import { createCspReportRoute } from '@intecion/ipal-kit'` + `export const POST = createCspReportRoute()` (CSP violation reports → `[csp]` lines in the logs: origins and paths only, 10 per request, 60 requests per client a minute; security.md "Collecting reports") |
```ts ```ts
// next.config.ts // next.config.ts
@@ -564,7 +582,8 @@ Already wired and required: `markdown: true` (stage 6 proxy), `markdownAlternate
**Check.** `curl -s localhost:3000/llms.txt` → site name and a list of pages with descriptions (`aiSummary`); **Check.** `curl -s localhost:3000/llms.txt` → site name and a list of pages with descriptions (`aiSummary`);
`/llms-full.txt` → page content; `curl -s localhost:3000/md/pl` → Markdown of the home page; `curl -s -H 'Accept: `/llms-full.txt` → page content; `curl -s localhost:3000/md/pl` → Markdown of the home page; `curl -s -H 'Accept:
text/markdown' localhost:3000/pl` → the same Markdown; `curl -s -X POST localhost:3000/api/mcp -H 'content-type: text/markdown' localhost:3000/pl` → the same Markdown, sent `cache-control: private, no-store` with `Vary: Accept`
(`curl -sD- -o/dev/null -H 'Accept: text/markdown' localhost:3000/pl`; 1.18.0, so no CDN stores it as the page); `curl -s -X POST localhost:3000/api/mcp -H 'content-type:
application/json' -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'` → `get_site_info`, `list_pages`, application/json' -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'` → `get_site_info`, `list_pages`,
`search_content`, `get_page`; `/indexnow-key.txt` → `404` until the key is generated in the panel, then the key. `search_content`, `get_page`; `/indexnow-key.txt` → `404` until the key is generated in the panel, then the key.
@@ -650,8 +669,8 @@ scaling (5). `●` routes for pages need the database at build time (PROGRAMISTA
in every language. in every language.
6. **Notifications**: form messages in every language. 6. **Notifications**: form messages in every language.
7. **Site integrations → E-mail sending**: "Sender name" (the client's name; empty = the site name) and **"Sender 7. **Site integrations → E-mail sending**: "Sender name" (the client's name; empty = the site name) and **"Sender
address"** (the client's address: with the mail service replies go there). SMTP fields **only** when the client asked address"** (the client's address: with the mail service replies go there). "Sending method" stays **IWSN (built-in)**; choose **Own SMTP server** and fill in its fields **only** when the client asked
for its own server. On the production domain: the block "How e-mails are sent" must say "Connected to IWSN" ("waiting for approval": while the service runs with enrolment "pending" (from its launch until Intecion switches to open enrolment), every new site waits for approval — ask Intecion to approve the host; under open enrolment it is the exception; the real domain enrols by itself at launch although the site was connected on its development address — nothing to press; "The data comes from another site" = the site is non-public (its host matches `developmentHosts`, built in `*.dev.netscale.pl`, or `IAPL_NOINDEX=1`) and holds a copy of another site's data: press "Connect again" only if the copy should send — on the production domain it means `IAPL_NOINDEX` was left set. A development address under `*.dev.netscale.pl` needs nothing; a staging or test copy on any other host must have its host in `iapl({ developmentHosts: […] })` (an array of host patterns: a single string, an empty entry or a lone `*` stops the start) or `IAPL_NOINDEX=1`, or it mails the real addresses in its data), then **Send test e-mail** → "through IWSN". Turnstile (for testing site for its own server — what is chosen is what is used, an incomplete SMTP server sends nothing. A new site sends through IWSN with nothing picked; picking another option and saving stores it (the panel warns before the save when its settings are incomplete). On the production domain: the block "How e-mails are sent" must say "Connected to IWSN" ("Waiting for confirmation": press "Połącz z IWSN" and have a person of Intecion confirm the site on the page that opens — the owner's step, @intecion.com sign-in; "waiting for approval" with no button: ask Intecion; the real domain enrols by itself at launch although the site was connected on its development address — nothing to press; "The data comes from another site" = the site is non-public (its host matches `developmentHosts`, built in `*.dev.netscale.pl`, or `IAPL_NOINDEX=1`) and holds a copy of another site's data: press "Connect again" only if the copy should send — on the production domain it means `IAPL_NOINDEX` was left set. A development address under `*.dev.netscale.pl` needs nothing; a staging or test copy on any other host must have its host in `iapl({ developmentHosts: […] })` (an array of host patterns: a single string, an empty entry or a lone `*` stops the start) or `IAPL_NOINDEX=1`, or it mails the real addresses in its data), then **Send test e-mail** → "through IWSN". Turnstile (for testing site
`1x00000000000000000000AA`, secret `1x0000000000000000000000000000000AA`; production keys from the client), analytics/pixel `1x00000000000000000000AA`, secret `1x0000000000000000000000000000000AA`; production keys from the client), analytics/pixel
IDs, IndexNow → generate key. Mail/Turnstile errors show up as a dashboard alert. IDs, IndexNow → generate key. Mail/Turnstile errors show up as a dashboard alert.
8. **Forms**: check the addresses in the Emails tab of the seeded forms. 8. **Forms**: check the addresses in the Emails tab of the seeded forms.
+167 -7
View File
@@ -25,6 +25,113 @@ the MANDATORY SET (GEO: llms-full, Markdown, MCP; R2; Turnstile through
`getTurnstileConfig`…). Wire each one according to PROGRAMISTA §2 — it is part of the update, `getTurnstileConfig`…). Wire each one according to PROGRAMISTA §2 — it is part of the update,
not an extra. Skip one only with a client decision in `AGENTS.md` (`iapl-audit-skip:`). not an extra. Skip one only with a client decision in `AGENTS.md` (`iapl-audit-skip:`).
**→ 1.18.0, sign-in (CHANGELOG 1.18.0 "Staff sign-in"; PROGRAMISTA §6, item 89; access.md "A stranger cannot lock a staff account out", "Staff sign-in only
from the site's own origin", "Changing one's own e-mail or password asks for the current password") — no schema change,
no migration, no import-map change; read before deploying:**
1. `IAPL_IP_HEADER` must be pinned in production (`x-forwarded-for` behind Coolify/Traefik): failed staff sign-ins are
counted per client IP and address. Without it every visitor shares one bucket (20× the limit).
2. A staff collection with its own `auth.maxLoginAttempts` / `lockTime` keeps them; otherwise Payload's lock is now 50
failures for an hour (beside 5 per IP and address in 15 minutes). Payload's behaviour back: `accounts: { signInLimit: false }`.
3. A panel or front end that signs **staff** in from another domain: `accounts: { signInSameOrigin: { origins: ['https://…'] } }`
(or `false`). A proxy that rewrites `Host`: set `serverURL`. Customer / visitor logins are not affected.
4. Scripts or integrations that change their OWN e-mail or password over the API send `currentPassword`; editors
see "Current password" on their account page. Off: `accounts: { confirmOwnChanges: false }`.
**Check:** five wrong passwords for an editor from one address → `429` there, `200` from another; the account page
shows "Current password"; `curl -X POST <site>/api/users/login -H 'Origin: https://other.example' …` → `403`.
**→ 1.18.0, two-step verification confirmed by e-mail (CHANGELOG 1.18.0; PROGRAMISTA §6, item 88; security.md "Set-up confirmed by e-mail") —
check before deploying:** (1) e-mail works on the site (Site integrations → E-mail sending → "Send a test e-mail");
(2) `serverURL` is set (`NEXT_PUBLIC_SERVER_URL`); (3) tell the staff: whoever sets two-step verification up for the
first time gets a link by e-mail and opens it in the same browser, then signs in again. Accounts that already have it
are not affected. Nothing to wire, no migration, no import-map change. Off: `twoFactor: { confirmByEmail: false }`.
**Check:** `pnpm exec iapl-doctor --deep` shows no `2fa-enrolment-mail` error; a test editor scans the code → the
screen says "we sent a link to …", the link opened in the same browser → "Two-step verification is on".
**→ 1.18.0, security audit fixes (CHANGELOG 1.18.0 "Security audit 2026-12"; security.md "Lists and sorting") — no
migration, no import-map change; check before deploying:** (1) **public lists are capped at 100** for callers that are
not staff (REST / GraphQL; the Local API and the panel are not touched): a client-side script that reads more than
100 documents anonymously gets `hasNextPage: true` — page through, or `listLimit: { max }` / `{ exclude: ['slug'] }`
/ `false`; (2) a `?sort=$…` answers `400` (`refuseOperatorSort: false` = Payload's way); (3) Payload's document locks
are staff only (`lockedDocuments: false` = Payload's default); (4) the negotiated Markdown at a page URL is
`private, no-store` + `Vary: Accept`, while HTML pages keep their caching (ISR unchanged) — a proxy of your own that
rewrites to `/md/…` copies the headers (content.md); `markdown: { negotiate: false }` turns negotiation off; (5) CSP
report log lines show origins and paths, at most 10 per request and 60 requests per client a minute (a log parser
that read full URLs adapts; `createCspReportRoute({ maxReports, rateLimit })`); (6) a text field of your own whose
value goes into `href` (social profiles, a website): `buildUrlField()` and `safeHref()` at render (no schema change);
(7) **access callbacks are strict:** `cookieScanner.access` and the doctor's `access` allow only on a literal `true`
— a callback that returns `req.user` now refuses (`403`): return `Boolean(req.user)` or a role check; the old reading
back: `iapl({ strictAccessAnswers: false })`; (8) the first `iapl-doctor --only security` run shows the new `code-*` / `config-dangerous` rules — judge each, mark a
correct place `// iapl-security-ok: <why>`. **Check:** `curl -s '<site>/api/pages?limit=100000' | jq .limit` → `100`;
`curl -s -o /dev/null -w '%{http_code}' '<site>/api/pages?sort=%24where'` → `400`;
`pnpm exec iapl-doctor --url <site> --only live-probes` → no finding.
**→ 1.18.0, speed and growth (CHANGELOG 1.18.0 "Speed and growth"; PROGRAMISTA §6, items 91, 94; performance.md) —
no migration; MongoDB gets a hidden date on two logs; check before deploying:** (1) `pnpm exec iapl-doctor` — the
`perf-*` rules are **errors** now: fix what they name or lower / silence a rule with a reason in `iapl-doctor.json`;
a site with Playwright and no budget test gets `perf-budgets` (copy the `iapl-performance` template); (2) JPEG / PNG
uploads lose their metadata (`buildOptimizeUploadHook({ stripMetadata: false })` keeps it); (3) MongoDB: old consent
records (1095 days) and statistics (90 days) are deleted by a TTL index within a minute of the first start
(`ttlIndex: false` on `consentLog` / `stats`); (4) a plugin collection or global whose versions you turned on keeps 20
per document unless you set `max` / `maxPerDoc`; (5) `BuilderForm` and `Turnstile` from `/client` are lazy (same
props, the HTML is complete); the eager ones: `@intecion/ipal-kit/client/eager`; (6) a helper without its own
`'use client'` imported from `/client` into a server component is the plain function now (do not pass it to a client
component as a prop); (7) `pnpm exec iapl-skills` installs `iapl-performance`; `unusedMedia: true` needs
`pnpm generate:importmap`. **Check:** `pnpm exec iapl-doctor --only performance` → no error; the site's forms still
send.
**→ 1.18.0, drafts left out of related documents (CHANGELOG 1.18.0 "Content and plugin writes"; PROGRAMISTA §6,
item 93; content.md "Drafts as related documents") — nothing to run:** a menu link, a block or a System pages link that
points at a page never published no longer shows on the site (its title, slug and text are left out); a preview keeps
it. The old behaviour: `createContentHelpers({ draftRelations: 'keep' })`. **Check:** a menu link to an unpublished
page is gone on the live site and back after publishing.
**→ 1.18.0 (from 1.17.2, never released alone), security (CHANGELOG 1.18.0 "From 1.17.2"; PROGRAMISTA §6, items 84–87) — nothing required, check:** `readVersions:
readPublished()` now works (a wrapper of your own around it: use `readPublishedVersions()` inside); behind a proxy
that rewrites `Host` without `X-Forwarded-Host`, set `serverURL` or the panel's mail / cookie buttons answer 403
(`iapl-doctor` warns); a locked editor sees "incorrect" until the lock ends (`accounts.lockedAnswer: 'payload'` for
Payload's text); saving Cookies with a lower consent version is refused (`cookieSettings.allowLowerPolicyVersion`).
**Check:** `curl -s <site>/api/pages/versions` as a visitor → 200 (published only), not 500.
**→ 1.18.0 (from 1.17.2):** (1) Payload jobs: if the project has tasks or workflows and a cron calls `/api/payload-jobs/run` (or
`/handle-schedules`) without its own `jobs.access.run`, set `CRON_SECRET` (16+ characters) in the app's environment
and send `Authorization: Bearer <CRON_SECRET>` from the cron; in-process runs (`jobs.autoRun`, `payload jobs:run`)
and an admin's API key need nothing (security.md "Payload's job queue"). Verify: the run route answers 401 without
the header, 200 with it. (2) A front end that posted to `/api/form-submissions` as a customer account (not through
`submitForm`): move it to `submitForm` / `createSubmitAction`, or set `forms.formSubmissionOverrides.access.create`.
(3) A site with a visitor login collection: `iapl-doctor --url …` lists `visitor-writes`; give each listed collection
and global its own write rule (`adminOrEditor`). (4) If the project has `tests/routes.ts`: `update`, judge, commit.
**→ 1.18.0 (from 1.17.2), cookie button (CHANGELOG 1.18.0 "From 1.17.2"; PROGRAMISTA §6, item 83; consent.md "Where the cookie button sits") — nothing is required:**
visitors now see the "cookie settings" button in the bottom corner of the window on every page; it never moves and
no longer rides up above the footer. While it is shown the footer is a little taller (about 40 px on the reference
site), so its last row ends above the button. Check the end of a page on a phone and on desktop: nothing under the
button, the last footer link can be tapped. Bottom padding a project added by hand for the button: remove it (the
plugin counts existing padding, so it is not doubled, but it is no longer needed). Amount by hand:
`--ipal-cookie-button-space` on the footer (`0` = none); no room: `reserve={false}`. The placement before:
`cookieButton={<CookieButton avoid={COOKIE_BUTTON_AVOID} />}` on `SiteProviders`. A project e2e that expects the button
above the footer, or an exact footer height after a decision: update it.
**→ 1.17.1:** (1) `src/proxy.ts`: replace the matcher literal with
`['/((?!(?:api|admin|_next)(?:/|$)|.*\\..*).*)']` (i18n.md "Next matcher"; `iapl-doctor` rule `proxy-matcher`).
The old one skipped every page whose first segment only starts with `api`, `admin` or `_next` (`/administracja`):
no locale redirect, no proxy CSP there. Verify on a build: `curl -sI localhost:3000/administracja` → 307 to
`/pl/administracja`; `/admin` and `/api/health` unchanged. (2) If the project has `tests/routes.ts`: run
`pnpm payload run tests/routes.ts update`, judge the new entries, commit (after EVERY Payload / IAPL upgrade). New
projects: add the closed-doors spec and the route check (iapl-audit "What the script does not check").
**→ 1.17.1, security (CHANGELOG 1.17.1; PROGRAMISTA §6, items 79–81; security.md) — check before deploying:**
1. `pnpm build`: a config value the plugin does not understand now stops the start with the option's name
(`accounts: 0`, `stats: 'false'`, `retentionDays: null`, an unknown role name in `requireRole`, …). Fix the value;
real values start as before (security.md → "Switches are read strictly").
2. Nothing to do for the write-only secrets: no query can name them any more. A site that had versions on for Site
integrations, with an admin account that may have been misused: change the SMTP password and the Turnstile key.
3. `twoFactor.requireSetup.exempt` decided from the e-mail: move to an admin-only checkbox (security.md); every
account may change its own e-mail.
4. A collection of the project with drafts and `read: () => true`: use `readPublished()` so `?draft=true` answers
visitors nothing unpublished.
5. Your own endpoint with `buildVerifyLimit`: call `limit.settle(req, correct)` after the check.
**Check:** `pnpm exec iapl-doctor` has no `proxy-matcher`; `curl -s "<site>/md/xx"` → 404; the panel's 2FA works.
**1.8.x → 1.9.0 (PROGRAMISTA §6, items 17–21):** `twoFactor.plugin` required; **1.8.x → 1.9.0 (PROGRAMISTA §6, items 17–21):** `twoFactor.plugin` required;
`getTurnstileConfig` instead of `turnstileSiteKey` (with both keys set the token is `getTurnstileConfig` instead of `turnstileSiteKey` (with both keys set the token is
required — check that every form has the widget); `clientIp(await headers())` in required — check that every form has the widget); `clientIp(await headers())` in
@@ -82,7 +189,7 @@ the banner → `<CookieBanner settings="detailed">` and remove the copy. With `d
`buildGlobalRevalidateHook({ revalidatePath })`; `consentFieldName` passed only because the option was ignored → `buildGlobalRevalidateHook({ revalidatePath })`; `consentFieldName` passed only because the option was ignored →
`forms.consentFieldName` works now; your own seed guard / upsert code → `@intecion/ipal-kit/seed` (`createSeeder`). `forms.consentFieldName` works now; your own seed guard / upsert code → `@intecion/ipal-kit/seed` (`createSeeder`).
**Every upgrade — Next.js 16.4.5 or later** (AGENT.md §4 item 11): `pnpm ls next sharp`; below 16.4.5 → **Every upgrade — Next.js 16.4.6 or later** (AGENT.md §4 item 11): `pnpm ls next sharp`; below 16.4.6 →
`pnpm add [email protected] [email protected] sharp@^0.35.5`, `rm -rf .next`, build, redeploy on Coolify `pnpm add [email protected] [email protected] sharp@^0.35.5`, `rm -rf .next`, build, redeploy on Coolify
(a new image ships the fixed next and sharp). **Check:** `pnpm exec iapl-doctor` → no `next-min` finding; `pnpm dev` (a new image ships the fixed next and sharp). **Check:** `pnpm exec iapl-doctor` → no `next-min` finding; `pnpm dev`
prints no security-upgrade warning. prints no security-upgrade warning.
@@ -100,11 +207,15 @@ Postgres/SQLite run `pnpm payload migrate:create` anyway and commit it if it is
saves; `pnpm exec iapl-doctor` → no `versions` finding; Coolify app → Terminal → `node -v` → 22.23.5 or later. saves; `pnpm exec iapl-doctor` → no `versions` finding; Coolify app → Terminal → `node -v` → 22.23.5 or later.
**Every upgrade — dependency advisories** (AGENT.md §4 item 12): `pnpm audit --prod`; on Payload 3.94.x add the **Every upgrade — dependency advisories** (AGENT.md §4 item 12): `pnpm audit --prod`; on Payload 3.94.x add the
`dompurify` and `happy-dom` overrides to `pnpm.overrides`; on an older Payload also `mongoose` (MongoDB sites; 3.90–3.93 `cross-spawn`, `dompurify`, `happy-dom` and `ws` overrides to `pnpm.overrides` (`ws`: GHSA-37g9-w4hg-h9qr, high;
`cross-spawn`: GHSA-ghv9-86vm-4v8m, critical, Windows only; both 1.18.0); a Postgres site also
`"esbuild@<0.25.0": "^0.25.12"` (via drizzle-kit, AGENT.md §4 item 12); on an older Payload also `mongoose` (MongoDB sites; 3.90–3.93
pin 8.24.1, which has a critical advisory, GHSA-pcrw-h46h-c93h, and four more) and `undici` (3.90–3.91): pin 8.24.1, which has a critical advisory, GHSA-pcrw-h46h-c93h, and four more) and `undici` (3.90–3.91):
```json ```json
"cross-spawn@>=7 <7.1.0": "^7.1.2",
"dompurify@<3.4.17": "^3.4.17", "dompurify@<3.4.17": "^3.4.17",
"happy-dom@<21.0.4": "^21.0.4", "happy-dom@<21.0.4": "^21.0.4",
"ws@>=8 <8.23.0": "^8.23.0",
"mongoose@>=8 <8.24.7": "~8.24.10", "mongoose@>=8 <8.24.7": "~8.24.10",
"undici@>=7 <7.30.1": "^7.30.1" "undici@>=7 <7.30.1": "^7.30.1"
``` ```
@@ -123,7 +234,7 @@ panel opens and a document saves.
`engines`. Remove `nodemailer` and `@types/nodemailer` from the project's own `package.json` if someone added them `engines`. Remove `nodemailer` and `@types/nodemailer` from the project's own `package.json` if someone added them
(the plugin's copy is the one `mailAdapter` uses). **Check:** Site integrations → E-mail sending → send a test (the plugin's copy is the one `mailAdapter` uses). **Check:** Site integrations → E-mail sending → send a test
e-mail over SMTP (and over Microsoft Graph when the project uses it). e-mail over SMTP (and over Microsoft Graph when the project uses it).
3. **Next.js** — the "Every upgrade — Next.js" step above (today 16.4.5 or later, `sharp@^0.35.5`). 3. **Next.js** — the "Every upgrade — Next.js" step above (today 16.4.6 or later, `sharp@^0.35.5`).
4. **Dependency advisories** — the "Every upgrade — dependency advisories" step above (`dompurify` / `graphql-scalars` / 4. **Dependency advisories** — the "Every upgrade — dependency advisories" step above (`dompurify` / `graphql-scalars` /
`undici` overrides on payload 3.90.x). **Check:** `pnpm audit --prod` → no high or critical. `undici` overrides on payload 3.90.x). **Check:** `pnpm audit --prod` → no high or critical.
5. **Cookie list kept by hand** → offer `cookieScanner: true` (+ `crawl: true` with `IAPL_COOKIE_SCAN_URL`, 5. **Cookie list kept by hand** → offer `cookieScanner: true` (+ `crawl: true` with `IAPL_COOKIE_SCAN_URL`,
@@ -231,7 +342,7 @@ and the browser tab shows the same separator.
cookie banner only through `--ipal-*-dark`: check the banner in the dark theme. cookie banner only through `--ipal-*-dark`: check the banner in the dark theme.
4. Optional: the block library, block by block (block-library.md); after turning blocks on: `pnpm generate:types`, 4. Optional: the block library, block by block (block-library.md); after turning blocks on: `pnpm generate:types`,
`pnpm payload generate:importmap`, Postgres/SQLite `migrate:create`. `pnpm payload generate:importmap`, Postgres/SQLite `migrate:create`.
5. **CookieButton** lifts above the footer — check a site with its own fixed footer bar; `avoid={false}` keeps it fixed. 5. **CookieButton** lifts above the footer — check a site with its own fixed footer bar; `avoid={false}` keeps it fixed. (Since 1.18.0 it stays in the bottom corner by default; the lift is `avoid={COOKIE_BUTTON_AVOID}`.)
6. `pnpm exec iapl-skills` (new **iapl-doctor**; updated iapl-reference, iapl-setup, iapl-site, iapl-audit). 6. `pnpm exec iapl-skills` (new **iapl-doctor**; updated iapl-reference, iapl-setup, iapl-site, iapl-audit).
7. Run `pnpm exec iapl-doctor` (and `--url https://<site>`), fix or silence each finding with a reason in 7. Run `pnpm exec iapl-doctor` (and `--url https://<site>`), fix or silence each finding with a reason in
`iapl-doctor.json`. `IAPL_DOCTOR_TOKEN` (≥ 32 characters) only if the deep check runs against production. `iapl-doctor.json`. `IAPL_DOCTOR_TOKEN` (≥ 32 characters) only if the deep check runs against production.
@@ -405,7 +516,10 @@ site without steps 1–3 and a deploy day agreed with the owner. Steps 2, 3 and
`[iapl] 2FA: the column for "totpSetupFrom" is missing … NOBODY CAN LOG IN`. `pnpm exec iapl-doctor` reports `[iapl] 2FA: the column for "totpSetupFrom" is missing … NOBODY CAN LOG IN`. `pnpm exec iapl-doctor` reports
it before the deploy. MongoDB: nothing. it before the deploy. MongoDB: nothing.
4. An integration that logs in with a password and has no TOTP: give it an API key, or 4. An integration that logs in with a password and has no TOTP: give it an API key, or
`twoFactor.requireSetup: { exempt: ({ user }) => user.email === '…' }`. `grep -rn "overrideAccess: false" src`: `twoFactor.requireSetup: { exempt: ({ user }) => user.serviceAccount === true }` with a checkbox only admins can
write (`access: { create: adminOnlyField, update: adminOnlyField }`) — not by e-mail: every account may change its
own e-mail (security.md "Decide `exempt` from a field only an administrator can write"). A project already on an
e-mail list (1.17.1): move to the field, or make `email` admin-only. `grep -rn "overrideAccess: false" src`:
a `user` fetched by id is refused for every account now — take it from `payload.auth({ headers })`. a `user` fetched by id is refused for every account now — take it from `payload.auth({ headers })`.
5. `rm -rf .next`, build, redeploy on Coolify. Read the first lines of the log: `[iapl] 2FA: N existing account(s) 5. `rm -rf .next`, build, redeploy on Coolify. Read the first lines of the log: `[iapl] 2FA: N existing account(s)
without two-step verification…` — pass that number to the owner. The line appears on that first start only. without two-step verification…` — pass that number to the owner. The line appears on that first start only.
@@ -624,7 +738,7 @@ PROGRAMISTA §6, items 73–75; email.md; AGENT.md §7.2) — nothing to run; re
3. **For a site that will use the mail service:** `serverURL` is the public address the site answers on without a 3. **For a site that will use the mail service:** `serverURL` is the public address the site answers on without a
redirect; no proxy or WAF rule blocks `/api/iapl/mail-relay/confirm`; `trailingSlash: true` or another `routes.api` → redirect; no proxy or WAF rule blocks `/api/iapl/mail-relay/confirm`; `trailingSlash: true` or another `routes.api` →
Intecion sets the site's confirm address first; "Sender address" is filled in (replies go there); the client's Intecion sets the site's confirm address first; "Sender address" is filled in (replies go there); the client's
processing agreement names the service. Tell Intecion the host: while the service runs with enrolment "pending" (from its launch until Intecion switches to open enrolment), every new site waits for approval (the panel says "waiting for approval"); under open enrolment a site is active as soon as it enrols. processing agreement names the service. A new site waits until a person of Intecion confirms it: "Połącz z IWSN" in the panel (contract 1.8.0).
**Launch and a domain move need nothing:** the real domain enrols by itself although the database holds the **Launch and a domain move need nothing:** the real domain enrols by itself although the database holds the
development address's connection. **A staging or test copy of the database** neither enrols nor sends by itself development address's connection. **A staging or test copy of the database** neither enrols nor sends by itself
**when it is non-public**: its host matches `iapl({ developmentHosts })` — built in `*.dev.netscale.pl`, so the **when it is non-public**: its host matches `iapl({ developmentHosts })` — built in `*.dev.netscale.pl`, so the
@@ -646,7 +760,53 @@ PROGRAMISTA §6, items 73–75; email.md; AGENT.md §7.2) — nothing to run; re
**Check:** `pnpm exec iapl-doctor --deep --url <site>` → no `mail-transport` / `mail-relay-state` / `mail-reply-address` / **Check:** `pnpm exec iapl-doctor --deep --url <site>` → no `mail-transport` / `mail-relay-state` / `mail-reply-address` /
`mail-relay-route` finding (or only `mail-graph-deprecated` on a Graph site); Site integrations → E-mail sending → `mail-relay-route` finding (or only `mail-graph-deprecated` on a Graph site); Site integrations → E-mail sending →
**Send test e-mail** names the transport you expect; a form submission arrives. **The service is live at **Send test e-mail** names the transport you expect; a form submission arrives. **The service is live at
`https://webservices.intecion.net/mail`; while the service runs with enrolment "pending" (from its launch until Intecion switches to open enrolment), every new site waits for approval — keep SMTP until it is approved, or `relay: false`.** `https://webservices.intecion.net/mail`; a new site waits until a person of Intecion confirms it ("Połącz z IWSN") — keep SMTP until then, or `relay: false`.**
**→ 1.18.0, IWSN is connected by a person of Intecion (CHANGELOG 1.18.0 "IWSN"; PROGRAMISTA §6, item 90; email.md "The mail service"; AGENT.md §7.2 point 5) — nothing to run:**
1. No schema change, no migration, no import-map change. Sites whose "Sending method" is SMTP or Microsoft Graph see no
change at all.
2. A site on IWSN that is already active stays active. A site that waits (`relay-pending`, or doctor `mail-relay-connect`
error after the upgrade): Site integrations → E-mail sending → **"Połącz z IWSN"** → a person of Intecion confirms
it on the page that opens (an @intecion.com sign-in — the owner's step, tell them) → the block says "Connected to
IWSN" by itself. Then send a test e-mail.
3. A project that does not want the button: `mail: { relay: { connectButton: false } }` (no button, no route).
**→ 1.17.1, e-mail (CHANGELOG 1.17.1 point 5; PROGRAMISTA §6, item 82; email.md "Which transport a send takes"; AGENT.md §7.2) — nothing to run, one check:**
1. **MongoDB: no migration. Postgres / SQLite: `pnpm payload migrate:create`** (the new field `emailMethod` is a column),
commit it, apply it when the new container starts — in the same deploy. Without it mail still leaves the old way, but
the Site integrations page does not open and the log and `iapl-doctor --deep` (`mail-method`, error) say so. No
import-map change; `pnpm payload generate:types` gives a diff (the field `emailMethod`): run it and commit.
2. After the deploy open Site integrations → E-mail sending. "Sending method" shows the method the site sends through
today as selected: **IWSN (built-in)** (no SMTP server), **Own SMTP server**, or **Microsoft Graph (deprecated)**
(`GRAPH_*` on the server). Nothing to save: the site keeps sending exactly as before **until somebody picks another
option** (saving with the shown method stores nothing); `iapl-doctor --deep` notes it (`mail-method`, info). Send a
test e-mail: the answer names the method.
3. From the save on what is chosen is what is used: "Own SMTP server" with an incomplete server, or "Microsoft Graph"
without `GRAPH_*`, sends **nothing** and says so (state block, `mail-method` error) — no fallback to another method.
Tell the owner before changing the method on a live site.
4. Seeds and scripts that set up mail: write `emailMethod: 'relay' | 'smtp' | 'graph'` (or `setMailMethod(payload, …)`).
`emailTransport` written alone still works and means the old order.
**→ 1.17.1, the sign-in look (CHANGELOG 1.17.1; PROGRAMISTA §6, item 80; white-label.md → "The sign-in screens") — nothing is required:**
1. **Sites with `whiteLabel`:** after the update the login screen and the 2FA screens (code, setup) have the new
look — a dark panel with the client's logo or the site's name beside the form. No edit, no
`generate:importmap`, no migration: the look comes through `AdminLogo` and `SafeTotpView`, which the site's
import map already has. **Check:** open `/admin/login` on a desktop and at a phone width, in both themes; sign
in through 2FA.
**Look at the logo:** it stands straight on a dark panel. A logo with dark letters: `signIn: { logoPlate: true }`
(a white plate) or ask the client for a logo for dark grounds. Every logo that showed on the login screen
before shows now (an SVG too); only a logo whose file is gone shows the site's name instead of a broken picture.
**Editors lose three fields:** the name, logo and icon of Site settings are admin-only now (they are what the
public sign-in page shows). A site whose editors must change them: `whiteLabel: { brandAccess: 'editor' }`.
2. **Tell the owner the sign-in page looks different** and ask whether to keep it. No: `whiteLabel: { signIn: false }`
— Payload's screens with the plain logo, as before (record it in AGENTS.md → Project decisions).
3. **Recommended, one edit:** `whiteLabel: { signIn: { allScreens: true } }`, `pnpm payload generate:importmap`,
commit `importMap.js` — forgot / reset password, create first user and logout get the same look. Forgetting
the import map does not break the panel: at a production start the provider is left out and the log says so.
4. **Project CSS for the login screen** (`custom.scss` rules on `.login`, `.template-minimal`, a hand-made
`graphics.Logo`): look at the screens after the update; the look's own rules win over Payload's layer but not
over the project's later ones. Restyle with the `--iapl-signin-*` variables instead.
5. Sites **without** `whiteLabel`: nothing changes.
## 2. Inventory (no code changes) ## 2. Inventory (no code changes)
**What changed for projects** between your old and new plugin version is exactly the reference site's diff — **What changed for projects** between your old and new plugin version is exactly the reference site's diff —
+4 -1
View File
@@ -180,7 +180,10 @@ plugin's components. `content` needs `resolveLink`; `getEntries` (entry list), `
`CMSLink` (a panel link → `Anchor`, with `buttonClass`; a link that wraps something — a logo, a card — and leads nowhere `CMSLink` (a panel link → `Anchor`, with `buttonClass`; a link that wraps something — a logo, a card — and leads nowhere
keeps its content without a link, so an empty link group never hides it), keeps its content without a link, so an empty link group never hides it),
`buttonClass` / `BUTTON_CLASSES` (button looks by appearance), `Container` / `CONTAINER_WIDTHS`, `Card` / `CARD_CLASS` / `buttonClass` / `BUTTON_CLASSES` (button looks by appearance), `Container` / `CONTAINER_WIDTHS`, `Card` / `CARD_CLASS` /
`CARD_INTERACTIVE_CLASS`. Helpers for the project's own blocks: `Buttons` (a block's button row), `headingId(block)` `CARD_INTERACTIVE_CLASS` (1.18.0: the hover lift fades an `::after` shadow layer with `opacity` — drawn by the
compositor, no repaint per frame; the 1.17 `box-shadow` transition is `CARD_INTERACTIVE_SHADOW_CLASS`). `Media` pauses
a background video for visitors with "reduce motion" (`pauseForReducedMotion={false}` turns that off) and takes `eager`
for an image above the fold that is not the LCP image. Helpers for the project's own blocks: `Buttons` (a block's button row), `headingId(block)`
(the heading id for `aria-labelledby`), `TitleLink` (a card title that links when its link resolves), `GRID_COLUMNS`, (the heading id for `aria-labelledby`), `TitleLink` (a card title that links when its link resolves), `GRID_COLUMNS`,
`cx`, `parts(defaults, overrides)`, `itemHeadingLevel(slug, props)` (the item heading tag) and `leadsWithImage(props)` `cx`, `parts(defaults, overrides)`, `itemHeadingLevel(slug, props)` (the item heading tag) and `leadsWithImage(props)`
(whether the block's first image is the LCP image). (whether the block's first image is the LCP image).
+55 -8
View File
@@ -113,12 +113,51 @@ takes `locale` and optional `labels`; defaults: `COOKIE_TABLE_LABELS` (`@intecio
| `controls` | `'checkbox'` | `'checkbox' \| 'switch'` | | `controls` | `'checkbox'` | `'checkbox' \| 'switch'` |
| `settingsActions` | `['back', 'save']` | buttons under the categories (`'accept' \| 'back' \| 'reject' \| 'save'`) | | `settingsActions` | `['back', 'save']` | buttons under the categories (`'accept' \| 'back' \| 'reject' \| 'save'`) |
`CookieButton` props: `className` (replaces the default classes; position is then yours too), ### Where the cookie button sits (1.18.0)
`side` (`'left'` default or `'right'`), `avoid` (CSS selector, default `COOKIE_BUTTON_AVOID` =
`'footer, [role="contentinfo"]'`; `false` = never move). While the footer is on screen the button `CookieButton` is fixed in the **bottom corner of the window** — on every page, long or short, at every scroll
moves up by its visible part (`bottomOverlap`), so it never covers footer links. Position tokens: position, on desktop and phone — and it **never moves**. It is a child of `<body>` (never inside the footer) and it
`--ipal-cookie-button-offset` (from the bottom, default `1rem`), `--ipal-cookie-button-inset` (from the no longer climbs above the footer when the footer scrolls into view (1.12.x–1.17.1 did that: on a phone with a tall
side, default `1rem`); z-index `--ipal-z-header`. Type `CookieButtonProps`. footer the button ended at the top of the screen, on a short page in the middle of it).
**Room under the footer.** A fixed button would, at the very end of a page, lie on whatever is in that corner — the
first link of the footer's last row — and a visitor could not scroll it free. So while the button is shown, the
plugin gives the page's last block (the footer) **bottom padding: just enough for its last row to end above the
button** (`reserveCookieButtonSpace`). The footer's background continues through it.
| | |
|---|---|
| How much | measured, not fixed: the button's height + its distance from the bottom + the device's safe area + 8 px, **minus what is already free** under the lowest text or control in the button's column. The footer's own bottom padding counts first — never double space. On the reference site: 42–43 px on phones and desktop |
| Where nothing is in the corner | nothing is added (a centred footer on a wide screen, the button on the other side) — so there is no breakpoint to configure |
| When | only while the button is shown: not before a decision, not while the banner is open (the footer is as the project made it), gone when the button is turned off (`cookieButton={false}`) |
| No layout shift | on a static page the HTML carries a small inline script next to the button's place: for a visitor who already decided it makes the room **before the first paint** (in a style sheet, so React hydrates the server's markup untouched), and the button's own measurement after hydration gives the same size. After a click in the banner the room appears with the button. Later changes (fonts, a form that grows, a resize) are followed |
| Which block | the last element matching `reserve` (default `COOKIE_BUTTON_RESERVE` = `'footer, [role="contentinfo"]'`); none on the page → `<body>` |
| Prop | Default | What it does |
|---|---|---|
| `side` | `'left'` | corner: `'left'` or `'right'` |
| `reserve` | `COOKIE_BUTTON_RESERVE` | CSS selector of the block that gets the room (the last match); `false` = no room — the button then covers what is in the corner at the end of the page |
| `avoid` | — | placement before 1.18.0: a CSS selector the button lifts above while it is on screen — `avoid={COOKIE_BUTTON_AVOID}` (`'footer, [role="contentinfo"]'`) is exactly the old default (`bottomOverlap`); no room is reserved then. `false` = the default (kept for sites that set it) |
| `className` | — | replaces the default classes; position is then yours too (room is measured from the real button once it is on the page, and only while it is `position: fixed`) |
**Set the amount yourself:** `--ipal-cookie-button-space` on the footer — any length, added to the footer's own
padding instead of the measured amount; `0` = none, also per breakpoint:
```css
footer { --ipal-cookie-button-space: 4rem; }
@media (min-width: 64rem) { footer { --ipal-cookie-button-space: 0; } } /* nothing on desktop */
```
Position tokens: `--ipal-cookie-button-offset` (from the bottom, default `1rem`), `--ipal-cookie-button-inset`
(from the side, default `1rem`); the device's safe-area insets (bottom and the chosen side) are added. z-index
`--ipal-z-header` (default 40): above the page, below the banner, the settings window and the lightbox (50).
Hidden while the banner is showing. Keyboard: a `<button>` in the tab order with an `aria-label` from the panel.
Type `CookieButtonProps`.
Nonce CSP: the inline script takes the nonce given to `SiteProviders` / `ConsentProvider`; refused, the room is made
when the button appears (a footer pinned to the bottom of a page shorter than the window then moves once).
Building blocks: `reserveCookieButtonSpace({ selector, side, button?, release? })`, `COOKIE_BUTTON_SPACE_ATTRIBUTE`
(`/client`), `consentDecidedScript` (root).
## Compliance defaults (1.17.0) ## Compliance defaults (1.17.0)
@@ -449,7 +488,7 @@ New fields in the global = a migration in projects on Postgres/SQLite (`payload
The elements also have stable `data-ipal` handles for CSS and e2e tests (used by The elements also have stable `data-ipal` handles for CSS and e2e tests (used by
`iapl-consent-check`): `banner` (while it waits for the first-paint script it carries `hidden`; a button clicked before hydration: `iapl-consent-check`): `banner` (while it waits for the first-paint script it carries `hidden`; a button clicked before hydration:
`data-ipal-pending`; live: `data-ipal-ready`), `banner-script`, `cookie-button` and the buttons `settings`, `reject`, `data-ipal-pending`; live: `data-ipal-ready`), `banner-script`, `cookie-button` (`cookie-button-script`: its inline script in the server HTML; `data-ipal-cookie-space` on the footer while it holds the button's room) and the buttons `settings`, `reject`,
`accept`, `back`, `save`; in modal mode also `consent-overlay`, `consent-dialog`, `close`; in detailed mode `accept`, `back`, `save`; in modal mode also `consent-overlay`, `consent-dialog`, `close`; in detailed mode
additionally `category-<category>` (card) and `cookies` (expandable list). additionally `category-<category>` (card) and `cookies` (expandable list).
@@ -542,6 +581,13 @@ to add the hook to a config. Nothing to migrate.
- **New consent after a policy change:** Cookies → *Consent version* (sidebar). Raise it by 1 - **New consent after a policy change:** Cookies → *Consent version* (sidebar). Raise it by 1
after adding a tool or changing the policy — every visitor will see the banner again. after adding a tool or changing the policy — every visitor will see the banner again.
`getConsentTexts` passes the version to `<ConsentProvider texts>` automatically. `getConsentTexts` passes the version to `<ConsentProvider texts>` automatically.
- **The consent version only goes up (1.18.0).** A stored consent counts only under the version it was given for,
so a lower number would make consent given under an older policy valid again. Saving Cookies with a lower
*Consent version* through the panel, REST or GraphQL is refused: "The consent version cannot go down: it is 3
now…" (Polish in a Polish panel). The same number, a higher one, or a save without it pass. A script an admin runs
with the Local API and `overrideAccess` may still lower it. Turn the rule off: `iapl({ cookieSettings:
{ allowLowerPolicyVersion: true } })`. Building blocks: `policyVersionNeverDown` (the field hook),
`buildCookieSettingsFields({ allowLowerPolicyVersion })`, `buildCookieSettings(options)`.
- **Withdrawing consent deletes the tools' cookies** (`_ga`, `_ga_*`, `_gid`, `_fbp`, `_gcl_*`, Clarity, - **Withdrawing consent deletes the tools' cookies** (`_ga`, `_ga_*`, `_gid`, `_fbp`, `_gcl_*`, Clarity,
LinkedIn, TikTok, Hotjar…) — also on the parent domain (`.client.com`), where GA stores them. LinkedIn, TikTok, Hotjar…) — also on the parent domain (`.client.com`), where GA stores them.
The project's own cookies: `<ConsentProvider cookieMap={{ marketing: ['_my*'] }}>` (added to the The project's own cookies: `<ConsentProvider cookieMap={{ marketing: ['_my*'] }}>` (added to the
@@ -571,8 +617,9 @@ to add the hook to a config. Nothing to migrate.
| Item | Value | | Item | Value |
|---|---| |---|---|
| Option | `consentLog?: boolean \| { retentionDays?: number; collectionOverrides?: CollectionOverride }` (type `ConsentLogOptions`) | | Option | `consentLog?: boolean \| { retentionDays?: number; ttlIndex?: boolean; collectionOverrides?: CollectionOverride }` (type `ConsentLogOptions`) |
| `retentionDays` | default `1095` (3 years) | | `retentionDays` | default `1095` (3 years) |
| `ttlIndex` | 1.18.0, MongoDB: default `true` — a TTL index (`iapl_ttl` on the hidden date `iaplTtlFrom`) deletes records older than `retentionDays` by itself, also when no new record comes; kept at the current retention at every start; `false` drops it at the next start (the purge after a new record stays). Postgres / SQLite: not used, no column |
| `collectionOverrides` | changes `consent-records`: an object merges `access` / `admin` / `hooks` key by key (your keys win), other keys replace; a function `(collection) => collection` takes over (keep the slug — the endpoint writes to it) | | `collectionOverrides` | changes `consent-records`: an object merges `access` / `admin` / `hooks` key by key (your keys win), other keys replace; a function `(collection) => collection` takes over (keep the slug — the endpoint writes to it) |
| Collection | `consent-records` (`CONSENT_LOG_SLUG`), group *Privacy*; fields `consentId` (index), `version`, `choices.{necessary,functional,analytics,marketing}`, `createdAt` | | Collection | `consent-records` (`CONSENT_LOG_SLUG`), group *Privacy*; fields `consentId` (index), `version`, `choices.{necessary,functional,analytics,marketing}`, `createdAt` |
| Collection access | `read` / `delete` — admin (without `access`, i.e. no roles: any logged-in account — narrow it with `collectionOverrides`); `create` / `update` — nobody through the API (written only by the endpoint, `overrideAccess`) | | Collection access | `read` / `delete` — admin (without `access`, i.e. no roles: any logged-in account — narrow it with `collectionOverrides`); `create` / `update` — nobody through the API (written only by the endpoint, `overrideAccess`) |
+65 -7
View File
@@ -89,6 +89,11 @@ Without `draft: true`, documents with a `_status` other than `published` (page,
entry) give `null`. The page assigned as 404 in System pages also gives `null` entry) give `null`. The page assigned as 404 in System pages also gives `null`
(a real 404 instead of a soft 404). (a real 404 instead of a soft 404).
**A locale the site does not have gives `null` (1.17.1).** `xx`, `all` or `*` — from a URL that went past the
proxy (a dotted path, the Markdown route `/md/xx`) or a caller — used to resolve the default locale's page under that
code; now it is "not found". `isSiteLocale(payload, locale)` is the same check for your own code. A site without
localization is not affected.
Logic: the first segment is matched against the slugs of the archive pages from System Logic: the first segment is matched against the slugs of the archive pages from System
Pages. A match → we know which collection it is about. `['artykuly']` → listing of Pages. A match → we know which collection it is about. `['artykuly']` → listing of
`posts`; `['artykuly','moj-post']` → an entry in `posts`; no match → a regular `posts`; `['artykuly','moj-post']` → an entry in `posts`; no match → a regular
@@ -103,6 +108,33 @@ ambiguous (the same entry under many URLs), so `/a/b/c` → null.
**Slug collision:** two collections with an archive with the same slug → the first one **Slug collision:** two collections with an archive with the same slug → the first one
in the `collections` list wins. A configuration error; the router does not warn. in the `collections` list wins. A configuration error; the router does not warn.
## Drafts as related documents (1.18.0)
A page is read at depth 2, Site settings and archive entries at depth 1, and Payload fills in every related document
whatever its status. Before 1.18.0 a block, a menu or a System pages link that pointed at a page never published
brought that page's title, slug and text into what the helpers answered (and llms-full printed it). Now the helpers
leave such a related document out, as if it did not exist:
| Shape | Becomes |
|---|---|
| a single relationship | `null` — a link resolves to nothing, a menu item drops out |
| a list of relationships | the draft is removed from it |
| a polymorphic one `{ relationTo, value }` | `value: null` |
A related document counts as a draft when it carries `_status` other than `'published'` (a never-published or
unpublished document of a collection with drafts). Documents without `_status` (collections without drafts, media)
are never touched; the document itself is judged as before (only published pages are served). Applies to
`createContentHelpers` (`getSettings`, `resolveRoute`, `getEntries`, `getNotFoundPage`, the page route, Markdown,
MCP, llms-full), `resolveRoute`, `getArchiveEntries`, `resolveNotFoundPage`, `collectSiteIndex` and
`buildLlmsTxt` / `createLlmsTxtRoute`. A preview (`draft: true`) keeps them.
- **What an existing site sees:** a menu item, a card or a link whose page was never published disappears for
visitors instead of showing a title that leads to a 404. Publish the page, or point the link elsewhere.
- **Keep the old behaviour:** `createContentHelpers({ draftRelations: 'keep' })`, or `draftRelations: 'keep'` on
`resolveRoute` / `getArchiveEntries` / `resolveNotFoundPage` / `collectSiteIndex` / `buildLlmsTxt`.
- **Building blocks:** `withoutDraftRelations(value)` (returns the same object when nothing changes, copies only
the changed path), `applyDraftRelations(value, { draft, draftRelations })`, type `DraftRelations`.
## Front-end helpers — createContentHelpers ## Front-end helpers — createContentHelpers
Instead of writing cached wrappers in every project: Instead of writing cached wrappers in every project:
@@ -312,8 +344,11 @@ blocksToMarkdown(page.layout, {
(default true — a YAML block with `locale`, `title`, `description`, `url`, `updated`), `baseUrl` (default true — a YAML block with `locale`, `title`, `description`, `url`, `updated`), `baseUrl`
(gives `url:` — the canonical HTML address), `config` (i18n — with one language `url:` has no `/pl`). (gives `url:` — the canonical HTML address), `config` (i18n — with one language `url:` has no `/pl`).
`markdownResponse(md, { canonical? })` — `null` → 404 `text/plain`; otherwise `text/markdown`, `markdownResponse(md, { canonical?, negotiated? })` — `null` → 404 `text/plain`; otherwise `text/markdown`,
`x-robots-tag: noindex`, `s-maxage=3600`, optional `Link: <…>; rel="canonical"` header. `x-robots-tag: noindex`, `s-maxage=3600`, optional `Link: <…>; rel="canonical"` header. `negotiated: true` (the
answer goes out at the page's own URL, see "content negotiation" below) sends `cache-control: private, no-store` and
`Vary: Accept` instead of the public lifetime; `createMarkdownRoute` sets it by itself when the proxy marked the
request (`MARKDOWN_NEGOTIATED_HEADER`).
Shorter — the whole route in one line: Shorter — the whole route in one line:
@@ -353,14 +388,32 @@ Without it, on a multi-language site the proxy redirects `/md/pl/o-nas` to
`/pl/md/pl/o-nas` (it treats `md` as a path without a language), so the Markdown route does not `/pl/md/pl/o-nas` (it treats `md` as a path without a language), so the Markdown route does not
work. The option lets `/md/…` paths through and does the `Accept` negotiation below. work. The option lets `/md/…` paths through and does the `Accept` negotiation below.
**The negotiated answer is never cached as the page (1.18.0, security audit F3).** It shares the page's URL, so a
CDN that caches HTML ("Cache Everything" on Cloudflare, Varnish) would otherwise store the Markdown and serve it to
every visitor of that page. The proxy marks the rewritten request, the route answers `private, no-store` with
`Vary: Accept`, the rewrite carries the same headers. The proxy also asks for `Vary: Accept` on the pages it passes on, but a
Next page answers with Next's own `Vary`: what keeps a shared cache from storing the Markdown as the page is the
`private, no-store` on the Markdown answer.
`/md/…` keeps its public caching. Cloudflare ignores `Vary` for HTML — `no-store` is what keeps it out of the cache
there. Options: `markdown: { prefix: '/ai', negotiate: false }` — `negotiate: false` serves Markdown only at `/md/…`
(no rewrite, no `Vary: Accept` on pages). Verify:
`curl -sD- -o/dev/null -H 'Accept: text/markdown' https://<domain>/pl | grep -iE 'content-type|cache-control|vary'`
→ `text/markdown`, `private, no-store`, `Vary` with `Accept`; or `pnpm exec iapl-doctor --url https://<domain> --only live-probes`
(probe `markdown-vary`).
Manually (when you have your own proxy): the same URL serves Markdown on negotiation with the `Accept` header Manually (when you have your own proxy): the same URL serves Markdown on negotiation with the `Accept` header
(a rewrite in the proxy): (a rewrite in the proxy):
```ts ```ts
// proxy.ts // proxy.ts — keep the answer out of shared caches: mark the request for createMarkdownRoute and say Vary: Accept
import { prefersMarkdown, markdownHref } from '@intecion/ipal-kit' import { appendVary, MARKDOWN_NEGOTIATED_HEADER, markdownHref, NEGOTIATED_CACHE_CONTROL, prefersMarkdown } from '@intecion/ipal-kit'
if (prefersMarkdown(request)) { if (prefersMarkdown(request)) {
return NextResponse.rewrite(new URL(markdownHref(request.nextUrl.pathname), request.url)) const headers = new Headers(request.headers)
headers.set(MARKDOWN_NEGOTIATED_HEADER, '1')
const res = NextResponse.rewrite(new URL(markdownHref(request.nextUrl.pathname), request.url), { request: { headers } })
res.headers.set('cache-control', NEGOTIATED_CACHE_CONTROL)
appendVary(res.headers, 'Accept')
return res
} }
``` ```
@@ -391,7 +444,8 @@ Query: `?q=` (required), `?locale=`, `?limit=`. Response:
"results": [{ "title": "O nas", "url": "https://x/pl/o-nas", "description": "…", "slug": "o-nas" }] } "results": [{ "title": "O nas", "url": "https://x/pl/o-nas", "description": "…", "slug": "o-nas" }] }
``` ```
No `q` → 400. Published only, without `noindex` (`noindex` or `meta.noindex`) and without the page assigned as the No `q` → 400. An unknown `?locale=` is the default locale — in the search, the under-construction check and the
answer alike (1.17.1). Published only, without `noindex` (`noindex` or `meta.noindex`) and without the page assigned as the
404 page (Site settings → System pages, read through `settingsSlug`, default `site-settings`), 404 page (Site settings → System pages, read through `settingsSlug`, default `site-settings`),
10 by default (`defaultLimit`), max 50 results. Under-construction mode: 10 by default (`defaultLimit`), max 50 results. Under-construction mode:
pass `isPathVisible` from `createContentHelpers`, and hidden pages drop out of the results. Error/database pass `isPathVisible` from `createContentHelpers`, and hidden pages drop out of the results. Error/database
@@ -411,12 +465,16 @@ const results = await searchContent({ payload, query, config, locale, limit, bas
`searchContent` options: `collection` (`'pages'`), `baseUrl`, `homeSlug`, `settingsSlug` (`'site-settings'`, for the 404 page), `locale` `searchContent` options: `collection` (`'pages'`), `baseUrl`, `homeSlug`, `settingsSlug` (`'site-settings'`, for the 404 page), `locale`
(default/invalid → `defaultLocale`), `limit` (10, clamped to 1–50), (default/invalid → `defaultLocale`), `limit` (10, clamped to 1–50),
`queryLimit` (1.17.1; default `{ length: 200, words: 10 }` — `SEARCH_QUERY_LIMIT`): how much of the query reaches
the database. Each word is one more `LIKE` on two columns and the text comes from a stranger, so a longer query is
cut to its first words (`limitQuery(query, queryLimit)` shows the result); `false` = the whole query, as before.
`summaryField` (e.g. `'aiSummary'` — prefers the richer description from `summaryField` (e.g. `'aiSummary'` — prefers the richer description from
`buildSummaryField` over `meta.description`; see [seo.md](./seo.md)). Never throws `buildSummaryField` over `meta.description`; see [seo.md](./seo.md)). Never throws
(error → `[]`). (error → `[]`).
`createSearchRoute` additionally takes `getCachedPayload`, `config` (required), `createSearchRoute` additionally takes `getCachedPayload`, `config` (required),
`defaultLimit` (10), `rateLimit`, `clientIp` (see `clientIp()` in security.md), `isPathVisible`. `defaultLimit` (10), `rateLimit`, `clientIp` (see `clientIp()` in security.md), `isPathVisible`, `queryLimit`
(passed to `searchContent`; the MCP `search_content` tool uses the default).
`listContent({ payload, config, locale, limit, … })` — the same results without a query: `listContent({ payload, config, locale, limit, … })` — the same results without a query:
all published, indexable pages by title (`limit` 50, max 200). A list all published, indexable pages by title (`limit` 50, max 200). A list
+2 -2
View File
@@ -176,7 +176,7 @@ run the tests, commit.
| `integrations` | built-ins | `(defaults) => integrations` — filter, change or add `CookieIntegration`s (each: `key`, `label` — one string or `{ en, pl, … }` per admin language, `declarations`, `isEnabled(ctx)`) | | `integrations` | built-ins | `(defaults) => integrations` — filter, change or add `CookieIntegration`s (each: `key`, `label` — one string or `{ en, pl, … }` per admin language, `declarations`, `isEnabled(ctx)`) |
| `database` | `true` | `false` = no Open Cookie Database lookup | | `database` | `true` | `false` = no Open Cookie Database lookup |
| `databaseCategories` | table above | Partial map from database category to consent category | | `databaseCategories` | table above | Partial map from database category to consent category |
| `access` | editor and up | `({ req }) => boolean` — who may scan, start a crawl and read its status | | `access` | editor and up | `({ req }) => boolean` — who may scan, start a crawl and read its status. Only a literal `true` allows (1.18.0): `({ req }) => req.user` refuses — return `Boolean(req.user)`; `iapl({ strictAccessAnswers: false })` gives the old truthy reading back (security.md "Access callbacks") |
| `collectionOverrides` | — | Change `cookie-review`: an object merges `access` / `admin` / `hooks` key by key (your keys win), a function takes over (keep the slug) | | `collectionOverrides` | — | Change `cookie-review`: an object merges `access` / `admin` / `hooks` key by key (your keys win), a function takes over (keep the slug) |
| `labels` | `en`, `pl` | `{ de: { scanButton: 'Cookies scannen', … } }` — merged over the plugin's labels (`CookieScanLabels`) | | `labels` | `en`, `pl` | `{ de: { scanButton: 'Cookies scannen', … } }` — merged over the plugin's labels (`CookieScanLabels`) |
| `syncAccepted` | `true` | `false` = accepting or approving only marks the entry; nothing is written to Cookie banner | | `syncAccepted` | `true` | `false` = accepting or approving only marks the entry; nothing is written to Cookie banner |
@@ -259,7 +259,7 @@ All from `@intecion/ipal-kit` (server-safe), for your own admin view, a CLI or a
| `cookieScanContext(payload, plugin, req?)` | the `CookieScanContext` a scan uses | | `cookieScanContext(payload, plugin, req?)` | the `CookieScanContext` a scan uses |
| `parseCookieNames(input)` | the panel's text box → clean names | | `parseCookieNames(input)` | the panel's text box → clean names |
| `mergeCookieReview(current, previous, next)`, `suggestionFor(finding, locales)` | the "never overwrite an edit" rule, pure | | `mergeCookieReview(current, previous, next)`, `suggestionFor(finding, locales)` | the "never overwrite an edit" rule, pure |
| `addToCookieList({ payload, entry, req? })` | what accepting does: add the row or fill its empty text → `'added' \| 'filled' \| 'unchanged'`; a row with the same name or a covering pattern counts as the same cookie (`sameCookie(a, b)`) | | `addToCookieList({ payload, entry, req? })` | what accepting does: add the row or fill its empty text → `'added' \| 'filled' \| 'unchanged'`; a row with the same name or a covering pattern counts as the same cookie (`sameCookie(a, b)`). The list is written whole: since 1.18.0 it is read again right before writing and, when an editor's save changed it since, the change is worked out again on what is there now (up to 5 times), so a row saved in between is not lost. A Cookies form left open in the panel and saved later still writes the whole list it shows (Payload's document lock warns the second editor) |
| `loadCookieApproval({ payload, locale, req? })` | the approval list → `CookieApprovalList` (`pending`, `gone`) | | `loadCookieApproval({ payload, locale, req? })` | the approval list → `CookieApprovalList` (`pending`, `gone`) |
| `approveCookies({ payload, ids?, unknownCategory?, addToList?, req? })` | what **Approve and add** does → `CookieApprovalResult` | | `approveCookies({ payload, ids?, unknownCategory?, addToList?, req? })` | what **Approve and add** does → `CookieApprovalResult` |
| `countPendingCookies(payload)`, `PENDING_WHERE` | how many wait / the query for them (drafts, and accepted cookies marked changed) | | `countPendingCookies(payload)`, `PENDING_WHERE` | how many wait / the query for them (drafts, and accepted cookies marked changed) |
+2 -1
View File
@@ -45,7 +45,8 @@ they will have to log in again.
### Email — nothing in env ### Email — nothing in env
Mail needs **no variable**. A site with no SMTP server in the panel sends through the Intecion mail service Mail needs **no variable**. A site sends through the Intecion mail service unless an admin chose another
"Sending method" in the panel
([email.md](./email.md)); SMTP is typed in the panel. What the deploy needs for the mail service: ([email.md](./email.md)); SMTP is typed in the panel. What the deploy needs for the mail service:
- **`NEXT_PUBLIC_SERVER_URL` / `serverURL` = the public address the site answers on without a redirect** (the service - **`NEXT_PUBLIC_SERVER_URL` / `serverURL` = the public address the site answers on without a redirect** (the service
+17 -1
View File
@@ -245,7 +245,7 @@ import { i18nConfig } from '@/i18n.config'
export const proxy = createProxy(i18nConfig, { NextResponse, markdown: true }) export const proxy = createProxy(i18nConfig, { NextResponse, markdown: true })
// Inline literal — Next analyzes it statically; importing a variable = proxy on /admin → 500 // Inline literal — Next analyzes it statically; importing a variable = proxy on /admin → 500
export const config = { matcher: ['/((?!api|admin|_next|.*\\..*).*)'] } export const config = { matcher: ['/((?!(?:api|admin|_next)(?:/|$)|.*\\..*).*)'] }
``` ```
Sets `x-locale` / `x-pathname`, the language cookie with consent, redirects `/`. Sets `x-locale` / `x-pathname`, the language cookie with consent, redirects `/`.
The headers are for dynamic routes (API, route handlers) — in SSG/ISR pages, The headers are for dynamic routes (API, route handlers) — in SSG/ISR pages,
@@ -686,6 +686,22 @@ Do one item at a time, build, check. Order by importance:
| 76 | **1.17.0 — public pages: Chrome requests the first page of a visit twice** — `curl -sI <site>/pl` shows `Critical-CH: Sec-CH-Prefers-Color-Scheme` (Payload's `withPayload` adds it for every path; only the admin reads the hint); Lighthouse lists the same URL twice under redirects | `next.config.ts`: `withSecurityConfig(withPayload(nextConfig))` — the plugin's wrapper OUTSIDE (was inside). Another panel address: `{ adminClientHints: { route } }`; keep the old behaviour: `{ adminClientHints: false }`. Without the edit nothing changes | `iapl-upgrade` "→ 1.17.0, the public pages' first request", security.md "Client hints" | | 76 | **1.17.0 — public pages: Chrome requests the first page of a visit twice** — `curl -sI <site>/pl` shows `Critical-CH: Sec-CH-Prefers-Color-Scheme` (Payload's `withPayload` adds it for every path; only the admin reads the hint); Lighthouse lists the same URL twice under redirects | `next.config.ts`: `withSecurityConfig(withPayload(nextConfig))` — the plugin's wrapper OUTSIDE (was inside). Another panel address: `{ adminClientHints: { route } }`; keep the old behaviour: `{ adminClientHints: false }`. Without the edit nothing changes | `iapl-upgrade` "→ 1.17.0, the public pages' first request", security.md "Client hints" |
| 77 | **1.17.0 — cookie banner at first paint** — the banner appeared seconds after the page (after hydration) and was the LCP element on text pages; or after the update an e2e test finds a hidden `[data-ipal="banner"]` for a returning visitor; or with a nonce CSP the console reports a refused inline script | Nothing to run: the banner is now in the server HTML and an inline script shows or hides it before the first paint; pages stay static; consent, tags and the log are unchanged. Remove a project "mounted" wrapper around the banner. Nonce CSP: `<SiteProviders nonce>`. Tailwind 3 with a `classNames.root` that sets `display`: `[data-ipal="banner"][hidden] { display: none !important }`. Old behaviour: `<CookieBanner firstPaint={false} />`; exact HTML on a dynamic site: `consentCookie` | `iapl-upgrade` "→ 1.17.0, cookie banner at first paint", consent.md "First paint" | | 77 | **1.17.0 — cookie banner at first paint** — the banner appeared seconds after the page (after hydration) and was the LCP element on text pages; or after the update an e2e test finds a hidden `[data-ipal="banner"]` for a returning visitor; or with a nonce CSP the console reports a refused inline script | Nothing to run: the banner is now in the server HTML and an inline script shows or hides it before the first paint; pages stay static; consent, tags and the log are unchanged. Remove a project "mounted" wrapper around the banner. Nonce CSP: `<SiteProviders nonce>`. Tailwind 3 with a `classNames.root` that sets `display`: `[data-ipal="banner"][hidden] { display: none !important }`. Old behaviour: `<CookieBanner firstPaint={false} />`; exact HTML on a dynamic site: `consentCookie` | `iapl-upgrade` "→ 1.17.0, cookie banner at first paint", consent.md "First paint" |
| 78 | **1.17.0 — consent compliance** — after the update "Reject" looks like "Accept all"; a browser with Global Privacy Control sees no banner; *Privacy → Consent records* fills with every choice; or on Postgres / SQLite the log says "the consent-records table does not exist" and doctor reports `consent-log-migration` | MongoDB: nothing to run. Postgres / SQLite without the log before: `pnpm payload migrate:create consent-log` + apply in the same deploy, or `iapl({ consentLog: false })`. `generate:types`. Opt-outs: `equalChoice={false}`, `gpc="ask"` / `gpc={false}`, `consentLog: false`, `logEndpoint={false}` | `iapl-upgrade` "→ 1.17.0, consent compliance", consent.md "Compliance defaults" | | 78 | **1.17.0 — consent compliance** — after the update "Reject" looks like "Accept all"; a browser with Global Privacy Control sees no banner; *Privacy → Consent records* fills with every choice; or on Postgres / SQLite the log says "the consent-records table does not exist" and doctor reports `consent-log-migration` | MongoDB: nothing to run. Postgres / SQLite without the log before: `pnpm payload migrate:create consent-log` + apply in the same deploy, or `iapl({ consentLog: false })`. `generate:types`. Opt-outs: `equalChoice={false}`, `gpc="ask"` / `gpc={false}`, `consentLog: false`, `logEndpoint={false}` | `iapl-upgrade` "→ 1.17.0, consent compliance", consent.md "Compliance defaults" |
| 79 | **1.17.1 — security** — the start stops with "`[iapl] … must be …`" naming an option; or `requireRole('…')` throws; or an admin's `where` on `smtpPassword` / `turnstileSecretKey` answers `400 QueryError` | Fix the named value (security.md "Switches are read strictly"); role names are `user`, `editor`, `admin`. The query refusal is the fix (write-only secrets cannot be named in a query). With versions on for Site integrations and a doubt about an admin account: change the SMTP password and the Turnstile key | CHANGELOG 1.17.1 "Read before upgrading" 1–2, `iapl-upgrade` "→ 1.17.1, security" |
| 80 | **1.17.1 — the sign-in look** — after the update the login and 2FA screens show a dark panel with the logo or the site's name; an editor cannot change the logo or name; forgot / reset password look as before | Nothing required. `whiteLabel: { signIn: false }` (old screens), `{ brandAccess: 'editor' }`, `{ signIn: { logoPlate: true } }` (a dark logo), `{ signIn: { svgLogo: false } }`; the other screens: `signIn: { allScreens: true }` + `pnpm payload generate:importmap`. No `serverURL` → no logo in the link preview: set it | `iapl-upgrade` "→ 1.17.1, the sign-in look", white-label.md "The sign-in screens" |
| 81 | **1.17.1 — proxy matcher** — `iapl-doctor` warns `proxy-matcher`; pages such as `/administracja` or `/apis` get no locale redirect or proxy CSP | `src/proxy.ts`: `matcher: ['/((?!(?:api|admin|_next)(?:/|$)|.*\\..*).*)']` (i18n.md "Next matcher") | `iapl-upgrade` "→ 1.17.1" |
| 82 | **1.17.1 — e-mail: "Sending method" is a choice** — Site integrations → E-mail sending shows "IWSN (built-in)", "Own SMTP server" or "Microsoft Graph (deprecated)" as selected; or, on Postgres / SQLite, the start log says the column for `emailMethod` is missing and the Site integrations page does not open; or mail fails with `smtp-incomplete` / `graph-not-set-up` | MongoDB: nothing. Postgres / SQLite: `pnpm payload migrate:create`, commit, apply at start. Nothing changes until another option is picked and saved; a chosen method that cannot be used fails loudly (no other transport): fill in SMTP, set `GRAPH_*`, or pick another method | `iapl-upgrade` "→ 1.17.1, e-mail", email.md "Which transport a send takes" |
| 83 | **1.18.0 — cookie button** — after the update the "cookie settings" button no longer sits above the footer; or the footer is about 40 px taller after a decision | Intended: the button stays in the bottom corner of the window on every page and never moves; while it is shown the footer gets just enough bottom padding for its last row to end above the button (measured; own padding counts; nothing before a decision or while the banner is open). Nothing to run. No room: `<CookieButton reserve={false} />`; amount by hand: `--ipal-cookie-button-space` on the footer; the placement before: `avoid={COOKIE_BUTTON_AVOID}`; other corner: `side="right"`; distance: `--ipal-cookie-button-offset` | consent.md "Where the cookie button sits", `iapl-upgrade` "→ 1.17.2, cookie button" |
| 84 | **1.18.0 — version history** — `GET /api/<collection>/versions` as a visitor answered 500 (`Cannot find field for path at _status`, MongoDB `reading 'type'`) with `readVersions: readPublished()` | Update; nothing else. New code: `readVersions: readPublishedVersions()`; a `readVersions` of your own that wraps `readPublished()` must use `readPublishedVersions()` inside | CHANGELOG 1.18.0 "From 1.17.2" point 1, access.md |
| 85 | **1.18.0 — sign-in and panel actions** — a locked editor is told "incorrect" with the right password; or a panel button (mail Connect / Disconnect, test e-mail, cookie scan / approval) answers 403 behind a proxy; or rate limits now count an IPv6 home network as one visitor | Locked: wait 10 minutes or an admin unlocks; Payload's text back: `accounts: { lockedAnswer: 'payload' }`. 403 behind a proxy: set `serverURL`; off: `adminSameOrigin: false`. IPv6 per address: `setIpv6Grouping({ prefix: 128 })` | CHANGELOG 1.18.0 "From 1.17.2" points 2, 3, 8; security.md |
| 86 | **1.18.0 — REST submissions and jobs** — a customer account gets 403 on `POST /api/form-submissions`; a cron gets 401 on `/api/payload-jobs/run` | Submissions: use `submitForm` / `createSubmitAction`, or `formSubmissionOverrides.access.create`. Jobs: `CRON_SECRET` (16+ characters) in the app's env and `Authorization: Bearer …` from the cron, or an admin's API key; `jobsRunAccess: false` = Payload's default | CHANGELOG 1.18.0 "From 1.17.2" points 4–5, `iapl-upgrade` "→ 1.18.0" |
| 87 | **1.18.0 — consent version** — saving Cookies with a lower "Consent version" is refused ("cannot go down") | Raise it or leave it; a script with the Local API and `overrideAccess` may lower it; `cookieSettings: { allowLowerPolicyVersion: true }` restores the old freedom | CHANGELOG 1.18.0 "From 1.17.2" point 7, consent.md |
| 88 | **1.18.0 — two-step set-up by e-mail** — a new editor scans the code and the screen says "a link was sent"; nothing opens until the link is clicked; or "the confirmation e-mail could not be sent" | Open the mailed link in the same browser within 30 minutes, then sign in with password and code. Mail not working: the link is in the server log (Coolify → Logs) or an administrator presses "Confirm the waiting set-up" on the account page; fix mail (`iapl-doctor --deep` → `2fa-enrolment-mail`). Off: `twoFactor: { confirmByEmail: false }` | CHANGELOG 1.18.0 "Two-step verification", security.md |
| 89 | **1.18.0 — staff sign-in** — `429` "Too many failed sign-ins to this address from here"; or `403` on login from another domain; or the account page asks for "Current password"; or a script that changes its own password gets 400 | 429: wait 15 minutes or sign in from elsewhere; pin `IAPL_IP_HEADER`. 403: `accounts.signInSameOrigin: { origins: [...] }` or set `serverURL`. Scripts: send `currentPassword`; off: `accounts.confirmOwnChanges: false` | CHANGELOG 1.18.0 "Staff sign-in", access.md |
| 90 | **1.18.0 — IWSN connect** — Site integrations → E-mail sending shows "Połącz z IWSN"; e-mails refused (`relay-pending`); dashboard alert; `iapl-doctor --deep` error `mail-relay-connect` | Press "Połącz z IWSN"; a person of Intecion confirms on the page that opens; the block then shows "Connected to IWSN". Off: `mail: { relay: { connectButton: false } }` | CHANGELOG 1.18.0 "IWSN", email.md |
| 91 | **1.18.0 — doctor fails** — `iapl-doctor` exits 1 on `perf-*`, `next-min` (16.4.5) or shows `transitive-min` for `ws` / `cross-spawn` / `esbuild` | Fix what the rule says (`[email protected]`, the overrides in AGENT.md §4 item 12, a budget test); or lower / silence a rule with a reason in `iapl-doctor.json` | CHANGELOG 1.18.0 "Speed and growth" 9, "Security audit" 8–9; doctor.md |
| 92 | **1.18.0 — lists, sort, locks, access callbacks** — a front-end script gets only 100 documents (`hasNextPage: true`); `?sort=$…` answers 400; a customer gets 403 on document locks; `cookieScanner.access` returning `req.user` now gives 403 | Page through, or `listLimit: { max }` / `{ exclude }`; sort by a field name; locks are staff only (`lockedDocuments`); return `Boolean(req.user)` (or `strictAccessAnswers: false`) | CHANGELOG 1.18.0 "Security audit", security.md "Lists and sorting", "Access callbacks" |
| 93 | **1.18.0 — drafts in menus and blocks** — a menu link or a block pointing at an unpublished page is gone from the site | Publish the page, or `createContentHelpers({ draftRelations: 'keep' })` | CHANGELOG 1.18.0 "Content and plugin writes", content.md |
| 94 | **1.18.0 — uploads and logs** — an uploaded photo has no EXIF / GPS any more; old consent records and statistics disappear on a quiet MongoDB site; a versioned plugin global keeps 20 versions | Intended. Keep metadata: `buildOptimizeUploadHook({ stripMetadata: false })`; no TTL: `consentLog: { ttlIndex: false }`, `stats: { ttlIndex: false }`; more versions: `max` / `maxPerDoc` in your override | CHANGELOG 1.18.0 "Speed and growth" 1–3, performance.md |
After updating the package: `pnpm exec iapl-skills` (new skill versions), `pnpm payload generate:importmap`, `rm -rf .next`, restart dev, grep for the new symbol in After updating the package: `pnpm exec iapl-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`. `node_modules/@intecion/ipal-kit/dist`.
+79
View File
@@ -0,0 +1,79 @@
# The panel's sign-in screens: design notes and screenshots
Design record of `whiteLabel.signIn` (the user-facing page is [white-label.md](../../white-label.md) → "The sign-in
screens"). The goal: IAPL's sign-in looks like IAWL's (the WordPress sibling), and both have a place for the client's
logo.
## Files here
Made with `node scripts/login-page-shots.mjs` (headless Chromium, 1280 × 800 and 390 × 844) against the reference
site; `after-*` from a production build with `signIn: { allScreens: true }`, `before-*` from main (1.17.0).
| Files | What |
|---|---|
| `before-*.png` | IAPL 1.17.0: login (light, dark, phone, Polish, wrong password), forgot password, 2FA code, 2FA setup; `-logo` = with a logo set |
| `after-*-name.png` | the new look with no logo set: the site's name |
| `after-*-logo.png` | the new look with a logo made for dark grounds (`placeholder-logo-for-dark.png`), no plate — the default |
| `after-{login,2fa-code}-*-logo-svg.png` | an SVG logo from Site settings (`placeholder-logo-for-dark.svg`) on a built site: shown on login and, inlined, on the 2FA code screen — as 1.17.0 showed it |
| `after-login-*-logo-dark-letters-no-plate.png` | a logo with dark letters (`placeholder-logo.png`) on the default: hard to read; such a site sets `logoPlate: true` |
| `after-first-user-*.png` | create first user on an empty database (no site name yet: the host is shown) |
| `legacy-unedited-*.png` | the reference site as it was at v1.16.7, **unedited**, built against this plugin: login has the look (through `AdminLogo`), forgot password and create first user are Payload's own until the project sets `allScreens` |
| `iawl-*.png` | IAWL's sign-in page, copied from its repository (`docs/reviews/white-label/`, made 2026-11-24; the languages are still a drop-down there). `iawl-current-sign-in.png` is the page as built now (`docs/reviews/rule-13/after-5-sign-in.png`) |
| `placeholder-logo*.png` | the placeholder logos (dark text; white text for `logoMadeFor: 'dark'`) |
Screens: `login-{light,dark,phone,phone-dark,pl}`, `login-error-{light,phone}`, `forgot-{light,dark,phone}`,
`2fa-code-{light,dark,phone}`, `2fa-setup-{light,dark,phone}`, `first-user-{light,dark,phone}` (needs a database
without users: `--only=first-user`). The files are 8-bit PNGs (re-encoded to keep the folder small).
## What defines IAWL's sign-in page (read from `plugin/assets/sign-in/sign-in.css`, `SignInLook.php`, `Logo.php`, `LanguageSwitcher.php`)
- **Layout:** two columns, 5 : 6. Left: a dark panel (`#060606`) inset 10 px from the window's edge, 20 px corners,
a faint grid (3.5 × 2.5 rem cells, 4 % white lines) and two blue glows (`rgb(0 158 246)`, 22–24 %). Right: a white
page with the form, 28 rem wide, centred in its column. No card around the form.
- **On the panel**, at the bottom: a label "ADMINISTRATION PANEL" (mono, 14 px, 600, upper case, 0.05 em tracking,
`#b2b2b2`, a 5 px blue square before it), then the logo on a white plate (12 px corners, 16 × 20 px padding; the
logo fits 240 × 72) or the site's name as text (weight 500, −0.03 em, clamp 36–60 px). Both link to the site.
- **Form:** labels above fields, 48 px fields with a 1 px `#80868f` border and 6 px corners, a full-width 50 px blue
button (`#0070c0`, hover `#005a9e`, white text), links `#006bb8` underlined, focus ring 2 px `#017bd0`.
- **Under the form:** links (lost password, back to the site), the languages as links, a hairline, and the credit
"Technology support: Intecion.com" (13 px, muted, centred).
- **Messages:** boxes above the form with a 4 px bar on the leading edge: red for errors, green for success.
- **Phone (≤ 52 rem):** the panel is a band above the form, bottom corners rounded, the logo 192 × 56.
- **Theme:** none: the panel is always dark, the form always light. **Fonts:** Outfit / Inter / Roboto Mono from
local files, part of the credit (off with `credit => false`). **Script:** one optional file, the grid light that
follows the mouse.
- **States:** WordPress's own (errors, lost password, reset with the strength meter, logged out, interim frame);
IAWL changes the look only.
## How IAPL maps it
| Element | IAPL | Same as IAWL? |
|---|---|---|
| Split, panel inset and corners, grid, glows, colours | the same numbers (`css.ts`) | yes |
| Label, logo box (240 × 72, 2× source), name as text, link to the site, alternative text | the same | yes |
| Logo types and the look at the file before printing | **as IAPL's white label did in 1.17.0** (owner, 2026-11-26): any picture Site settings holds, an SVG too, as `<img>`; `svgLogo: false` refuses SVG. The file is asked once only to avoid a broken picture (gone / no picture → the name) | IAWL: JPEG, PNG, WebP, AVIF, GIF, no SVG (WordPress refuses the upload); file read from disk |
| Plate | **no plate by default** (the owner's choice for new surfaces), `logoPlate: true` adds it | IAWL: plate by default, `logoMadeFor => 'dark'` removes it |
| Button, link, focus and border colours; field and button heights; 28 rem column | the same | yes |
| Phone band at 52 rem | the same | yes |
| Languages | links, **on the panel** (top corner; under the brand on a phone), because the form's markup is Payload's and differs per screen | place differs |
| Credit line | under the login form, hairline above (login only, as before) | IAWL: every screen |
| Dark theme | the form's side follows the admin theme; the panel stays dark | IAWL has no dark form |
| Fonts | the admin's own font stack and the system's mono; no font file | differs (no extra request before sign-in) |
| Grid light (script) | not built: no script on the sign-in page | differs |
| Messages | Payload's own toasts and field errors, unchanged | differs |
| Field look | Payload's fields with the shared border colour and height | close |
## Decisions
1. **Carried by components every site already has.** A new admin component needs a new import-map entry, and a
provider missing from the map blanks the whole panel. So `AdminLogo` prints the panel on the login screen and
`SafeTotpView` in front of the 2FA screens; only `allScreens` adds a provider (`SignInLook`), guarded at start.
2. **The panel is one self-contained element**, fixed on a desktop and in the flow on a phone, hidden by its own
CSS off the minimal template. It therefore works wherever it is printed (inside the login form's wrapper, before
a 2FA view, at the top of the body).
3. **No new stored data.** Logo and name are Site settings fields that exist since 1.0 — the ones the public site
reads — so every part of the site shows the same logo and there is no migration. The plate switch (`logoPlate`)
and the accent are code options; putting them in the panel would add columns on SQL.
4. **Payload draws its admin screens in the browser** (the server's HTML body is empty until React runs), so "no
flash" means: the panel, its stylesheet and the form appear in the same step. The e2e spec checks that the
form's template is never in the page without them.
Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Some files were not shown because too many files have changed in this diff Show More