middleware

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateRequest

func AuthenticateRequest(cfg config.Config, ds *repo.Repo, req *http.Request) (*jwt.Claims, bool, error)

func ClaimsFromContext

func ClaimsFromContext(ctx context.Context) *jwt.Claims

ClaimsFromContext returns the JWT claims associated with ctx.

func ContextWithClaims

func ContextWithClaims(ctx context.Context, claims *jwt.Claims) context.Context

ContextWithClaims returns a new context.Context with claims attached. Use ClaimsFromContext to retrieve the claims.

func ContextWithToken

func ContextWithToken(ctx context.Context, token string) context.Context

func FindCookie

func FindCookie(cookieName string, headers http.Header) *http.Cookie

func NewAuthInterceptor

func NewAuthInterceptor(registry *protoregistry.Files) connect.UnaryInterceptorFunc

func NewErrorInterceptor

func NewErrorInterceptor() connect.UnaryInterceptorFunc

func NewJWTMiddleware

func NewJWTMiddleware(cfg config.Config, repo *repo.Repo, next http.Handler, skipVerifyFunc func(r *http.Request) bool) http.HandlerFunc

func TokenFromContext

func TokenFromContext(ctx context.Context) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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