M1 review round 2: docs, agent guide, skills, changelog; the reference types without the removed field
Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
7002ebbfa6
commit
3e44863c98
+49
-34
@@ -15,8 +15,9 @@ once there are more than 20.
|
||||
> panel; a form with files is refused while Turnstile is misconfigured; a script that creates staff accounts
|
||||
> with a password under 12 characters fails; behind a proxy that hides the site's address and without
|
||||
> `serverURL` nobody can enter a 2FA code; a project's own staff collection without access rules gets rules;
|
||||
> changing the SMTP server in the panel asks for the password again. No import-map change. One new field
|
||||
> (`smtpRequireTls`): **Postgres / SQLite need a migration**, MongoDB nothing.
|
||||
> changing the SMTP server in the panel asks for the password again; a slug in `access.staffCollections` that
|
||||
> is not an auth collection stops the start. No import-map change, **no schema change and no migration** on any
|
||||
> database.
|
||||
|
||||
### Security
|
||||
- **Stored secrets are write-only.** `smtpPassword` and `turnstileSecretKey` (Site integrations) were returned
|
||||
@@ -27,11 +28,10 @@ once there are more than 20.
|
||||
([security.md](./security.md) "Stored secrets").
|
||||
- **The SMTP password stays with the server it was saved for.** Hiding the value was not enough: an admin
|
||||
session could point the SMTP server at a machine of its own and have a test e-mail deliver the password. A
|
||||
save in the panel or over the API that changes the server, the port, the user name or "Require encryption"
|
||||
(or switches the transport to SMTP) while a password is stored must now send the password again, or remove
|
||||
it (`secrets.reenterOnChange`). Server code with the Local API is not asked.
|
||||
- **"Require encryption" for SMTP** (`smtpRequireTls` in Site integrations → E-mail sending, off by default):
|
||||
with it the password is never sent over an unencrypted connection (a server without STARTTLS gets nothing).
|
||||
save in the panel or over the API that changes the server, the port or the user name while a password is
|
||||
stored must now send the password again, or remove it (`secrets.reenterOnChange`) — whatever the transport
|
||||
says (the mail adapter falls back to SMTP when Microsoft Graph is not configured). Server code with the Local
|
||||
API is not asked.
|
||||
- **Restoring a version of Site integrations** (only where a project turned versions on for that global)
|
||||
answered with the stored secrets; they are masked there too (`maskSecretsOnRestore`).
|
||||
- **Nobody creates an account for themselves, or takes one over.** (1) Payload's first-user route
|
||||
@@ -42,8 +42,11 @@ once there are more than 20.
|
||||
`delete` rules had Payload's default, "any logged-in user" — an account of any auth collection: a visitor
|
||||
account could create a staff account, or change a staff account's password and roles. Such a collection now
|
||||
gets rules for the operations it has none for: with the plugin's roles — an admin (update: or the account
|
||||
itself); with role values of its own, or none — an account of that same collection, or a plugin admin. The
|
||||
rules hold with 2FA on and off. Anonymous sign-up into the staff collection was already refused; the
|
||||
itself); with role values of its own, or none — an account of that same collection, or a plugin admin.
|
||||
`unlock` gets the admin rule and `read` "a staff account" (a visitor account could list the staff accounts
|
||||
and lift their login lock). An account never changes its **own** roles: the collection's `roles` field, when
|
||||
it has no field access of its own, is closed for that. The rules hold with 2FA on and off, and for a staff
|
||||
collection that a plugin listed after ipalKit adds. Anonymous sign-up into the staff collection was already refused; the
|
||||
plugin's injected collection already had these rules. No known site has a second staff collection
|
||||
([access.md](./access.md) "Account rules").
|
||||
- **2FA verify and setup attempts only from the site's own origin.** A page on another origin that the browser
|
||||
@@ -68,20 +71,23 @@ once there are more than 20.
|
||||
and logs a notice once per start. It will be removed in a later release, named here in advance.
|
||||
|
||||
### Added
|
||||
- Options: `accounts` (`panelRole`, `adminOnlyCreate`, `adminOnlyWrite`, `firstUserRoute`, `password`),
|
||||
`secrets.writeOnly`, `secrets.reenterOnChange`, `forms.turnstileOnConfigError`, `twoFactor.sameOrigin`,
|
||||
`twoFactor.verifyLimit.store`, `dashboardAlerts`. Panel: "Require encryption" (`smtpRequireTls`).
|
||||
- Options: `accounts` (`panelRole`, `adminOnlyCreate`, `adminOnlyWrite`, `staffOnlyRead`, `firstUserRoute`,
|
||||
`password`), `secrets.writeOnly`, `secrets.reenterOnChange`, `forms.turnstileOnConfigError`,
|
||||
`twoFactor.sameOrigin`, `twoFactor.verifyLimit.store`, `dashboardAlerts`.
|
||||
- ipal-doctor rules: `access-missing` (no `access` option: every panel account is an admin), `csrf-empty`
|
||||
(neither `serverURL` nor `csrf`), and with `--url`: `open-signup` (info), `staff-accounts-open` (error: a staff
|
||||
collection an account of another collection may write to), `turnstile-degraded` (warning, error after 24
|
||||
hours), `turnstile-env-key`. The deep status gained `openSignUp`, `staffOpenToOthers`, `turnstile`,
|
||||
(neither `serverURL` nor `csrf`), and with `--url`: `open-signup` (info), `staff-accounts-open` (error; warning
|
||||
for `read`: a staff collection an account of another collection may write to, read or unlock),
|
||||
`staff-own-roles` (warning: a staff collection with role values of its own and no rules), `turnstile-degraded`
|
||||
(warning, error after 24 hours), `turnstile-env-key`. The deep status gained `openSignUp`, `staffOnOwnRoles`,
|
||||
`staffOpenToOthers`, `turnstile`,
|
||||
`turnstileSecretFromEnv` (states and slugs, never a key).
|
||||
- Exports: `writeOnlySecret`, `writeOnlySecrets`, `SECRET_MASK`, `SECRET_CLEAR`, `maskSecretAfterRead`,
|
||||
`keepSecretBeforeValidate`, `buildKeepSecret`, `isSecretMask`, `INTEGRATION_SECRET_FIELDS`,
|
||||
`SMTP_PASSWORD_BOUND_TO`, `maskSecretsOnRestore`, `maskWriteOnlySecrets`; `panelAccess`, `applyPanelRole`,
|
||||
`resolvePanelRole`, `countBelowPanelRole`, `DEFAULT_PANEL_ROLE`; `staffCreateAccess`, `staffUpdateAccess`,
|
||||
`sameStaffCollectionAccess`, `hasPluginRoles`, `applyStaffAccountAccess`, `buildFirstUserEndpoint`,
|
||||
`applyFirstUserRoute`, `openSignUpCollections`, `staffCollectionsOpenToOthers`; `checkPassword`,
|
||||
`staffReadAccess`, `sameStaffCollectionAccess`, `rolesByAdminOnly`, `rolesNotOwn`, `hasPluginRoles`,
|
||||
`applyStaffAccountAccess`, `adoptLateAuthCollections`, `unknownStaffCollections`, `buildFirstUserEndpoint`,
|
||||
`applyFirstUserRoute`, `openSignUpCollections`, `staffCollectionsOpenToOthers`, `staffCollectionsOnOwnRoles`; `checkPassword`,
|
||||
`buildPasswordRuleHook`, `applyPasswordRule`, `resolvePasswordRule`, `DEFAULT_PASSWORD_MIN_LENGTH`;
|
||||
`requestFromOwnOrigin`, `ownOrigins`, `reportRefusedOrigin`; `buildVerifyLimit`, `verifyLimitKey`, `clearVerifyLimits`;
|
||||
`turnstileSecretFromEnv`, `TURNSTILE_SECRET_ENV`; from `/server`: `passTurnstile`, `passSubmitGates`,
|
||||
@@ -89,9 +95,14 @@ once there are more than 20.
|
||||
- `MaskedField` says "A value is set" for a write-only field and offers "Remove the stored value".
|
||||
|
||||
### Requires project changes
|
||||
- **Postgres / SQLite: a migration.** Site integrations has a new checkbox, `smtpRequireTls`:
|
||||
`pnpm payload migrate:create`, commit, deploy it with the code ([deployment.md](./deployment.md) §4.3). Without
|
||||
it the global cannot be read (no e-mail, no Turnstile check). MongoDB needs nothing.
|
||||
- **No migration.** This release adds no field, column, table or collection of its own on any database. The
|
||||
stored 2FA attempt count uses Payload's own `payload-kv` collection, which every schema of a Payload version
|
||||
that has `payload.kv` already contains; where it cannot be reached the count stays in memory and the limit
|
||||
still holds.
|
||||
- **A slug in `access.staffCollections` (or `access.authCollection`) that is not an auth collection of the
|
||||
config stops the start**: `[ipal] access names "…" as a staff collection, but this config has no auth
|
||||
collection with that slug`. Fix the slug. (A plugin listed after ipalKit may add the collection; it gets the
|
||||
account rules when the site starts.)
|
||||
- **Set `serverURL`** if it is not set. Behind a reverse proxy that rewrites `Host` and sends no
|
||||
`X-Forwarded-Host` (nginx's plain `proxy_pass`; Coolify / Traefik keep `Host`) the server does not know its
|
||||
own address, and the 2FA code page is refused as "another origin": **nobody can enter a code**. The log says
|
||||
@@ -110,13 +121,16 @@ once there are more than 20.
|
||||
`turnstile-env-key`).
|
||||
- **Forms with a File field:** make sure Turnstile works (`ipal-doctor --url` → no `turnstile-degraded`); while
|
||||
it does not, those forms are refused. To keep accepting them: `forms: { turnstileOnConfigError: { files: 'allow' } }`.
|
||||
- **A project's own staff collection without `create` / `update` / `delete` rules** gets them. With the plugin's
|
||||
roles (`access.authCollection`, or a `roles` select with only `user` / `editor` / `admin`): only an admin
|
||||
creates and deletes accounts, and an account is changed by an admin or by itself — if non-admins did that on
|
||||
your site, write the rule you want. With **role values of its own** (`superadmin`, …) or no roles: accounts
|
||||
of that collection keep working as before, accounts of other collections are refused — nothing to do, but the
|
||||
plugin does not know your roles, so write your own rules. Off: `accounts: { adminOnlyCreate: false,
|
||||
adminOnlyWrite: false }`. `first-register` for other auth collections: `403` unless the collection allows
|
||||
- **A project's own staff collection without `create` / `update` / `delete` / `unlock` / `read` rules** gets
|
||||
them. With the plugin's roles (`access.authCollection`, or a `roles` select with only `user` / `editor` /
|
||||
`admin`): only an admin creates, deletes and unlocks accounts and changes roles; an account is changed by an
|
||||
admin or by itself — if non-admins did that on your site, write the rule you want. With **role values of its
|
||||
own** (`superadmin`, …) or no roles: accounts of that collection keep working as before, except that an
|
||||
account no longer changes its **own** roles; accounts of other collections are refused. The plugin does not
|
||||
know your roles, so write your own rules (`ipal-doctor --url` → `staff-own-roles`). `read`: only staff
|
||||
accounts read a staff collection — **a front end that shows staff accounts to logged-in visitors** (an author
|
||||
box read with a customer's session) needs its own `read` rule or `accounts: { staffOnlyRead: false }`. Off:
|
||||
`accounts: { adminOnlyCreate: false, adminOnlyWrite: false, staffOnlyRead: false }`. `first-register` for other auth collections: `403` unless the collection allows
|
||||
sign-up, or `accounts: { firstUserRoute: 'all' }`.
|
||||
- **`access.firstUserAdmin: false`** with `access.defaultRole` below `editor`: the panel role is not applied (a
|
||||
warning at start); with `accounts.panelRole` set the start fails — set `access.defaultRole: 'editor'` or
|
||||
@@ -130,19 +144,20 @@ once there are more than 20.
|
||||
Existing accounts with short passwords keep logging in.
|
||||
- **A panel or front end on another domain that posts to `/api/verify-totp`:**
|
||||
`twoFactor: { …, sameOrigin: { origins: ['https://…'] } }`.
|
||||
- **Recommended, with the owner:** tick "Require encryption" in Site integrations → E-mail sending where the
|
||||
mail server supports STARTTLS (type the password again when asked), then send a test e-mail.
|
||||
- `pnpm payload generate:types`, `pnpm ipal:skills`.
|
||||
|
||||
### Known limitations
|
||||
- Write-only protects the API and the panel, not the database: the two secrets are stored in plain text there
|
||||
and in backups (encryption at rest is not part of this release). A secret equal to `********` or `[[clear]]`
|
||||
cannot be stored. A session that may send e-mail can still use the mailbox through the site (send, not
|
||||
read). "Require encryption" is off by default: until it is ticked, a server (or someone in between) that
|
||||
offers no STARTTLS on a port other than 465 gets the password in clear text, as before.
|
||||
- The account rules for a staff collection with role values of its own do not enforce those roles: inside the
|
||||
collection every account may create, change and delete accounts, as before. `read` is not touched: a staff
|
||||
collection of your own without a `read` rule is readable by any logged-in account (Payload's default).
|
||||
read). On a port other than 465 the SMTP connection is encrypted only when the server offers STARTTLS, as
|
||||
before; an option to require it is not part of this release.
|
||||
- The account rules for a staff collection with role values of its own do not enforce those roles: an account
|
||||
cannot change its own roles, but inside the collection every account may still create an account with any
|
||||
role, and change or delete another account — the plugin cannot rank roles it does not know. Write the
|
||||
collection's own rules; `staff-own-roles` in the doctor names such a collection.
|
||||
- An account of a staff collection **without a `roles` field** is an admin to the plugin (unchanged): it may
|
||||
manage accounts of the other staff collections too. Give every staff collection roles, or its own rules.
|
||||
- The panel role and the password rule need `access` (roles) resp. a staff collection with password login; a
|
||||
second staff collection without a `roles` field is not affected by `panelRole`.
|
||||
- The stored verify count uses Payload's `payload.kv`; on a Payload version without it the count is in memory
|
||||
|
||||
Reference in New Issue
Block a user