nostrver-se / nostr-php

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

When will AUTH support be added? #62

Closed SilberWitch closed 1 week ago

SilberWitch commented 1 month ago

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

Sebastix commented 1 month 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 1 month 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 1 month 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.

Sebastix commented 1 month ago

Did you find a way to handle auth responses? I worked out an example, but haven't cleaned it up yet to include it in the docs.

SilberWitch commented 1 month ago

Not, yet. Maybe by this afternoon, tho. I'm working on the Jenkins pipeline, first. It's still fidgety.

SilberWitch commented 1 month ago

I retired the old Sybil repo. Here's the new one: https://github.com/SilberWitch/Sybil

SilberWitch commented 1 month ago

Couldn't figure out how to handle it. Just skipping over those relays, now. :see_no_evil:

Sebastix commented 1 month ago

Which relay(s) are you using to try it out?

SilberWitch commented 1 month ago

nostr.wine hotrightnow.nostr1.com

Sebastix commented 3 weeks ago

On requesting and/or writing events to those relays?

Sebastix commented 3 weeks ago

@SilberWitch merged in the main branch: https://github.com/nostrver-se/nostr-php/pull/67.

The client to relay authentication is taken care within the library.

I will create a new release later this week.

SilberWitch commented 3 weeks ago

Thank you, very much, for taking pity on me. :saluting_face:

Sebastix commented 1 week ago

See https://github.com/nostrver-se/nostr-php/releases/tag/1.5.0