Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CAClient

type CAClient struct {
	SignInvokeCount uint64

	GeneratedCerts [][]string // Cache the generated certificates for verification purpose.
	// contains filtered or unexported fields
}

    CAClient is the mocked CAClient for testing.

    func NewMockCAClient

    func NewMockCAClient(certLifetime time.Duration) (*CAClient, error)

      NewMockCAClient creates an instance of CAClient. errors is used to specify the number of errors before CSRSign returns a valid response. certLifetime specifies the TTL for the newly issued workload cert.

      func (*CAClient) CSRSign

      func (c *CAClient) CSRSign(csrPEM []byte, certValidTTLInSec int64) ([]string, error)

        CSRSign returns the certificate or errors depending on the settings.

        func (*CAClient) Close

        func (c *CAClient) Close()

        type TokenExchangeServer

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

          TokenExchangeServer is the mocked token exchange server for testing.

          func NewMockTokenExchangeServer

          func NewMockTokenExchangeServer(exchangeMap map[string]string) *TokenExchangeServer

            NewMockTokenExchangeServer creates an instance of TokenExchangeServer. errors is used to specify the number of errors before ExchangeToken returns a dumb token.

            func (*TokenExchangeServer) ExchangeToken

            func (s *TokenExchangeServer) ExchangeToken(token string) (string, error)

              ExchangeToken returns a dumb token or errors depending on the settings.

              Source Files