diff options
| author | fiatjaf <fiatjaf@gmail.com> | 2023-11-18 09:13:12 -0300 |
|---|---|---|
| committer | fiatjaf <fiatjaf@gmail.com> | 2023-11-18 09:13:12 -0300 |
| commit | 5dcfe85306434f21ecb1e7a47edd92b2e3e64f9a (patch) | |
| tree | 4fff8694238b3ae5e692a8480869ad1266b95be4 /42.md | |
| parent | b0df71824f9967130b54150b64cc70fa94bffec2 (diff) | |
reformat a bunch of json things and small nitpicks.
Diffstat (limited to '42.md')
| -rw-r--r-- | 42.md | 14 |
1 files changed, 5 insertions, 9 deletions
| @@ -24,13 +24,13 @@ A relay may want to require clients to authenticate to access restricted resourc | |||
| 24 | This NIP defines a new message, `AUTH`, which relays can send when they support authentication and clients can send to relays when they want | 24 | This NIP defines a new message, `AUTH`, which relays can send when they support authentication and clients can send to relays when they want |
| 25 | to authenticate. When sent by relays, the message is of the following form: | 25 | to authenticate. When sent by relays, the message is of the following form: |
| 26 | 26 | ||
| 27 | ``` | 27 | ```json |
| 28 | ["AUTH", <challenge-string>] | 28 | ["AUTH", <challenge-string>] |
| 29 | ``` | 29 | ``` |
| 30 | 30 | ||
| 31 | And, when sent by clients, of the following form: | 31 | And, when sent by clients, of the following form: |
| 32 | 32 | ||
| 33 | ``` | 33 | ```json |
| 34 | ["AUTH", <signed-event-json>] | 34 | ["AUTH", <signed-event-json>] |
| 35 | ``` | 35 | ``` |
| 36 | 36 | ||
| @@ -41,16 +41,12 @@ Relays MUST exclude `kind: 22242` events from being broadcasted to any client. | |||
| 41 | 41 | ||
| 42 | ```json | 42 | ```json |
| 43 | { | 43 | { |
| 44 | "id": "...", | ||
| 45 | "pubkey": "...", | ||
| 46 | "created_at": 1669695536, | ||
| 47 | "kind": 22242, | 44 | "kind": 22242, |
| 48 | "tags": [ | 45 | "tags": [ |
| 49 | ["relay", "wss://relay.example.com/"], | 46 | ["relay", "wss://relay.example.com/"], |
| 50 | ["challenge", "challengestringhere"] | 47 | ["challenge", "challengestringhere"] |
| 51 | ], | 48 | ], |
| 52 | "content": "", | 49 | ... |
| 53 | "sig": "..." | ||
| 54 | } | 50 | } |
| 55 | ``` | 51 | ``` |
| 56 | 52 | ||
| @@ -67,13 +63,13 @@ is expected to last for the duration of the WebSocket connection. | |||
| 67 | Upon receiving a message from an unauthenticated user it can't fulfill without authentication, a relay may choose to notify the client. For | 63 | Upon receiving a message from an unauthenticated user it can't fulfill without authentication, a relay may choose to notify the client. For |
| 68 | that it can use a `NOTICE` or `OK` message with a standard prefix `"restricted: "` that is readable both by humans and machines, for example: | 64 | that it can use a `NOTICE` or `OK` message with a standard prefix `"restricted: "` that is readable both by humans and machines, for example: |
| 69 | 65 | ||
| 70 | ``` | 66 | ```json |
| 71 | ["NOTICE", "restricted: we can't serve DMs to unauthenticated users, does your client implement NIP-42?"] | 67 | ["NOTICE", "restricted: we can't serve DMs to unauthenticated users, does your client implement NIP-42?"] |
| 72 | ``` | 68 | ``` |
| 73 | 69 | ||
| 74 | or it can return an `OK` message noting the reason an event was not written using the same prefix: | 70 | or it can return an `OK` message noting the reason an event was not written using the same prefix: |
| 75 | 71 | ||
| 76 | ``` | 72 | ```json |
| 77 | ["OK", <event-id>, false, "restricted: we do not accept events from unauthenticated users, please sign up at https://example.com/"] | 73 | ["OK", <event-id>, false, "restricted: we do not accept events from unauthenticated users, please sign up at https://example.com/"] |
| 78 | ``` | 74 | ``` |
| 79 | 75 | ||