Documentation
¶
Index ¶
- Constants
- Variables
- func AuthenticateRequest(cfg config.Config, ds *repo.Queries, req *http.Request) (*jwt.Claims, error)
- func ClaimsFromContext(ctx context.Context) *jwt.Claims
- func ContextWithClaims(ctx context.Context, claims *jwt.Claims) context.Context
- func ContextWithToken(ctx context.Context, token string) context.Context
- func FindCookie(cookieName string, headers http.Header) *http.Cookie
- func NewAuthInterceptor(registry *protoregistry.Files) connect.UnaryInterceptorFunc
- func NewErrorInterceptor() connect.UnaryInterceptorFunc
- func NewJWTMiddleware(cfg config.Config, repo *repo.Queries, next http.Handler, ...) http.HandlerFunc
- func TokenFromContext(ctx context.Context) string
Constants ¶
View Source
const APITokenPrefix = "it."
Variables ¶
Functions ¶
func AuthenticateRequest ¶
func ClaimsFromContext ¶
ClaimsFromContext returns the JWT claims associated with ctx.
func ContextWithClaims ¶
ContextWithClaims returns a new context.Context with claims attached. Use ClaimsFromContext to retrieve the claims.
func NewAuthInterceptor ¶
func NewAuthInterceptor(registry *protoregistry.Files) connect.UnaryInterceptorFunc
func NewErrorInterceptor ¶
func NewErrorInterceptor() connect.UnaryInterceptorFunc
func NewJWTMiddleware ¶
func TokenFromContext ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.