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:
co-authored by
Claude Fable 5.2
parent
a2b07b1dc1
commit
fef2c51bae
@@ -8,7 +8,8 @@
|
||||
"method": "POST",
|
||||
"path": "/v1/revoke",
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}"
|
||||
"authorization": "Bearer {{token}}",
|
||||
"x-intecion-site": "{{host}}"
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
"method": "POST",
|
||||
"path": "/v1/rotate",
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}"
|
||||
"authorization": "Bearer {{token}}",
|
||||
"x-intecion-site": "{{host}}"
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
"method": "POST",
|
||||
"path": "/v1/rotate",
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}"
|
||||
"authorization": "Bearer {{token}}",
|
||||
"x-intecion-site": "{{host}}"
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"headers": {
|
||||
"authorization": "bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"body": {
|
||||
"product": "iapl",
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json",
|
||||
"origin": "https://evil.example.net"
|
||||
"origin": "https://evil.example.net",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"body": {
|
||||
"product": "iapl",
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"body": {
|
||||
"product": "iapl",
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"id": "send-host-mismatch",
|
||||
"title": "A token used by a site that names another host (a copy of the site's database, a token pasted into the wrong site) is refused",
|
||||
"given": {
|
||||
"site": "active"
|
||||
},
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"path": "/v1/send",
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "copy-of-{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
"product": "iapl",
|
||||
"productVersion": "1.17.0",
|
||||
"kind": "form-notification",
|
||||
"to": [
|
||||
"{{recipient}}"
|
||||
],
|
||||
"replyTo": "[email protected]",
|
||||
"senderName": "Kancelaria Example",
|
||||
"subject": "New enquiry",
|
||||
"text": "Hello."
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": 403,
|
||||
"schema": "Error",
|
||||
"body": {
|
||||
"ok": false,
|
||||
"code": "host-mismatch",
|
||||
"retryable": false
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"mails": 0
|
||||
},
|
||||
"client": {
|
||||
"retry": false,
|
||||
"reEnrol": true,
|
||||
"status": null
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "text/plain"
|
||||
"content-type": "text/plain",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}",
|
||||
"idempotency-key": "{{idempotencyKey}}",
|
||||
"content-type": "application/json"
|
||||
"content-type": "application/json",
|
||||
"x-intecion-site": "{{host}}"
|
||||
},
|
||||
"schema": "SendRequest",
|
||||
"body": {
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
"method": "GET",
|
||||
"path": "/v1/status",
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}"
|
||||
"authorization": "Bearer {{token}}",
|
||||
"x-intecion-site": "{{host}}"
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"id": "status-no-site-header",
|
||||
"title": "Every request with a token names its site",
|
||||
"given": {
|
||||
"site": "active"
|
||||
},
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"path": "/v1/status",
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}"
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": 400,
|
||||
"schema": "Error",
|
||||
"body": {
|
||||
"ok": false,
|
||||
"code": "invalid-request",
|
||||
"field": "X-Intecion-Site"
|
||||
}
|
||||
},
|
||||
"client": {
|
||||
"retry": false,
|
||||
"reEnrol": false,
|
||||
"status": null
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,8 @@
|
||||
"method": "GET",
|
||||
"path": "/v1/status",
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}"
|
||||
"authorization": "Bearer {{token}}",
|
||||
"x-intecion-site": "{{host}}"
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
"method": "GET",
|
||||
"path": "/v1/status",
|
||||
"headers": {
|
||||
"authorization": "Bearer {{token}}"
|
||||
"authorization": "Bearer {{token}}",
|
||||
"x-intecion-site": "{{host}}"
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
|
||||
Reference in New Issue
Block a user