Documentation
¶
Overview ¶
This is Google plugin of credentialfetcher.
Test only: this is the mock plugin of credentialfetcher.
Index ¶
Constants ¶
Variables ¶
Functions ¶
func SetTokenRotation ¶
func SetTokenRotation(enable bool)
SetTokenRotation enable/disable periodic token rotation job. This is only for testing purpose, not thread safe.
Types ¶
type GCEPlugin ¶
type GCEPlugin struct {
// contains filtered or unexported fields
}
The plugin object.
func CreateGCEPlugin ¶
CreateGCEPlugin creates a Google credential fetcher plugin. Return the pointer to the created plugin.
func (*GCEPlugin) GetIdentityProvider ¶
GetIdentityProvider returns the name of the identity provider that can authenticate the workload credential. GCE idenity provider is named "GoogleComputeEngine".
func (*GCEPlugin) GetPlatformCredential ¶
GetPlatformCredential fetches the GCE VM identity jwt token from its metadata server, and write it to jwtPath. The local copy of the token in jwtPath is used by both Envoy STS client and istio agent to fetch certificate and access token. Note: this function only works in a GCE VM environment.
type MetadataServer ¶
type MetadataServer struct {
// contains filtered or unexported fields
}
MetadataServer mocks GCE metadata server. nolint: maligned
func StartMetadataServer ¶
func StartMetadataServer() (*MetadataServer, error)
StartMetadataServer starts a mock GCE metadata server.
func (*MetadataServer) NumGetTokenCall ¶
func (ms *MetadataServer) NumGetTokenCall() int
NumGetTokenCall returns the number of token fetching request.
func (*MetadataServer) Reset ¶
func (ms *MetadataServer) Reset()
ResetGetTokenCall resets members to default values.
func (*MetadataServer) Stop ¶
func (ms *MetadataServer) Stop()
type MockPlugin ¶
type MockPlugin struct {
// contains filtered or unexported fields
}
The plugin object.
func CreateMockPlugin ¶
func CreateMockPlugin(token string) *MockPlugin
CreateMockPlugin creates a mock credential fetcher plugin. Return the pointer to the created plugin.
func (*MockPlugin) GetIdentityProvider ¶
func (p *MockPlugin) GetIdentityProvider() string
GetIdentityProvider returns the name of the identity provider that can authenticate the workload credential.
func (*MockPlugin) GetPlatformCredential ¶
func (p *MockPlugin) GetPlatformCredential() (string, error)
GetPlatformCredential returns a constant token string.
func (*MockPlugin) GetType ¶
func (p *MockPlugin) GetType() string
GetType returns credential fetcher type.
func (*MockPlugin) Stop ¶
func (p *MockPlugin) Stop()