testutil

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockOIDCServer

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

MockOIDCServer provides a minimal OIDC issuer suitable for unit tests.

func NewMockOIDCServer

func NewMockOIDCServer(t *testing.T) *MockOIDCServer

NewMockOIDCServer starts a mock OIDC issuer that serves discovery + JWKS.

func (*MockOIDCServer) Close

func (m *MockOIDCServer) Close()

Close shuts down the underlying test server.

func (*MockOIDCServer) SetUserInfo

func (m *MockOIDCServer) SetUserInfo(data map[string]any)

SetUserInfo sets the JSON object returned from /userinfo.

func (*MockOIDCServer) SignIDToken

func (m *MockOIDCServer) SignIDToken(claims map[string]any) (string, error)

SignIDToken signs the provided claims and returns a compact JWT string.

Jump to

Keyboard shortcuts

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