nostrver-se / nostr-php

PHP helper library for Nostr https://nostr-php.dev
https://nostr-php.dev
MIT License
50 stars 15 forks source link

When will AUTH support be added? #62

Open SilberWitch opened 1 week ago

SilberWitch commented 1 week ago

Hi, what is the timeline for adding AUTH support for relays?

Sebastix commented 1 week ago

The library only returns a very basic RelayReponseAuth (https://github.com/nostrver-se/nostr-php/blob/main/src/RelayResponse/RelayResponseAuth.php) when you connect to a relay which requires authentication.

You handle all the authentication steps in your application offcourse, but I noted down in the README to work this out in a NIP-42 helper class/function as well so these steps will be taken care within the library. I'm not even fully sure if this should be taken care within the library as the return challenge string should be saved by the client (it could be stored as a session variable as a backup).

Depending on your needs, when do you need it @SilberWitch? It's not planned yet, as I'm working on doing asynchronous concurrent relay requests with the library.

SilberWitch commented 6 days ago

I just saw the Reponse Object, yesterday, and that's actually enough info for me. That's really good, because now I can get rid of some of the NAK shell calls, I was using, and stick more to the helper.

SilberWitch commented 6 days ago

You might want to add an example of that response to your ReadMe, tho. I just saw it because I kept getting errors, as the script was returning something odd, so I spit it out, to look at it.