Help us shape the future of Go! Take the 2026 Go Developer Survey

identitytest

package
v0.105.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package identitytest is a Dex stand-in for tests: an OIDC issuer that serves its discovery document and keys and signs ID tokens.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Verified

func Verified() *bool

Verified is a true email_verified.

Types

type Claims

type Claims struct {
	Issuer        string   `json:"iss,omitempty"`
	Subject       string   `json:"sub,omitempty"`
	Audience      []string `json:"aud,omitempty"`
	Expiry        int64    `json:"exp,omitempty"`
	IssuedAt      int64    `json:"iat,omitempty"`
	Email         string   `json:"email,omitempty"`
	EmailVerified *bool    `json:"email_verified,omitempty"`
	Groups        []string `json:"groups,omitempty"`
}

Claims are an ID token's: the standard ones are filled in by Token where they are unset.

type Issuer

type Issuer struct {
	URL string
	// contains filtered or unexported fields
}

Issuer is a running test issuer.

func New

func New(t *testing.T) *Issuer

New starts an issuer for the test's lifetime.

func (*Issuer) Token

func (iss *Issuer) Token(t *testing.T, aud string, c Claims) string

Token signs c, with the issuer, a subject, an hour of validity and the audience aud filled in where unset.

Jump to

Keyboard shortcuts

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