jwtmocktest

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package jwtmocktest provides a test server for use in end-to-end HTTP tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	*httptest.Server
	// contains filtered or unexported fields
}

A Server is an HTTP server listening on a system-chosen port on the local loopback interface, for use in end-to-end HTTP tests.

func NewServer

func NewServer() (*Server, error)

NewServer starts and returns a new Server. The caller should call Close when finished, to shut it down.

func (*Server) GenerateJWT

func (s *Server) GenerateJWT(claims jwtmock.Claims) (string, error)

GenerateJWT generates a JWT token for use in authorization header.

func (*Server) RegisterClient added in v1.1.1

func (s *Server) RegisterClient(registration jwtmock.ClientRegistration) error

RegisterClient registers a new client for subsequent token request.

Jump to

Keyboard shortcuts

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