CLOSED messages for relays that want to reject REQs and NIP-42 AUTH integration (#902)

Co-authored-by: monlovesmango <96307647+monlovesmango@users.noreply.github.com>
This commit is contained in:
fiatjaf_
2023-12-06 12:01:27 -03:00
committed by GitHub
parent c07f0eab1a
commit 2bd4bf7841
4 changed files with 65 additions and 28 deletions

11
45.md
View File

@@ -27,7 +27,9 @@ In case a relay uses probabilistic counts, it MAY indicate it in the response wi
["COUNT", <subscription_id>, {"count": <integer>}]
```
## Examples:
Whenever the relay decides to refuse to fulfill the `COUNT` request, it MUST return a `CLOSED` message.
## Examples
### Followers count
@@ -49,3 +51,10 @@ In case a relay uses probabilistic counts, it MAY indicate it in the response wi
["COUNT", <subscription_id>, {"kinds": [1]}]
["COUNT", <subscription_id>, {"count": 93412452, "approximate": true}]
```
### Relay refuses to count
```
["COUNT", <subscription_id>, {"kinds": [4], "authors": [<pubkey>], "#p": [<pubkey>]}]
["CLOSED", <subscription_id>, "auth-required: cannot count other people's DMs"]
```