package v1alpha1
import "k8s.io/kubernetes/pkg/serviceaccount/externaljwt/plugin/testing/v1alpha1"
Index ¶
- type KeyT
- type MockSigner
- func NewMockSigner(t *testing.T, socketPath string) *MockSigner
- func (m *MockSigner) CleanUp()
- func (m *MockSigner) FetchKeys(ctx context.Context, req *v1alpha1.FetchKeysRequest) (*v1alpha1.FetchKeysResponse, error)
- func (m *MockSigner) GetSupportedKeys() map[string]KeyT
- func (m *MockSigner) Metadata(ctx context.Context, req *v1alpha1.MetadataRequest) (*v1alpha1.MetadataResponse, error)
- func (m *MockSigner) Reset() error
- func (m *MockSigner) SetSupportedKeys(keys map[string]KeyT)
- func (m *MockSigner) Sign(ctx context.Context, req *v1alpha1.SignJWTRequest) (*v1alpha1.SignJWTResponse, error)
- func (m *MockSigner) WaitForSupportedKeysFetch()
Types ¶
type KeyT ¶
type MockSigner ¶
type MockSigner struct { SigningKey *rsa.PrivateKey SigningKeyID string SigningAlg string TokenType string MaxTokenExpirationSeconds int64 FetchError error MetadataError error // 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 *v1alpha1.FetchKeysRequest) (*v1alpha1.FetchKeysResponse, error)
func (*MockSigner) GetSupportedKeys ¶
func (m *MockSigner) GetSupportedKeys() map[string]KeyT
func (*MockSigner) Metadata ¶
func (m *MockSigner) Metadata(ctx context.Context, req *v1alpha1.MetadataRequest) (*v1alpha1.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 (m *MockSigner) Sign(ctx context.Context, req *v1alpha1.SignJWTRequest) (*v1alpha1.SignJWTResponse, error)
func (*MockSigner) WaitForSupportedKeysFetch ¶
func (m *MockSigner) WaitForSupportedKeysFetch()
Source Files ¶
externalsigner_mock.go
- Version
- v1.33.2 (latest)
- Published
- Jun 17, 2025
- Platform
- linux/amd64
- Imports
- 18 packages
- Last checked
- 45 minutes ago –
Tools for package owners.