Documentation ¶
Overview ¶
Package authtest is a mini server and token generator with a mock test to confirm keygen works correctly; not intended to test the whole api but rather just the token issuance and authentication
Index ¶
- Constants
- type Server
- func (s *Server) Close()
- func (s *Server) CreateAccessToken(claims *tokens.Claims) (tks string, err error)
- func (s *Server) CreateToken(claims *tokens.Claims) (tks string, err error)
- func (s *Server) CreateTokenPair(claims *tokens.Claims) (accessToken, refreshToken string, err error)
- func (s *Server) JWKS(w http.ResponseWriter, r *http.Request)
- func (s *Server) KeysURL() string
Constants ¶
View Source
const ( Audience = "http://localhost:17608" Issuer = "http://localhost:17608" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
Server implements an endpoint to host JWKS public keys and also provides simple functionality to create access and refresh tokens that would be authenticated.
func NewServer ¶
NewServer starts and returns a new authtest server. The caller should call Close when finished, to shut it down.
func (*Server) CreateAccessToken ¶
func (*Server) CreateToken ¶
CreateToken creates a token without overwriting the claims, which is useful for creating tokens with specific not before and expiration times for testing.
func (*Server) CreateTokenPair ¶
Click to show internal directories.
Click to hide internal directories.