IAPL rename, scripted: preferred names in src, bin, scripts, services, tests; bin files and skill folders moved

Replaced by an explicit list of forms only (ten exported names, runtime env names, project file
names and marks, commands, skill names, the log prefix, the brand in prose). Package name, import
paths, routes, CSS tokens, data attributes, custom keys, context flags, the cookie and kv keys are
not touched. package.json keeps the five old bin names beside the five new ones.
The old names stop working in this commit and come back as aliases in the next; docs follow.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-25 17:24:21 +01:00
co-authored by Claude Fable 5.2
parent 414a4702df
commit 0a4f001797
262 changed files with 955 additions and 950 deletions
+14 -14
View File
@@ -3,14 +3,14 @@ import type { BasePayload, CollectionConfig, Config, GlobalConfig } from 'payloa
import { carryStaffRule } from '../../access/ruleMark.js'
/**
* ipal-kit's own second-factor check, next to the access wrapper of
* IAPL's own second-factor check, next to the access wrapper of
* @clocklimited/payload-2fa.
*
* Why it exists: the package wraps the `access` functions of the collections
* and globals that are in the config at the moment it runs. Whatever is added
* afterwards — ipal-kit's globals and collections, a plugin listed after
* ipalKit — was left unwrapped, so a staff password without the TOTP code
* opened it over the API. This check does not depend on that order: ipalKit
* afterwards — IAPL's globals and collections, a plugin listed after
* iapl — was left unwrapped, so a staff password without the TOTP code
* opened it over the API. This check does not depend on that order: iapl
* applies it to everything in the config when it finishes, and again in onInit
* to whatever other plugins added later; `userMeetsRole` asks it too.
*
@@ -19,7 +19,7 @@ import { carryStaffRule } from '../../access/ruleMark.js'
* 2. 2FA off or `twoFactor.guard: false` → there is no check (the project's choice);
* 3. an account of another auth collection → 2FA is about ONE collection; such an
* account is not staff unless the project names its collection in
* `access.staffCollections` (then it is staff WITHOUT a second factor — ipalKit
* `access.staffCollections` (then it is staff WITHOUT a second factor — iapl
* logs a warning at start);
* 4. `_strategy === 'totp'` → set by the package's strategy after password and code;
* 5. `_strategy === 'api-key'` → an API key is its own credential (the package's rule);
@@ -52,7 +52,7 @@ import { carryStaffRule } from '../../access/ruleMark.js'
* and its code. The package alone only redirects such an account in the panel.
*/
/** What ipalKit records in `config.custom.ipal.twoFactor` when 2FA is on and the guard is not switched off. */
/** What iapl records in `config.custom.ipal.twoFactor` when 2FA is on and the guard is not switched off. */
export type TwoFactorGuardConfig = {
collection: string
/** The project's exemption for accounts that never set TOTP up (a service account logging in with a password). */
@@ -169,8 +169,8 @@ type ConfigCustom = { totp?: { pluginOptions?: { disableAccessWrapper?: boolean
* Per-entity opt-out, operation by operation — the project's decision that
* this collection or global may be reached with the password alone:
* - the 2FA package's own key: `custom.totp.disableAccessWrapper.<operation>: true`
* (the package leaves that operation unwrapped; so does ipal-kit);
* - ipal-kit's key, for entities the package never sees (added after it ran):
* (the package leaves that operation unwrapped; so does IAPL);
* - IAPL's key, for entities the package never sees (added after it ran):
* `custom.ipal.secondFactor: false` (every operation) or `{ <operation>: false }`.
*/
function optedOut(entity: GuardedEntity, operation: string): boolean {
@@ -183,7 +183,7 @@ function optedOut(entity: GuardedEntity, operation: string): boolean {
}
/**
* Before the 2FA package runs: ipal-kit's opt-out written in the package's own
* Before the 2FA package runs: IAPL's opt-out written in the package's own
* key as well, so the package leaves those operations unwrapped too.
*/
export function passOptOutsToPackage(config: Config): Config {
@@ -255,7 +255,7 @@ export function guardConfigAccess(config: Config): Config {
}
/**
* The same for a running Payload, in place: what plugins listed after ipalKit
* The same for a running Payload, in place: what plugins listed after iapl
* added, and what Payload itself adds when it sanitizes the config. Returns
* the slugs it had to guard.
*
@@ -309,7 +309,7 @@ export function ensurePayloadGuarded(payload: Pick<BasePayload, 'config'>): null
* onInit) `onConfig` is called — before any request or Local API call can use
* the new config. Without it the first HTTP request would do the same (the
* guard strategy), but a Local API call made before that request would meet
* unguarded entities from plugins listed after ipalKit. Never throws.
* unguarded entities from plugins listed after iapl. Never throws.
*/
export function watchPayloadConfig(payload: BasePayload, onConfig: (payload: BasePayload) => void): void {
try {
@@ -334,13 +334,13 @@ export function watchPayloadConfig(payload: BasePayload, onConfig: (payload: Bas
}
}
/** Name of the auth strategy ipalKit adds to the 2FA collection (see buildGuardStrategy). */
/** Name of the auth strategy iapl adds to the 2FA collection (see buildGuardStrategy). */
export const GUARD_STRATEGY_NAME = 'ipal-second-factor-guard'
/**
* An auth strategy that authenticates nobody. Payload runs every strategy at
* the start of every request, before any access function, so this is the one
* place ipal-kit is called on each request with the config that is live right
* place IAPL is called on each request with the config that is live right
* now. It makes sure that config is guarded — also after a dev hot reload,
* where Payload swaps in a freshly built config and does not run onInit, and
* when Payload was started with `disableOnInit`.
@@ -443,7 +443,7 @@ export function guardNewEntityEndpoints<T extends { endpoints?: unknown; slug: s
* after the injected factory ran. A missing part means a version this guard
* was not written for: it would refuse every staff request, or — worse — the
* package itself may no longer protect what it used to. Returns what is
* missing; ipalKit refuses to start with it.
* missing; iapl refuses to start with it.
*/
export function missingTotpParts(config: Config, collection: string): string[] {
const target = (config.collections ?? []).find((c) => c.slug === collection)