reformat a bunch of json things and small nitpicks.

This commit is contained in:
fiatjaf
2023-11-18 09:13:12 -03:00
parent b0df71824f
commit 5dcfe85306
21 changed files with 385 additions and 365 deletions

14
42.md
View File

@@ -24,13 +24,13 @@ A relay may want to require clients to authenticate to access restricted resourc
This NIP defines a new message, `AUTH`, which relays can send when they support authentication and clients can send to relays when they want
to authenticate. When sent by relays, the message is of the following form:
```
```json
["AUTH", <challenge-string>]
```
And, when sent by clients, of the following form:
```
```json
["AUTH", <signed-event-json>]
```
@@ -41,16 +41,12 @@ Relays MUST exclude `kind: 22242` events from being broadcasted to any client.
```json
{
"id": "...",
"pubkey": "...",
"created_at": 1669695536,
"kind": 22242,
"tags": [
["relay", "wss://relay.example.com/"],
["challenge", "challengestringhere"]
],
"content": "",
"sig": "..."
...
}
```
@@ -67,13 +63,13 @@ is expected to last for the duration of the WebSocket connection.
Upon receiving a message from an unauthenticated user it can't fulfill without authentication, a relay may choose to notify the client. For
that it can use a `NOTICE` or `OK` message with a standard prefix `"restricted: "` that is readable both by humans and machines, for example:
```
```json
["NOTICE", "restricted: we can't serve DMs to unauthenticated users, does your client implement NIP-42?"]
```
or it can return an `OK` message noting the reason an event was not written using the same prefix:
```
```json
["OK", <event-id>, false, "restricted: we do not accept events from unauthenticated users, please sign up at https://example.com/"]
```