middleware

package
v0.0.0-...-11148c9 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errors

func Errors() gin.HandlerFunc

func Recovery

func Recovery(stack bool) gin.HandlerFunc

Types

type ApiKeyMiddleware

type ApiKeyMiddleware struct {
	// contains filtered or unexported fields
}

func NewApiKeyMiddleware

func NewApiKeyMiddleware(apiKeyHeader, apiKey string) (*ApiKeyMiddleware, error)

func (*ApiKeyMiddleware) Authenticate

func (a *ApiKeyMiddleware) Authenticate() gin.HandlerFunc

type AuthMiddleware

type AuthMiddleware struct{}

func NewAuthMiddleware

func NewAuthMiddleware() *AuthMiddleware

func (*AuthMiddleware) CheckPermissions

func (a *AuthMiddleware) CheckPermissions(oneOf []string) gin.HandlerFunc

type CertHandler

type CertHandler struct {
	// contains filtered or unexported fields
}

type JSONWebKeys

type JSONWebKeys struct {
	Kty string   `json:"kty"`
	Kid string   `json:"kid"`
	Use string   `json:"use"`
	N   string   `json:"n"`
	E   string   `json:"e"`
	X5c []string `json:"x5c"`
}

type Jwks

type Jwks struct {
	Keys []JSONWebKeys `json:"keys"`
}

type JwksMiddleware

type JwksMiddleware struct {
	// contains filtered or unexported fields
}

func NewJwksMiddleware

func NewJwksMiddleware(userService base_service.UserService, config *JwtMiddlewareConfig) (*JwksMiddleware, error)

func (*JwksMiddleware) Authenticate

func (j *JwksMiddleware) Authenticate(extractUser, allowAnonymous bool) gin.HandlerFunc

type JwtMiddlewareConfig

type JwtMiddlewareConfig struct {
	Auth0Domain           string   `yaml:"auth0_domain" json:"auth0_domain" mapstructure:"auth0_domain" validate:"required"`                                  // Auth0 domain without protocol and trailing slash, for example login-dev.eosnation.io
	Auth0AllowedAudiences []string `yaml:"auth0_allowed_audiences" json:"auth0_allowed_audiences" mapstructure:"auth0_allowed_audiences" validate:"required"` // Audiences allowed accessing this API
	Namespace             string   `yaml:"namespace" json:"namespace" mapstructure:"namespace" validate:"required"`                                           // The namespace for the token claims
	JwksFile              string   `yaml:"jwks_file" json:"jwks_file" mapstructure:"jwks_file" validate:"omitempty"`
}

type LanguageMiddleware

type LanguageMiddleware struct {
	// contains filtered or unexported fields
}

func NewLanguageMiddleware

func NewLanguageMiddleware(languageService base_service.LanguageService) *LanguageMiddleware

func (*LanguageMiddleware) ParseLanguageHeader

func (l *LanguageMiddleware) ParseLanguageHeader(defaultLanguageCode string) gin.HandlerFunc

type ReverseProxyMiddleware

type ReverseProxyMiddleware struct {
	// contains filtered or unexported fields
}

func NewReverseProxyMiddleware

func NewReverseProxyMiddleware(target string) (*ReverseProxyMiddleware, error)

func (*ReverseProxyMiddleware) ProxyRequest

func (r *ReverseProxyMiddleware) ProxyRequest(responseHandler func(*gin.Context) func(*http.Response) error) gin.HandlerFunc

Jump to

Keyboard shortcuts

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