identitytest

package
v0.167.0 Latest Latest
Warning

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

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

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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