Documentation

Overview

Package test is a generated protocol buffer package.

It is generated from these files:

mock_config.proto

It has these top-level messages:

MockConfig
ConfigPair

Index

Constants

View Source
const (
	// JwtPubKey1 is the response to 1st call for JWT public key returned by mock server.
	JwtPubKey1 = "fakeKey1"

	// JwtPubKey2 is the response to later calls for JWT public key returned by mock server.
	JwtPubKey2 = "fakeKey2"
)

Variables

View Source
var (
	ErrInvalidLengthMockConfig = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMockConfig   = fmt.Errorf("proto: integer overflow")
)

Functions

This section is empty.

Types

type ConfigPair

type ConfigPair struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}

func (*ConfigPair) Descriptor

func (*ConfigPair) Descriptor() ([]byte, []int)

func (*ConfigPair) GetKey

func (m *ConfigPair) GetKey() string

func (*ConfigPair) GetValue

func (m *ConfigPair) GetValue() string

func (*ConfigPair) Marshal

func (m *ConfigPair) Marshal() (dAtA []byte, err error)

func (*ConfigPair) MarshalTo

func (m *ConfigPair) MarshalTo(dAtA []byte) (int, error)

func (*ConfigPair) ProtoMessage

func (*ConfigPair) ProtoMessage()

func (*ConfigPair) Reset

func (m *ConfigPair) Reset()

func (*ConfigPair) Size

func (m *ConfigPair) Size() (n int)

func (*ConfigPair) String

func (m *ConfigPair) String() string

func (*ConfigPair) Unmarshal

func (m *ConfigPair) Unmarshal(dAtA []byte) error

type MockConfig

type MockConfig struct {
	Key   string        `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Pairs []*ConfigPair `protobuf:"bytes,2,rep,name=pairs" json:"pairs,omitempty"`
}

func (*MockConfig) Descriptor

func (*MockConfig) Descriptor() ([]byte, []int)

func (*MockConfig) GetKey

func (m *MockConfig) GetKey() string

func (*MockConfig) GetPairs

func (m *MockConfig) GetPairs() []*ConfigPair

func (*MockConfig) Marshal

func (m *MockConfig) Marshal() (dAtA []byte, err error)

func (*MockConfig) MarshalTo

func (m *MockConfig) MarshalTo(dAtA []byte) (int, error)

func (*MockConfig) ProtoMessage

func (*MockConfig) ProtoMessage()

func (*MockConfig) Reset

func (m *MockConfig) Reset()

func (*MockConfig) Size

func (m *MockConfig) Size() (n int)

func (*MockConfig) String

func (m *MockConfig) String() string

func (*MockConfig) Unmarshal

func (m *MockConfig) Unmarshal(dAtA []byte) error

type MockOpenIDDiscoveryServer

type MockOpenIDDiscoveryServer struct {
	Port int
	URL  string

	// How many times openIDCfg is called, use this number to verify cache takes effect.
	OpenIDHitNum uint64

	// How many times jwtPubKey is called, use this number to verify cache takes effect.
	PubKeyHitNum uint64

	// The mock server will return an error for the first number of hits for public key, this is used
	// to simulate network errors and test the retry logic in jwks resolver for public key fetch.
	ReturnErrorForFirstNumHits uint64

	// The mock server will start to return an error after the first number of hits for public key,
	// this is used to simulate network errors and test the refresh logic in jwks resolver.
	ReturnErrorAfterFirstNumHits uint64 // contains filtered or unexported fields

}

MockOpenIDDiscoveryServer is the in-memory openID discovery server.

func StartNewServer

func StartNewServer() (*MockOpenIDDiscoveryServer, error)

StartNewServer creates a mock openID discovery server and starts it

func (*MockOpenIDDiscoveryServer) Start

func (ms *MockOpenIDDiscoveryServer) Start() error

Start starts the mock server.

func (*MockOpenIDDiscoveryServer) Stop

func (ms *MockOpenIDDiscoveryServer) Stop() error

Stop stops he mock server.