package
1.25.0
Repository: https://github.com/go-pkgz/auth.git
Documentation: pkg.go.dev

# Functions

GetUserInfo returns user info from request context.
HashID tries to hash val with hash.Hash and fallback to crc if needed.
MustGetUserInfo gets user info and panics if can't extract it from the request.
NewService makes JWT service.
SetUserInfo sets user into request context.

# Structs

Claims stores user info for token and state & from from login.
Handshake used for oauth handshake.
Opts holds constructor params.
Service wraps jwt operations supports both header and cookie tokens.
User is the basic part of oauth data provided by service.

# Interfaces

Audience defines interface returning list of allowed audiences.
ClaimsUpdater defines interface adding extras to claims.
Secret defines interface returning secret key for given id (aud).
Validator defines interface to accept o reject claims with consumer defined logic It works with valid token and allows to reject some, based on token match or user's fields.

# Type aliases

AudienceFunc type is an adapter to allow the use of ordinary functions as Audience.
ClaimsUpdFunc type is an adapter to allow the use of ordinary functions as ClaimsUpdater.
SecretFunc type is an adapter to allow the use of ordinary functions as Secret.
ValidatorFunc type is an adapter to allow the use of ordinary functions as Validator.