package v1

import "k8s.io/kubernetes/pkg/serviceaccount/externaljwt/plugin/testing/v1"

Index

Types

type KeyT

type KeyT struct {
	Key                      []byte
	ExcludeFromOidcDiscovery bool
}

type MockSigner

type MockSigner struct {
	SigningKey                *rsa.PrivateKey
	SigningKeyID              string
	SigningAlg                string
	TokenType                 string
	MaxTokenExpirationSeconds int64

	FetchError    error
	MetadataError error

	v1.UnsafeExternalJWTSignerServer
	// contains filtered or unexported fields
}

func NewMockSigner

func NewMockSigner(t *testing.T, socketPath string) *MockSigner

NewMockSigner starts and returns a new MockSigner It servers on the provided socket.

func (*MockSigner) CleanUp

func (m *MockSigner) CleanUp()

CleanUp stops gRPC server and the underlying listener.

func (*MockSigner) FetchKeys

func (m *MockSigner) FetchKeys(ctx context.Context, req *v1.FetchKeysRequest) (*v1.FetchKeysResponse, error)

func (*MockSigner) GetSupportedKeys

func (m *MockSigner) GetSupportedKeys() map[string]KeyT

func (*MockSigner) Metadata

func (m *MockSigner) Metadata(ctx context.Context, req *v1.MetadataRequest) (*v1.MetadataResponse, error)

func (*MockSigner) Reset

func (m *MockSigner) Reset() error

Reset genrate and adds signing/supported keys to MockSigner instance.

func (*MockSigner) SetSupportedKeys

func (m *MockSigner) SetSupportedKeys(keys map[string]KeyT)

func (*MockSigner) Sign

func (*MockSigner) WaitForSupportedKeysFetch

func (m *MockSigner) WaitForSupportedKeysFetch()

Source Files

externalsigner_mock.go

Version
v1.35.0-alpha.0
Published
Aug 2, 2025
Platform
linux/amd64
Imports
18 packages
Last checked
38 seconds ago

Tools for package owners.