middleware
import "github.com/Ask-Atlas/AskAtlas/api/internal/middleware"
Package middleware provides reusable HTTP interceptors for routing and authentication.
Index
- func ClerkAuth(resolver authctx.UserIDResolver) func(http.Handler) http.Handler
- func QStashVerifier(currentSigningKey, nextSigningKey string) func(next http.Handler) http.Handler
- func SVIXVerifier(secret string) func(next http.Handler) http.Handler
func ClerkAuth
func ClerkAuth(resolver authctx.UserIDResolver) func(http.Handler) http.Handler
ClerkAuth creates an HTTP middleware that extracts the Clerk user session, validates it, and resolves the database user ID injecting it into the context.
func QStashVerifier
func QStashVerifier(currentSigningKey, nextSigningKey string) func(next http.Handler) http.Handler
QStashVerifier creates an HTTP middleware that validates QStash webhook signatures. currentSigningKey and nextSigningKey are the Upstash signing keys (injected from main).
func SVIXVerifier
func SVIXVerifier(secret string) func(next http.Handler) http.Handler
SVIXVerifier creates an HTTP middleware that validates Svix webhook signatures. It ensures that incoming webhook requests genuinely originate from Clerk.
Generated by gomarkdoc