testing

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 17 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 testing provides internal testing utilities.

Index

Constants

View Source
const (
	TestMetaRequestedRespCode = "x-requested-resp-code"
)

Variables

This section is empty.

Functions

func GenerateSessionID added in v0.19.0

func GenerateSessionID(token string) string

Types

type GRPCServerTokenCreatorMock added in v0.5.0

type GRPCServerTokenCreatorMock struct {
	// contains filtered or unexported fields
}

func NewGRPCServerTokenCreatorMock added in v0.5.0

func NewGRPCServerTokenCreatorMock() *GRPCServerTokenCreatorMock

func (*GRPCServerTokenCreatorMock) Called added in v0.5.0

func (m *GRPCServerTokenCreatorMock) Called() bool

func (*GRPCServerTokenCreatorMock) CreateToken added in v0.5.0

func (*GRPCServerTokenCreatorMock) LastRequest added in v0.5.0

func (*GRPCServerTokenCreatorMock) ResetCallsInfo added in v0.5.0

func (m *GRPCServerTokenCreatorMock) ResetCallsInfo()

func (*GRPCServerTokenCreatorMock) SetResultForToken added in v0.5.0

func (m *GRPCServerTokenCreatorMock) SetResultForToken(token string, result *pb.CreateTokenResponse)

type GRPCServerTokenIntrospectorMock

type GRPCServerTokenIntrospectorMock struct {
	JWTParser JWTParser

	RetryAfter string
	// contains filtered or unexported fields
}

func NewGRPCServerTokenIntrospectorMock

func NewGRPCServerTokenIntrospectorMock() *GRPCServerTokenIntrospectorMock

func (*GRPCServerTokenIntrospectorMock) Called

func (*GRPCServerTokenIntrospectorMock) IntrospectToken

nolint:gocyclo,funlen // Mock implementation handles multiple test scenarios with different response types

func (*GRPCServerTokenIntrospectorMock) LastAuthorizationMeta

func (m *GRPCServerTokenIntrospectorMock) LastAuthorizationMeta() string

func (*GRPCServerTokenIntrospectorMock) LastRequest

func (*GRPCServerTokenIntrospectorMock) LastSessionMeta added in v0.19.0

func (m *GRPCServerTokenIntrospectorMock) LastSessionMeta() string

func (*GRPCServerTokenIntrospectorMock) LastUserAgentMeta added in v0.23.0

func (m *GRPCServerTokenIntrospectorMock) LastUserAgentMeta() string

func (*GRPCServerTokenIntrospectorMock) ResetCallsInfo

func (m *GRPCServerTokenIntrospectorMock) ResetCallsInfo()

func (*GRPCServerTokenIntrospectorMock) SetAccessTokenForIntrospection added in v0.5.0

func (m *GRPCServerTokenIntrospectorMock) SetAccessTokenForIntrospection(accessToken string)

func (*GRPCServerTokenIntrospectorMock) SetResultForToken

func (m *GRPCServerTokenIntrospectorMock) SetResultForToken(token string, response *pb.IntrospectTokenResponse, err error)

func (*GRPCServerTokenIntrospectorMock) SetScopeForJWTID

func (m *GRPCServerTokenIntrospectorMock) SetScopeForJWTID(jwtID string, scope []*pb.AccessTokenScope)

type HTTPServerTokenIntrospectorMock

type HTTPServerTokenIntrospectorMock struct {
	JWTParser JWTParser

	RetryAfter string
	// contains filtered or unexported fields
}

func NewHTTPServerTokenIntrospectorMock

func NewHTTPServerTokenIntrospectorMock() *HTTPServerTokenIntrospectorMock

func (*HTTPServerTokenIntrospectorMock) Called

func (*HTTPServerTokenIntrospectorMock) IntrospectToken

func (*HTTPServerTokenIntrospectorMock) LastAuthorizationHeader

func (m *HTTPServerTokenIntrospectorMock) LastAuthorizationHeader() string

func (*HTTPServerTokenIntrospectorMock) LastFormValues

func (m *HTTPServerTokenIntrospectorMock) LastFormValues() url.Values

func (*HTTPServerTokenIntrospectorMock) LastIntrospectedToken

func (m *HTTPServerTokenIntrospectorMock) LastIntrospectedToken() string

func (*HTTPServerTokenIntrospectorMock) LastUserAgentHeader added in v0.23.0

func (m *HTTPServerTokenIntrospectorMock) LastUserAgentHeader() string

func (*HTTPServerTokenIntrospectorMock) ResetCallsInfo

func (m *HTTPServerTokenIntrospectorMock) ResetCallsInfo()

func (*HTTPServerTokenIntrospectorMock) SetAccessTokenForIntrospection added in v0.5.0

func (m *HTTPServerTokenIntrospectorMock) SetAccessTokenForIntrospection(accessToken string)

func (*HTTPServerTokenIntrospectorMock) SetResultForToken

func (m *HTTPServerTokenIntrospectorMock) SetResultForToken(token string, result idptoken.IntrospectionResult, err error)

func (*HTTPServerTokenIntrospectorMock) SetScopeForJWTID

func (m *HTTPServerTokenIntrospectorMock) SetScopeForJWTID(jwtID string, scope []jwt.AccessPolicy)

type JWTParser

type JWTParser interface {
	Parse(ctx context.Context, token string) (jwt.Claims, error)
}

Jump to

Keyboard shortcuts

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