-
Notifications
You must be signed in to change notification settings - Fork 586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLOSED
messages for relays that want to reject REQs and NIP-42 AUTH
integration
#902
Conversation
some minor changes, but I approve. personally think we should just use "CLOSE" rather than "CLOSED" to mirror the client side "CLOSE" (in the same way that "EVENT" is the same on client and relay sides and mean the same thing). seems way more consistent to me. ps. really like the "CLOSE" verb over the ones that I suggested |
Co-authored-by: monlovesmango <96307647+monlovesmango@users.noreply.github.com>
Co-authored-by: monlovesmango <96307647+monlovesmango@users.noreply.github.com>
My rationale for Also I prefer to have different words, makes the parsing code simpler. |
ACK!! The flow is very clear now with examples and all. Personally I would just tell relays to always send AUTH right after connection is established. It leaves less room for errors (like sending CLOSED/OK before AUTH). |
This NIP defines two new prefixes that can be used in `OK` (in response to event writes by clients) and `CLOSED` (in response to rejected | ||
subscriptions by clients): | ||
|
||
- `"auth-required: "` - for when a client has not performed `AUTH` and the relay requires that to fulfill the query or write the event. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `"auth-required: "` - for when a client has not performed `AUTH` and the relay requires that to fulfill the query or write the event. | |
- `"auth-required: "` - for when a client has not performed `AUTH` and the relay requires it to fulfill the query or write the event. |
From #841 (comment)
This makes sense. We could probably use the same verb for COUNT and other future read-verbs like HASH too? Not necessary to specify, just a thought. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
should this also apply to nip 45? |
+1 |
At any moment the relay may send an `AUTH` message to the client containing a challenge. After receiving that the client may decide to | ||
authenticate itself or not. The challenge is expected to be valid for the duration of the connection or until a next challenge is sent by | ||
the relay. | ||
At any moment the relay may send an `AUTH` message to the client containing a challenge. The challenge is valid for the duration of the connection or until another challenge is sent by the relay. The client MAY decide to send its `AUTH` event at any point and the authenticated session is valid afterwards for the duration of the connection. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At any moment the relay may send an `AUTH` message to the client containing a challenge. The challenge is valid for the duration of the connection or until another challenge is sent by the relay. The client MAY decide to send its `AUTH` event at any point and the authenticated session is valid afterwards for the duration of the connection. | |
At any moment the relay may send an `AUTH` message to the client containing a challenge. The challenge is valid for the duration of the connection or until another challenge is sent by the relay. The client MAY decide to send its `AUTH` event at any point and the authenticated session is then valid for the remainder of the connection. |
Implemented in https://nostr.wine |
Ha - you beat me to it. We implemented CLOSED with the new flow for DM REQs on all nostr.wine regional relays and will work on the rest of our relays today. |
I will quote my own message from #841 (comment) to explain this:
More relevant messages were posted to that other thread but should probably have been posted to this.