i haven't got an elegant solution for generating JWT expiring tokens tho
that's in Go only at this point, someone who knows how to generate JWT tokens and custom events, this is the flow:
- create new JWT ES256 key pair
- generate kind 13004 event designating the public key of the JWT key pair (this delegates that key to auth for you
- generate a JWT token, optionally with an expiration time (it's a standard JWT claims list and all that)
- send filter or event with Bearer <
token.is.here> et voila
you don't need to do the JWT flow if the relay is set to be public-readable, so for fetching events it's very straightforward, the auth is just for writing in that situation, or for fetching privileged events like DMs