diff options
| author | bndw <ben@bdw.to> | 2026-02-14 08:39:37 -0800 |
|---|---|---|
| committer | bndw <ben@bdw.to> | 2026-02-14 08:39:37 -0800 |
| commit | 756c325223ef744b476ade565cb1970c7717d053 (patch) | |
| tree | 56ca7b864c686f8a8b9f23ed462ee187d8b30a7e /internal/nostr/envelope.go | |
| parent | 44872a7642c31166fc500d2d81ff9a9abdeeb727 (diff) | |
feat: implement NIP-98 HTTP auth for gRPC
Add comprehensive NIP-98 authentication support following the standard
gRPC credentials.PerRPCCredentials pattern.
Client-side:
- NostrCredentials implements PerRPCCredentials interface
- Automatically signs each request with kind 27235 event
- Drop-in replacement for OAuth2/JWT in gRPC clients
Server-side:
- Unary and stream interceptors for validation
- Extracts and validates NIP-98 events from Authorization headers
- Configurable options (timestamp window, whitelists, skip methods)
- Adds authenticated pubkey to request context
Security features:
- Replay protection via timestamp validation
- Optional payload hash verification
- Signature verification using schnorr
- TLS requirement option
Includes comprehensive test coverage and detailed README with
usage examples and security considerations.
Diffstat (limited to 'internal/nostr/envelope.go')
0 files changed, 0 insertions, 0 deletions
