Files
ipal-kit/contracts/mail-relay/CHANGELOG.md
T
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

134 lines
8.7 KiB
Markdown

# 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)
Wording only; nothing for a client to change, and a copy of 1.7.0 need not be refreshed for it.
- **1.7.0 is required, not optional.** A client of 1.6 or older gets `400 invalid-request` on every request
that carries a token, because it does not send `X-Intecion-Site`. By the rule for development versions (§9)
it was numbered as a minor; read it as a breaking step. No client of 1.6 or older was released.
## 1.7.0 — 2026-11-25 (never released)
From the independent review of the first client. What a client built against 1.6.0 has to change is marked.
- **New, required: the header `X-Intecion-Site: <own host>` on every request that carries a token.** Missing:
`400 invalid-request`. Not the token's host: the new code **`403 host-mismatch`** (forget the token, enrol as
yourself). **Client: send the header; handle the code.** All examples with a token carry it; two new
examples (`send-host-mismatch`, `status-no-site-header`).
- **A client stores the host with the token and compares it with its own before use**, and compares the `host`
of `/v1/status` (§8, checklist 3). **Client: add the check.**
- **The confirm endpoint's limiter counts only refused calls**, after the nonce was looked up; never by the
caller's address first (§2). **Client: check the order.**
## 1.6.0 — 2026-11-25 (never released)
From the first client built against the contract (IAPL's). **The service did not change**; these are the
contract's words. What a client built against 1.5.0 has to change is marked.
- **An answer that is not the service's JSON** is no longer "like `503 unavailable`" for the report: with a
status from 400 to 499 it is *not sent*, with any other status (200 included) *not confirmed*.
**Client: change the report for that case.** Retrying it is as before.
- **A client that cannot keep key and bytes** (§1): no retry by itself after the report; a repeat by a person
is a new message; keys derived from the message's record are described, and for such a key
`idempotency-conflict` means "already handled". **Client: nothing must change; derived keys are an option.**
- **A site with a hand-issued token** does not enrol on `reverify` / `invalid-token`; it reports
`relay-refused` and what to ask Intecion for. **Client: nothing, if it already does this.**
- **`Origin` / `Sec-Fetch-Site`:** a client sends neither; said in §1. **Client: nothing for Node.**
- A stand-in need not reproduce the service's lists; said in §10.
## 1.5.0 — 2026-11-25 (never released)
After the third review.
- `new-recipients`: `account` mail is outside it; a form's confirmations may use four fifths of it.
- Failed sends: those in flight are counted in.
- Wording: `backend-failed`, `internal` and unknown codes mean "probably not sent"; the checklist asks a client
to limit "forgot password" itself.
## 1.4.0 — 2026-11-25 (never released)
After the second review.
- **Limits by kind:** `security-alert` has a budget of its own (`limit: "alerts"`, `limits.securityAlertsPerDay`)
outside hour and day; `account` mail may use the whole hour and day, every other kind four fifths. The
`quota` of a send answer is for that kind. `recipient` counts `form-confirmation` messages only.
- **The idempotency promise is now what the service does:** a key whose message was handed to the mail back end
is never sent again within 24 hours; when the result was not recorded it answers `in-progress` until then.
- **Failed sends** have a limit of their own: `429 rate-limited` after 60 in an hour.
- **Retrying:** three attempts, 30 seconds each, ten seconds of waiting in all; an enrolment on the way does
not count.
- **Subject:** U+200D, U+200C and U+00AD are allowed; everything else as before, with the rule a client strips by.
- Any mail of a site to Intecion's own address gets `[host]` in front of its subject.
- The confirm address: no redirect is followed — the usual causes and what to do; `given.quota` gains
`hour-share-used`.
## 1.3.0 — 2026-11-25 (never released)
- **The confirm path is fixed per product** (owner, 2026-11-25): `iapl` → `/api/iapl/mail-relay/confirm`,
`iawl` → `/?rest_route=/iawl/v1/mail-relay/confirm`. **`callbackPath` is gone from the enrolment request**
(a request that carries it is refused). A site that serves its API elsewhere has its path set by Intecion.
- Suppression is account-wide and stays so (owner, 2026-11-25): said in the code table.
## 1.2.0 — 2026-11-25 (never released)
After the first independent review. The wire format is the same; the text now has one reading where it had two.
- **Retrying:** at most three attempts in ten seconds, and the ten seconds win over `retryAfter`; "no answer"
and `in-progress` are reported as *not confirmed*, never as *not sent*.
- **Idempotency:** "the same body" is the same bytes; a client encodes a message once.
- **The confirm endpoint:** exactly `200` and the JSON object, at most 1024 bytes, within 8 seconds; the site
keeps its earlier token until `/v1/enrol` answers 200.
- **An answer that is not JSON** is `unavailable`, retryable.
- `Authorization: Bearer` in any case.
- **Schema:** `code` and `warnings` are open strings (new ones are minor changes); `to` is required unless the
kind is `security-alert`; recipients' `maxItems` is the service's bound, the site's limit is in `/v1/status`;
base64 is padded to a multiple of four (said in words: a pattern for it overflows on large files); lengths are
in code points.
- **Changed behaviour:** the per-recipient limit refuses `form-confirmation` only; a subject may not start with
the service's name in brackets; a `security-alert` gets the site's host in front of its subject;
`attachment-refused` names the file in `field` (suggested status `relay-attachment-refused`);
invisible characters (all of Unicode category Cf) are refused in subject and file names.
- Added: `limits.serverAddresses` in `/v1/status`; what happens beyond it.
- Before the first release tag, versions are development versions (§9).
## 1.1.0 — 2026-11-25 (never released)
- **The base address is `https://webservices.intecion.net/mail`**: one host for Intecion's web services, this
one under the path `/mail`. Paths in the contract are relative to the base address, as before; a client that
kept the base address as one constant changes that constant and nothing else.
- Added: `service.name` in the answer of `/v1/status` ("Intecion Notifications Webservice").
- The service sends from `[email protected]` (owner, 2026-11-25).
Minor, by the contract's own rule (§9): an answer field was added. No copy of 1.0.0 was released; a client that
copied it during development copies the folder again.
## 1.0.0 — 2026-11-25 (never released)
First version: `/v1/enrol` with the call-back and its confirmation, `/v1/send`, `/v1/status`, `/v1/rotate`,
`/v1/revoke`, `/health`; the error codes; the examples and the runner.
Differs from the design proposal (draft 4) in one visible point: the site's confirm endpoint answers `200` with
a `confirmation` (SHA-256 of nonce and token), not a bare `204`. Reason: `services/mail-relay/DECISIONS.md`, D1.