Documentation
¶
Overview ¶
Package httpauth provides helpers and encoders for nostr NIP-98 HTTP authentication header messages and a new JWT authentication message and delegation event kind 13004 that enables time limited expiring delegations of authentication (as with NIP-42 auth) for the HTTP API.
Index ¶
- Constants
- Variables
- func AddNIP98Header(r *http.Request, ur *url.URL, method, hash string, sign signer.I, expiry int64) (err error)
- func CheckAuth(r *http.Request, tolerance ...time.Duration) (valid bool, pubkey []byte, err error)
- func MakeNIP98Event(u, method, hash string, expiry int64) (ev *event.T)
Constants ¶
View Source
const ( HeaderKey = "Authorization" NIP98Prefix = "Nostr" )
Variables ¶
View Source
var ErrMissingKey = fmt.Errorf( "'%s' key missing from request header", HeaderKey)
Functions ¶
func AddNIP98Header ¶
func AddNIP98Header(r *http.Request, ur *url.URL, method, hash string, sign signer.I, expiry int64) (err error)
AddNIP98Header creates a NIP-98 http auth event and adds the standard header to a provided http.Request.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.