Documentation
¶
Index ¶
- Constants
- func ApiKeyMiddleware(c *fiber.Ctx) error
- func GetNIP98Pubkey(c *fiber.Ctx) (string, error)
- func JwtMiddleware(c *fiber.Ctx, store stores.Store) error
- func NIP98Middleware(config ...NIP98Config) fiber.Handler
- func NIP98ProtectedHandler(handler fiber.Handler, config ...NIP98Config) fiber.Handler
- func RateLimiterMiddleware() fiber.Handler
- type NIP98Config
Constants ¶
View Source
const ( // NIP98EventKind is the kind for HTTP auth events as per NIP-98 NIP98EventKind = 27235 // DefaultTimeWindow is the default time window for event validity (60 seconds) DefaultTimeWindow = 60 * time.Second )
View Source
const NIP98PubkeyKey = "nip98_pubkey"
NIP98Context key for storing validated pubkey in request context
Variables ¶
This section is empty.
Functions ¶
func ApiKeyMiddleware ¶
func ApiKeyMiddleware(c *fiber.Ctx) error
func GetNIP98Pubkey ¶
GetNIP98Pubkey extracts the validated pubkey from the request context
func JwtMiddleware ¶
func NIP98Middleware ¶
func NIP98Middleware(config ...NIP98Config) fiber.Handler
NIP98Middleware validates NIP-98 authorization for HTTP requests
func NIP98ProtectedHandler ¶
func NIP98ProtectedHandler(handler fiber.Handler, config ...NIP98Config) fiber.Handler
NIP98ProtectedHandler is a helper to create handlers that require NIP-98 auth
func RateLimiterMiddleware ¶
func RateLimiterMiddleware() fiber.Handler
Types ¶
type NIP98Config ¶
NIP98Config holds configuration for NIP-98 middleware
func DefaultNIP98Config ¶
func DefaultNIP98Config() NIP98Config
DefaultNIP98Config returns default configuration
Click to show internal directories.
Click to hide internal directories.