middleware

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateWithClerk

func AuthenticateWithClerk(
	loggedOutVC func(ctx context.Context) context.Context,
	newContextFromBase func(ctx context.Context, base *viewer.Context) context.Context,
) func(http.Handler) http.Handler

func Chain

func Chain(middlewares ...func(http.Handler) http.Handler) func(http.Handler) http.Handler

func CookieAuth

func CookieAuth(next http.Handler) http.Handler

func EnableCORS

func EnableCORS(clientURL string) func(http.Handler) http.Handler

func IsViewerOverrideSet

func IsViewerOverrideSet(r *http.Request) bool

func SetManualViewer

func SetManualViewer(
	newContextFromBase func(ctx context.Context, base *viewer.Context) context.Context,
) func(http.Handler) http.Handler

func SkipIf

func SkipIf(
	shouldSkip func(r *http.Request) bool,
	mw func(http.Handler) http.Handler,
) func(http.Handler) http.Handler

func UseIf

func UseIf(
	shouldRun func(r *http.Request) bool,
	mw func(http.Handler) http.Handler,
) func(http.Handler) http.Handler

func WebsocketInit

func WebsocketInit(
	loggedOutVC func(ctx context.Context) context.Context,
	newContextFromBase func(ctx context.Context, base *viewer.Context) context.Context,
) transport.WebsocketInitFunc

func WithCustomClaims

func WithCustomClaims() clerkhttp.AuthorizationOption

Types

type CustomClaims

type CustomClaims struct {
	UserID        string `json:"app_user_id"`
	Role          string `json:"app_user_role"`
	OrgID         string `json:"app_org_id"`
	PersonalOrgID string `json:"app_personal_org_id"`
}

Jump to

Keyboard shortcuts

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