upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKieran <kieran@harkin.me>2023-04-24 10:56:04 +0100
committerKieran <kieran@harkin.me>2023-05-08 12:22:53 +0100
commit2d31ddd38a133584a2eea58fdbe106452999cce3 (patch)
treee936575ee709ba5d7eefcde4f68d912d0ac6ff2b
parent29f26e72b5fd4e918c8d0d9f9d9ae384f7052a0a (diff)
add note about payload hash
-rw-r--r--98.md10
1 files changed, 7 insertions, 3 deletions
diff --git a/98.md b/98.md
index 48d079e..3a8ffdf 100644
--- a/98.md
+++ b/98.md
@@ -18,8 +18,8 @@ The `content` SHOULD be empty.
18 18
19The following tags are defined as REQUIRED. 19The following tags are defined as REQUIRED.
20 20
21* `url` - absolute URL 21* `u` - absolute URL
22* `method` - HTTP Request Method 22* `method` - HTTP Request Method
23 23
24Example event: 24Example event:
25```json 25```json
@@ -31,7 +31,7 @@ Example event:
31 "created_at": 1682327852, 31 "created_at": 1682327852,
32 "tags": [ 32 "tags": [
33 [ 33 [
34 "url", 34 "u",
35 "https://api.snort.social/api/v1/n5sp/list" 35 "https://api.snort.social/api/v1/n5sp/list"
36 ], 36 ],
37 [ 37 [
@@ -49,6 +49,10 @@ Servers MUST perform the following checks in order to validate the event:
493. The `url` tag MUST be exactly the same as the absolute request URL (including query parameters). 493. The `url` tag MUST be exactly the same as the absolute request URL (including query parameters).
504. The `method` tag MUST be the same HTTP method used for the requested resource. 504. The `method` tag MUST be the same HTTP method used for the requested resource.
51 51
52When the request contains a body (as in POST/PUT/PATCH methods) clients SHOULD include a SHA256 hash of the request body in a `payload` tag as hex (`["payload", "<sha256-hex>"]`), servers MAY check this to validate that the requested payload is authorized.
53
54If one of the checks was to fail the server SHOULD respond with a 401 Unauthorized response code.
55
52All other checks which server MAY do are OPTIONAL, and implementation specific. 56All other checks which server MAY do are OPTIONAL, and implementation specific.
53 57
54## Request Flow 58## Request Flow