Documentation ¶
Index ¶
- Variables
- func Client(authenticator authn.Authenticator, opts ...Option) middleware.Middleware
- func FromContext(ctx context.Context) (*authn.AuthClaims, bool)
- func NewContext(ctx context.Context, claims *authn.AuthClaims) context.Context
- func Server(authenticator authn.Authenticator, userCreator authn.SecurityUserCreator) middleware.Middleware
- type ContextWithToken
- type Option
- type Result
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrWrongContext = errors.Unauthorized(reason, "wrong context for middleware") ErrMissingJwtToken = errors.Unauthorized(reason, "no jwt token in context") ErrExtractSubjectFailed = errors.Unauthorized(reason, "extract subject failed") )
View Source
var (
ErrInvalidAuthUser = errors.Unauthorized(reason, "invalid auth user")
)
Functions ¶
func Client ¶
func Client(authenticator authn.Authenticator, opts ...Option) middleware.Middleware
Client is a client authenticator middleware.
func FromContext ¶
func FromContext(ctx context.Context) (*authn.AuthClaims, bool)
func NewContext ¶
func Server ¶
func Server(authenticator authn.Authenticator, userCreator authn.SecurityUserCreator) middleware.Middleware
Server is a server authenticator middleware.
Types ¶
type Option ¶
type Option func(*options)
func WithAuthClaims ¶
func WithAuthClaims(claims authn.AuthClaims) Option
func WithContextToken ¶
func WithContextToken(f ContextWithToken) Option
Click to show internal directories.
Click to hide internal directories.