Documentation

Overview

    This is Google plugin of credentialfetcher.

    Test only: this is the mock plugin of credentialfetcher.

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    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

        func CreateGCEPlugin(audience, jwtPath, identityProvider string) *GCEPlugin

          CreateGCEPlugin creates a Google credential fetcher plugin. Return the pointer to the created plugin.

          func (*GCEPlugin) GetIdentityProvider

          func (p *GCEPlugin) GetIdentityProvider() string

            GetIdentityProvider returns the name of the identity provider that can authenticate the workload credential. GCE idenity provider is named "GoogleComputeEngine".

            func (*GCEPlugin) GetPlatformCredential

            func (p *GCEPlugin) GetPlatformCredential() (string, error)

              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.

              func (*GCEPlugin) GetType

              func (p *GCEPlugin) GetType() string

                GetType returns credential fetcher type.

                func (*GCEPlugin) Stop

                func (p *GCEPlugin) Stop()

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

                                  Source Files