Documentation
¶
Overview ¶
Package testauth implements a simple JWKS file server and token signer for use in test packages when jwt validation is required.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClaimOption ¶
ClaimOption is a claim option definition.
func Audience ¶
func Audience(v ...string) ClaimOption
Audience lets you specify an audience claim option.
func Expiry ¶
func Expiry(v *jwt.NumericDate) ClaimOption
Expiry lets you specify an expiry claim option.
func NotBefore ¶
func NotBefore(v *jwt.NumericDate) ClaimOption
NotBefore lets you specify a not before claim option.
type Server ¶
type Server struct { Issuer string // contains filtered or unexported fields }
Server handles serving JSON Web Key Set and signing tokens.
func NewUnstartedServer ¶
NewUnstartedServer creates a new Server without starting it.
func (*Server) SignSubject ¶
func (s *Server) SignSubject(subject string, options ...ClaimOption) string
SignSubject returns a new token string with the provided subject. Additional claims may be provided as options. Any errors produced will result in the test passed when initializing Server to fail.
func (*Server) TSignSubject ¶
TSignSubject returns a new token string with the provided subject. Additional claims may be provided as options. Any errors produced will result in the passed test argument failing.