oidc_testing

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TestIssuerURL = "https://issuer.org"
)

Defaults

Functions

func TestDiscovery

func TestDiscovery(testIssuerURL string) oidc.DiscoveryJSON

Types

type Provider

type Provider struct {
	IssuerURL string
	// Used for initial discovery.
	Discovery oidc.DiscoveryJSON
	// contains filtered or unexported fields
}

func (*Provider) Context

func (p *Provider) Context() context.Context

Context that should be used to propagate mocked HTTP client.

func (*Provider) Mock

func (p *Provider) Mock() *httpt.Server

Mock allows to mock provider response on certain requests.

func (*Provider) MockDiscoveryCall

func (p *Provider) MockDiscoveryCall()

func (*Provider) MockPubKeysCall

func (p *Provider) MockPubKeysCall(jwkSetJSON []byte)

func (*Provider) NewIDToken

func (p *Provider) NewIDToken(clientID string, subject string, nonce string, customClaims ...interface{}) (idToken string, jwkSetJSON []byte)

NewIDToken creates new token. Feel free to override basic claims in customClaim for various tests. NOTE: It is important that on every call we

func (*Provider) Setup

func (p *Provider) Setup(t *testing.T)

Jump to

Keyboard shortcuts

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