middleware

package
v1.1.65 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRequestLogging added in v1.1.14

func AddRequestLogging(next http.Handler) http.Handler

func AddViewerToLogs added in v1.1.14

func AddViewerToLogs(fromContext func(context.Context) any) func(http.Handler) http.Handler

func AuthenticateWithClerk

func AuthenticateWithClerk(
	clerkHook *clerkhooks.ClerkHook,
) 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 SecurityHeaders added in v1.1.29

func SecurityHeaders(next http.Handler) http.Handler

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(
	clerkhook *clerkhooks.ClerkHook,
) transport.WebsocketInitFunc

func WithCustomClaims

func WithCustomClaims() clerkhttp.AuthorizationOption

func WriteClerkSessionClaimsFromLocalDB added in v1.1.3

func WriteClerkSessionClaimsFromLocalDB(
	hook *clerkhooks.ClerkHook,
) func(http.Handler) http.Handler

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"`
	Plan            string `json:"pla"`
	PlanOverride    string `json:"plan_override"`
	OrgPlanOverride string `json:"org_plan_override"`
}

Jump to

Keyboard shortcuts

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