upleb.uk

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

summaryrefslogtreecommitdiff
path: root/42.md
diff options
context:
space:
mode:
authorfiatjaf <fiatjaf@gmail.com>2023-01-04 10:24:37 -0300
committerfiatjaf <fiatjaf@gmail.com>2023-01-04 10:24:37 -0300
commit50faceef0965042714e7f50a45b102f35c5231ca (patch)
tree0aded45604ddf8888e9500197c7aa899ac698a6b /42.md
parent4a5202646a86ce63a85a50b560d1a2fbce277df6 (diff)
clarify `created_at` and auth session duration.
Diffstat (limited to '42.md')
-rw-r--r--42.md9
1 files changed, 5 insertions, 4 deletions
diff --git a/42.md b/42.md
index b17aa14..4c884a9 100644
--- a/42.md
+++ b/42.md
@@ -43,7 +43,8 @@ WebSocket URL of the relay. `created_at` should be the current time. Example:
43``` 43```
44 44
45The client may send an auth message right before performing an action for which it knows authentication will be required -- for example, right 45The client may send an auth message right before performing an action for which it knows authentication will be required -- for example, right
46before requesting `kind: 4` chat messages --, or it may do right on connection start or at some other moment it deems best. 46before requesting `kind: 4` chat messages --, or it may do right on connection start or at some other moment it deems best. The authentication
47is expected to last for the duration of the WebSocket connection.
47 48
48Upon receiving a message from an unauthenticated user it can't fulfill without authentication, a relay may choose to notify the client. For 49Upon receiving a message from an unauthenticated user it can't fulfill without authentication, a relay may choose to notify the client. For
49that it can use a `NOTICE` message with a standard prefix `"restricted: "` that is readable both by humans and machines, for example: 50that it can use a `NOTICE` message with a standard prefix `"restricted: "` that is readable both by humans and machines, for example:
@@ -62,7 +63,7 @@ or it can return an `OK` message noting the reason an event was not written usin
62 63
63To verify `AUTH` messages, relays must ensure: 64To verify `AUTH` messages, relays must ensure:
64 65
65 - that the `kind` is `22242` 66 - that the `kind` is `22242`;
66 - that the event was recently signed (~10 minutes, by `created_at`) 67 - that the event `created_at` is close (e.g. within ~10 minutes) of the current time;
67 - that the `content` field matches the relay URL 68 - that the `content` field matches the relay URL:
68 - URL normalization techniques can be applied. For most cases just checking if the domain name is correct should be enough. 69 - URL normalization techniques can be applied. For most cases just checking if the domain name is correct should be enough.