istio: istio.io/istio/pilot/pkg/model/test Index | Files

package test

import "istio.io/istio/pilot/pkg/model/test"

Index

Package Files

mockopenidserver.go

Constants

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"
)

type MockOpenIDDiscoveryServer Uses

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

    // If both TLSKeyFile and TLSCertFile are set, Start() will attempt to start a HTTPS server.
    TLSKeyFile  string
    TLSCertFile string
    // contains filtered or unexported fields
}

MockOpenIDDiscoveryServer is the in-memory openID discovery server.

func StartNewServer Uses

func StartNewServer() (*MockOpenIDDiscoveryServer, error)

StartNewServer creates a mock openID discovery server and starts it

func StartNewTLSServer Uses

func StartNewTLSServer(tlsCert, tlsKey string) (*MockOpenIDDiscoveryServer, error)

StartNewTLSServer creates a mock openID discovery server that serves HTTPS and starts it

func (*MockOpenIDDiscoveryServer) Start Uses

func (ms *MockOpenIDDiscoveryServer) Start() error

Start starts the mock server.

func (*MockOpenIDDiscoveryServer) Stop Uses

func (ms *MockOpenIDDiscoveryServer) Stop() error

Stop stops he mock server.

Package test imports 11 packages (graph). Updated 2019-10-22. Refresh now. Tools for package owners.