auth

package
v0.0.0-...-111e786 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidCredentialsJSON = errors.New("invalid credentials JSON")
View Source
var ErrMissingOrgId = errors.New("organization ID is required for organization account type")
View Source
var ErrProjectNotFound = errors.New("no project ID was found")

Functions

This section is empty.

Types

type ConfigProvider

type ConfigProvider struct {
	AuthProvider GoogleAuthProviderAPI
}

func (*ConfigProvider) GetGcpClientConfig

func (p *ConfigProvider) GetGcpClientConfig(ctx context.Context, cfg config.GcpConfig, log *logp.Logger) (*GcpFactoryConfig, error)

type ConfigProviderAPI

type ConfigProviderAPI interface {
	GetGcpClientConfig(ctx context.Context, cfg config.GcpConfig, log *logp.Logger) (*GcpFactoryConfig, error)
}

type GcpFactoryConfig

type GcpFactoryConfig struct {
	// organizations/%s or projects/%s
	Parent     string
	ClientOpts []option.ClientOption
}

type GoogleAuthProvider

type GoogleAuthProvider struct{}

func (*GoogleAuthProvider) FindDefaultCredentials

func (p *GoogleAuthProvider) FindDefaultCredentials(ctx context.Context) (*google.Credentials, error)

FindDefaultCredentials is a wrapper around google.FindDefaultCredentials to make it easier to mock

type GoogleAuthProviderAPI

type GoogleAuthProviderAPI interface {
	FindDefaultCredentials(ctx context.Context) (*google.Credentials, error)
}

type MockConfigProviderAPI

type MockConfigProviderAPI struct {
	mock.Mock
}

MockConfigProviderAPI is an autogenerated mock type for the ConfigProviderAPI type

func NewMockConfigProviderAPI

func NewMockConfigProviderAPI(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockConfigProviderAPI

NewMockConfigProviderAPI creates a new instance of MockConfigProviderAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockConfigProviderAPI) EXPECT

func (*MockConfigProviderAPI) GetGcpClientConfig

func (_m *MockConfigProviderAPI) GetGcpClientConfig(ctx context.Context, cfg config.GcpConfig, log *logp.Logger) (*GcpFactoryConfig, error)

GetGcpClientConfig provides a mock function with given fields: ctx, cfg, log

type MockConfigProviderAPI_Expecter

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

func (*MockConfigProviderAPI_Expecter) GetGcpClientConfig

func (_e *MockConfigProviderAPI_Expecter) GetGcpClientConfig(ctx interface{}, cfg interface{}, log interface{}) *MockConfigProviderAPI_GetGcpClientConfig_Call

GetGcpClientConfig is a helper method to define mock.On call

  • ctx context.Context
  • cfg config.GcpConfig
  • log *logp.Logger

type MockConfigProviderAPI_GetGcpClientConfig_Call

type MockConfigProviderAPI_GetGcpClientConfig_Call struct {
	*mock.Call
}

MockConfigProviderAPI_GetGcpClientConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGcpClientConfig'

func (*MockConfigProviderAPI_GetGcpClientConfig_Call) Return

func (*MockConfigProviderAPI_GetGcpClientConfig_Call) Run

func (*MockConfigProviderAPI_GetGcpClientConfig_Call) RunAndReturn

type MockGoogleAuthProviderAPI

type MockGoogleAuthProviderAPI struct {
	mock.Mock
}

MockGoogleAuthProviderAPI is an autogenerated mock type for the GoogleAuthProviderAPI type

func NewMockGoogleAuthProviderAPI

func NewMockGoogleAuthProviderAPI(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockGoogleAuthProviderAPI

NewMockGoogleAuthProviderAPI creates a new instance of MockGoogleAuthProviderAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockGoogleAuthProviderAPI) EXPECT

func (*MockGoogleAuthProviderAPI) FindDefaultCredentials

func (_m *MockGoogleAuthProviderAPI) FindDefaultCredentials(ctx context.Context) (*google.Credentials, error)

FindDefaultCredentials provides a mock function with given fields: ctx

type MockGoogleAuthProviderAPI_Expecter

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

func (*MockGoogleAuthProviderAPI_Expecter) FindDefaultCredentials

FindDefaultCredentials is a helper method to define mock.On call

  • ctx context.Context

type MockGoogleAuthProviderAPI_FindDefaultCredentials_Call

type MockGoogleAuthProviderAPI_FindDefaultCredentials_Call struct {
	*mock.Call
}

MockGoogleAuthProviderAPI_FindDefaultCredentials_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindDefaultCredentials'

func (*MockGoogleAuthProviderAPI_FindDefaultCredentials_Call) Return

func (*MockGoogleAuthProviderAPI_FindDefaultCredentials_Call) Run

func (*MockGoogleAuthProviderAPI_FindDefaultCredentials_Call) RunAndReturn

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL