From 414a4702dfae5212a95255bd0df00aaddd4100a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Smoli=C5=84ski?= Date: Wed, 25 Nov 2026 17:21:53 +0100 Subject: [PATCH] Rename plan: the owner's answers, and the second cookie name and kv prefix for new sites Co-Authored-By: Claude Fable 5.2 --- docs/dev/rename-iapl-plan.md | 73 +++++++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/docs/dev/rename-iapl-plan.md b/docs/dev/rename-iapl-plan.md index 61a39a6..465aa9f 100644 --- a/docs/dev/rename-iapl-plan.md +++ b/docs/dev/rename-iapl-plan.md @@ -1,6 +1,7 @@ # Rename ipal-kit to IAPL — plan for 1.17.0 -Status: **plan only**, written 2026-11-25 on top of main `619a4e0`. Nothing is renamed by this document. +Status: written 2026-11-25 on top of main `619a4e0` as a plan; **the owner answered the same day (§7) and the +work is carried out on branch `claude/iapl-rename-1170`**. Where §7 or §8 differ from §3 to §5, §7 and §8 hold. Owner's words (2026-11-25): the name changes from ipal-kit to IAPL now, and 1.17.0 is released after it. Constraints this plan works inside: @@ -271,6 +272,9 @@ A side effect worth having: `ipal` and `iapl` differ by two swapped letters, so ### 3.5 Stays for good, or needs its own decision +> Superseded in part by the owner's answer: new sites use `iapl_vid` and `iapl:2fa-verify:*`; existing sites +> keep the names below. Design in §8. + - **Cookie `ipal_vid`: keep, also in 2.0.** Renaming it changes every site's cookie list and approved policy (re-approval and, with a policy version bump, a new consent prompt for every visitor) and resets visitor counts. It is an opaque technical name; the cookie table explains its purpose. @@ -408,3 +412,70 @@ either library's name; they already are. - **Panel texts that show the name to clients**: the translation files themselves contain no `ipal`; the name appears in component messages, not counted separately from other `src` text. - **The date of 2.0**, which decides how long the old names live. + +## 7. The owner's answers (2026-11-25) + +Relayed by the coordinating session, in the owner's words. + +| Point | Answer | Effect | +| --- | --- | --- | +| Q2 meaning: "Intecion Advanced Payload Library" | "dokładnie tak" | used in the description and docs | +| Q3, Q4 package name | "póki co możemy zostawić nazwe paczki" | stays `@intecion/ipal-kit`; no double publish, no re-export package | +| Q1 spelling | "tak" | prose IAPL; code, commands, routes `iapl`; types `Iapl…`; env `IAPL_…`; `iapl()` | +| §3.3 new names beside the old | "tak" | as planned | +| §3.5 cookie and kv keys | "ipal_vid i ipal:2fa-verify:* powinny miec tez w takim razie drugi klucz stosowany w nowych stronach tylko" | a second name, used on new sites only: §8 | +| Q7 `legacy-names` rule | "ok" | info now, warning in the last 1.x minor, never a runtime warning | +| Q8 past changelog entries untouched | "tak" | | +| Q9 what 2.0 removes | "tak" | | +| Order and the v1.16.7 reference check in the gate | "ok" | | +| Q5 repository and folder | superseded: a new repository, IWDL, exists; ipal-kit and IAWL move into it with IAPL 2.0 at the beginning of 2027 | no Gitea or folder rename now; `repository` in `package.json` unchanged | +| Q6 routes, and §3.4 (import paths, import map, `--ipal-*`, `data-ipal`, `custom.ipal`) | no answer | the recommendation stands: unchanged | + +Mail service facts that touch §4.4: the service is the "Intecion Notifications Webservice" at +`https://webservices.intecion.net/mail`; its call-back path is pinned per product in the service's contract +(repository IWDL, `contracts/mail-relay/`). The relay route is **not** created by the rename; the adapter +session creates it from that contract. + +## 8. A second cookie name and kv prefix for new sites + +Two stored names get a new spelling that only new sites use: the visitor cookie (`iapl_vid`) and the 2FA +attempt counter (`iapl:2fa-verify::`). + +### 8.1 How a site is told to be "new" + +| | A. An explicit option the starter sets | B. Write the new name, read both | +| --- | --- | --- | +| Existing site after upgrade | nothing changes: same cookie, same cookie list, same counter key | every visitor with analytics consent gets `iapl_vid` (copied from `ipal_vid`); the old cookie is either left (two cookies) or deleted (one cookie under a name the approved cookie list does not have) | +| Cookie declaration on an existing site | unchanged | **changes**: a new row to approve, and with a policy version bump a new consent prompt | +| Visitor ids and history | kept | kept, if the copy is right | +| 2FA counter | one key per site, ever | no flag needed, but during a rolling deploy an old instance counts under the old key only and cannot see the new one: for that overlap an account can get up to twice the attempts | +| Needs | one option, written by the starter | no flag | + +**Chosen: A for both.** B changes what an existing site's visitors and its cookie declaration show, which +this release must not do, and B's limiter has a window in which two keys double the allowance. With A a +site has exactly one cookie name and one counter key for its whole life, so nothing is reset, copied or +counted twice. + +### 8.2 Shape + +- Plugin option **`storageNames: 'ipal' | 'iapl'`**, default `'ipal'`. The starter writes + `storageNames: 'iapl'` into a new site's config. It decides + - the 2FA counter key: `ipal:2fa-verify:…` or `iapl:2fa-verify:…` (`verifyLimitKey` gains the prefix as an + optional third argument; `verifyLimit: { keyPrefix }` overrides it for a project that wants its own); + - the visitor cookie name in the cookie scanner's built-in declaration (the row the scanner proposes for + the cookie list): `ipal_vid` or `iapl_vid`. +- ``: the component is a client component mounted by the project, so the + name is a prop; default `ipal_vid`. Exported constants: `VISITOR_COOKIE` (`'ipal_vid'`, unchanged) and + `IAPL_VISITOR_COOKIE` (`'iapl_vid'`). The starter's layout passes the new one. +- Withdrawal of consent: the default list of analytics cookies to delete (`DEFAULT_COOKIE_MAP`) names both, + so the cookie is removed whichever a site uses. Deleting a cookie that does not exist shows nothing. +- The scanner's database of known cookies knows both names, so a scan of either kind of site recognises its + own cookie as "statistics, first party". +- Consent texts name no cookie themselves (the table is built from the site's cookie list), so they need no + change. +- The doctor reports a site whose config says `'iapl'` while its layout mounts `PageStats` without + `visitorCookie` (and the reverse): the declared name and the set name would differ. +- **Not a switch to flip on a live site.** Changing `storageNames` later starts new visitor ids, needs the + cookie list approved again and starts the 2FA counters from zero once. The docs say so; `iapl-upgrade` does + not suggest it. +- The server's hit endpoint takes the id from the request body, not from the cookie, so it needs no name.