middleware

package
v0.0.0-...-6269356 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2025 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIKeyMiddleware

func APIKeyMiddleware(c *gin.Context)

APIKeyMiddleware is a middleware to handle API key authentication

func CORSMiddleware

func CORSMiddleware() gin.HandlerFunc

CORSMiddleware is a middleware that adds CORS headers to response

func DynamicAuthMiddleware

func DynamicAuthMiddleware(c *gin.Context)

DynamicAuthMiddleware is a middleware that dynamically selects the authentication method

func HMACVerificationMiddleware

func HMACVerificationMiddleware(c *gin.Context)

HMACVerificationMiddleware is a middleware for HMAC verification. It verifies the HMAC signature in the Authorization header of the request.

func JWTMiddleware

func JWTMiddleware(c *gin.Context)

JWTMiddleware is a middleware to handle JWT authentication

func OnlyProviderMiddleware

func OnlyProviderMiddleware(c *gin.Context)

OnlyProviderMiddleware is a middleware that checks if the user scope is provider.

func OnlySenderMiddleware

func OnlySenderMiddleware(c *gin.Context)

OnlySenderMiddleware is a middleware that checks if the user scope is sender.

func OnlyWebMiddleware

func OnlyWebMiddleware(c *gin.Context)

OnlyWebMiddleware is a middle that checks your Client-Type and allows for auth

func PrivyMiddleware

func PrivyMiddleware(c *gin.Context)

PrivyMiddleware verifies the access token from a Privy (privy.io) login

func RateLimitMiddleware

func RateLimitMiddleware() gin.HandlerFunc

RateLimitMiddleware applies rate limiting based on the request type (authenticated/unauthenticated)

Types

type LinkedAccount

type LinkedAccount struct {
	Type             string `json:"type"`
	Address          string `json:"address"`
	ChainType        string `json:"chain_type"`
	WalletClientType string `json:"wallet_client_type"`
	Lv               int64  `json:"lv"`
}

type PrivyClaims

type PrivyClaims struct {
	jwt.MapClaims
	AppId          string `json:"aud,omitempty"`
	Expiration     uint64 `json:"exp,omitempty"`
	Issuer         string `json:"iss,omitempty"`
	UserId         string `json:"sub,omitempty"`
	LinkedAccounts string `json:"linked_accounts,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL