handlers

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package handlers contains handlers for the JWT Mock server.

Index

Constants

View Source
const JWKSDefaultPath = "/.well-known/jwks.json"

JWKSDefaultPath is the default path for JWKS handlers.

View Source
const JWTDefaultPath = "/generate-jwt"

JWTDefaultPath is the default path for JWT handlers.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(keyStore keyStore, logger *log.Logger) http.Handler

NewHandler the fully-wired HTTP handler with all routes registered.

Types

type JWKSHandler

type JWKSHandler struct {
	// contains filtered or unexported fields
}

JWKSHandler provides handlers for JWKS operations and stores state of the current JWKS.

func NewJWKSHandler

func NewJWKSHandler(keyStore keyStore, logger *log.Logger) *JWKSHandler

NewJWKSHandler is the preferred way to create a JWKSHandler instance.

func (*JWKSHandler) Get

func (j *JWKSHandler) Get(w http.ResponseWriter, _ *http.Request)

Get returns a JSON web key set for the authorization server.

func (*JWKSHandler) Post

func (j *JWKSHandler) Post(w http.ResponseWriter, _ *http.Request)

Post forces a new JSON web key set to be created / the key set to be refreshed.

func (*JWKSHandler) RegisterDefaultPaths

func (j *JWKSHandler) RegisterDefaultPaths(api *http.ServeMux)

RegisterDefaultPaths registers the default paths for JWKS operations.

type JWTHandler

type JWTHandler struct {
	// contains filtered or unexported fields
}

JWTHandler provides handlers for working with JWTs

func NewJWTHandler

func NewJWTHandler(keyStore keyStore, logger *log.Logger) *JWTHandler

NewJWTHandler is the preferred way to create a JWTHandler instance.

func (*JWTHandler) Post

func (j *JWTHandler) Post(w http.ResponseWriter, r *http.Request)

Post creates a signed JWT with the provided claims.

func (*JWTHandler) RegisterDefaultPaths

func (j *JWTHandler) RegisterDefaultPaths(api *http.ServeMux)

RegisterDefaultPaths registers the default paths for JWKS operations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL