Manage relay users gRPC Server

License

gRPC Extensions for nostr-rs-relay

gRPC authz server for nostr-rs-rely. Admits events based on whether they have been allowed by the relay admin.

Managing Users

Via Nostr

The admin(s) can update accounts by publishing an kind 4242 event with an allow tag where index 0 is "allow" followed by the list of hex pubkeys, and a "deny" tag of the same format.

For now this is not in a NIP if there is interest it can be more formalized.

Events can be published using this branch of nostr tools or implementing the event format in other tools.

https://github.com/thesimplekid/nostr-tool/tree/managerelayusers

```json { "id": <32-bytes lowercase hex-encoded sha256 of the the serialized event data>, "pubkey": , "created_at": , "kind": 4242, "tags": [ ["allow", <32-bytes hex of a pubkey>, <32-bytes hex of a pubkey>, ...], ["deny", <32-bytes hex of a pubkey>, <32-bytes hex of a pubkey>, ...], ... ], "content": "", ... }

```

HTTP API

The users can be updated by sending a http POST to the /update endpoint with a json body with the following format.

json { "allow":, [<32-bytes hex of a pubkey>, <32-bytes hex of a pubkey>, ...], "deny": [<32-bytes hex of a pubkey>, <32-bytes hex of a pubkey>, ...], }

There is also a GET endpoint with at /users that will return json of the same format with allowed and denied users.

If the relay has nip42 enabled it will use the authenticated pubkey if not the author pubkey of the note will be used.

License

Code is under the BSD 3-Clause License

Contact

I can be contacted for comments or questions on nostr at _@thesimplekid.com (npub1qjgcmlpkeyl8mdkvp4s0xls4ytcux6my606tgfx9xttut907h0zs76lgjw) or via email tsk@thesimplekid.com.