istio: istio.io/istio/security/pkg/stsservice/mock Index | Files

package mock

import "istio.io/istio/security/pkg/stsservice/mock"

Index

Package Files

faketokenmanager.go xdsserver.go

func StartXDSServer Uses

func StartXDSServer(conf XDSConf, cb *XDSCallbacks, ls *DynamicListener, isTLS bool) (*grpc.Server, error)

StartXDSServer sets up a mock XDS server nolint: interfacer

type DynamicListener Uses

type DynamicListener struct {
    Port int
}

type FakeTokenManager Uses

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

func CreateFakeTokenManager Uses

func CreateFakeTokenManager() *FakeTokenManager

func (*FakeTokenManager) DumpTokenStatus Uses

func (tm *FakeTokenManager) DumpTokenStatus() ([]byte, error)

DumpTokenStatus returns fake token status, or error if dumpTokenError is set.

func (*FakeTokenManager) GenerateToken Uses

func (tm *FakeTokenManager) GenerateToken(_ stsservice.StsRequestParameters) ([]byte, error)

GenerateToken returns a fake token, or error if generateTokenError is set.

func (*FakeTokenManager) SetDumpTokenError Uses

func (tm *FakeTokenManager) SetDumpTokenError(err error)

func (*FakeTokenManager) SetGenerateTokenError Uses

func (tm *FakeTokenManager) SetGenerateTokenError(err error)

func (*FakeTokenManager) SetRespStsParam Uses

func (tm *FakeTokenManager) SetRespStsParam(p stsservice.StsResponseParameters)

func (*FakeTokenManager) SetToken Uses

func (tm *FakeTokenManager) SetToken(t stsservice.TokenInfo)

type XDSCallbacks Uses

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

func CreateXdsCallback Uses

func CreateXdsCallback(t *testing.T) *XDSCallbacks

func (*XDSCallbacks) ExpectedToken Uses

func (c *XDSCallbacks) ExpectedToken() string

func (*XDSCallbacks) NumStream Uses

func (c *XDSCallbacks) NumStream() int

func (*XDSCallbacks) NumTokenReceived Uses

func (c *XDSCallbacks) NumTokenReceived() int

func (*XDSCallbacks) OnFetchRequest Uses

func (c *XDSCallbacks) OnFetchRequest(context.Context, *api.DiscoveryRequest) error

func (*XDSCallbacks) OnFetchResponse Uses

func (c *XDSCallbacks) OnFetchResponse(*api.DiscoveryRequest, *api.DiscoveryResponse)

func (*XDSCallbacks) OnStreamClosed Uses

func (c *XDSCallbacks) OnStreamClosed(id int64)

func (*XDSCallbacks) OnStreamOpen Uses

func (c *XDSCallbacks) OnStreamOpen(ctx context.Context, id int64, url string) error

func (*XDSCallbacks) OnStreamRequest Uses

func (c *XDSCallbacks) OnStreamRequest(id int64, _ *api.DiscoveryRequest) error

func (*XDSCallbacks) OnStreamResponse Uses

func (c *XDSCallbacks) OnStreamResponse(id int64, _ *api.DiscoveryRequest, _ *api.DiscoveryResponse)

func (*XDSCallbacks) SetCallbackError Uses

func (c *XDSCallbacks) SetCallbackError(setErr bool)

func (*XDSCallbacks) SetExpectedToken Uses

func (c *XDSCallbacks) SetExpectedToken(expected string)

func (*XDSCallbacks) SetNumberOfStreamClose Uses

func (c *XDSCallbacks) SetNumberOfStreamClose(n int, d int)

SetNumberOfStreamClose force XDS server to close gRPC stream n times. Each stream will last d seconds before close.

type XDSConf Uses

type XDSConf struct {
    Port     int
    CertFile string
    KeyFile  string
}

XDSConf has config for XDS server

Package mock imports 25 packages (graph). Updated 2020-02-18. Refresh now. Tools for package owners.