Mail relay: contract 1.7.0 — X-Intecion-Site on every request with a token, host-mismatch

contracts/mail-relay refreshed from IWDL 6cd99f7 (64 files). A token the service knows as another
site's is forgotten without revoking and the site enrols as itself; a hand-issued one is refused.
The fake requires the header and answers host-mismatch.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-25 22:13:58 +01:00
co-authored by Claude Fable 5.2
parent a2b07b1dc1
commit fef2c51bae
60 changed files with 326 additions and 118 deletions
+1 -1
View File
@@ -228,7 +228,7 @@ describe('the state routes are for admins', () => {
expect(refused.status).toBe(400)
expect(await refused.text()).not.toContain('ims_')
expect((await readRelayStore(payload)).token).toBeUndefined()
expect((await fake.handle(new Request(`${fake.url}/v1/status`, { headers: { authorization: `Bearer ${foreign}` } }))).status).toBe(200)
expect((await fake.handle(new Request(`${fake.url}/v1/status`, { headers: { authorization: `Bearer ${foreign}`, 'x-intecion-site': 'other-client.example.org' } }))).status).toBe(200)
// a token issued by hand for THIS host is taken, and the state says where it came from
const own = await post('/iapl/mail-relay/connect', admin, { token: fake.issueToken(HOST) })
expect(await own.json()).toMatchObject({ ok: true, relay: { connected: true, tokenSource: 'manual' } })