Mail relay: contract 1.6.0, the token tied to its host, IWSN in the panel

- contracts/mail-relay refreshed from IWDL 83af8c6 (1.6.0)
- an answer that is not the service's JSON is 'not confirmed' unless its status is 400 to 499
- a site with a token issued by hand does not enrol to heal: it stops and says what to ask Intecion for
- a store made on another host (a database copied to staging) is not used: the copy enrols as itself, nothing is revoked
- the panel calls the service IWSN (RELAY_SHORT_NAME); docs, logs and the doctor keep the full name

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-25 21:51:47 +01:00
co-authored by Claude Fable 5.2
parent 7d766b6d58
commit 0ee74ab2a4
36 changed files with 380 additions and 128 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ import { type RelayAnswer, type RelayRefusal, relayRequest } from './client.js'
import { RELAY_DEFAULTS, type RelayStatusCode, relayStatusFor } from './constants.js'
import { currentMailKind, type MailKind, mailKindOf, takeExpectedMail } from './kinds.js'
import { bareAddresses, buildRelayMessage, type RelaySendRequest } from './message.js'
import { LOCAL_CODES, refreshRelayStatus, rotateRelayToken, type TokenUse, withRelayToken } from './session.js'
import { LOCAL_CODES, readSiteStore, refreshRelayStatus, rotateRelayToken, type TokenUse, withRelayToken } from './session.js'
import { readRelayStore, sha256Hex, updateRelayStore } from './store.js'
export type RelaySendResult =
@@ -144,7 +144,7 @@ export async function sendThroughRelay(payload: BasePayload, options: ResolvedRe
}
}
const stored = await readRelayStore(payload)
const stored = await readSiteStore(payload, options)
const limits = stored.service && Date.now() - Date.parse(stored.service.fetchedAt) < RELAY_DEFAULTS.statusTtlMs ? stored.service.limits : undefined
if (limits) {
// What the service said within the last hour: no need to upload 10 MB to hear it again.