mocks

package
v0.0.0-...-02f2956 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockSTSServer

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

MockSTSServer provides a mock STS server for testing token exchange

func NewMockSTSServer

func NewMockSTSServer(agentServiceAccount string, port uint16) *MockSTSServer

NewMockSTSServer creates a new mock STS server

func (*MockSTSServer) ClearRequests

func (m *MockSTSServer) ClearRequests()

ClearRequests clears the request history

func (*MockSTSServer) Close

func (m *MockSTSServer) Close()

Close stops the mock server

func (*MockSTSServer) GetRequests

func (m *MockSTSServer) GetRequests() []STSTokenRequest

GetRequests returns all token exchange requests received

func (*MockSTSServer) SetK8sURL

func (m *MockSTSServer) SetK8sURL(k8sURL string)

SetK8sURL sets the Kubernetes-accessible URL for the server

func (*MockSTSServer) URL

func (m *MockSTSServer) URL() string

URL returns the base URL of the mock server

func (*MockSTSServer) WellKnownURL

func (m *MockSTSServer) WellKnownURL() string

WellKnownURL returns the well-known configuration URL

type STSTokenRequest

type STSTokenRequest struct {
	GrantType          string `json:"grant_type"`
	SubjectToken       string `json:"subject_token"`
	SubjectTokenType   string `json:"subject_token_type"`
	ActorToken         string `json:"actor_token,omitempty"`
	ActorTokenType     string `json:"actor_token_type,omitempty"`
	Resource           string `json:"resource,omitempty"`
	Audience           string `json:"audience,omitempty"`
	Scope              string `json:"scope,omitempty"`
	RequestedTokenType string `json:"requested_token_type,omitempty"`
}

STSTokenRequest represents a token exchange request

type STSTokenResponse

type STSTokenResponse struct {
	AccessToken     string `json:"access_token"`
	TokenType       string `json:"token_type"`
	ExpiresIn       int    `json:"expires_in"`
	Scope           string `json:"scope,omitempty"`
	IssuedTokenType string `json:"issued_token_type"`
}

STSTokenResponse represents a token exchange response

Jump to

Keyboard shortcuts

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