auth

package
v0.0.0-...-f1aca4a Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongCredentialsType       = errors.New("wrong credentials type")
	ErrIncompleteUsernamePassword = errors.New("incomplete username and password credentials")
)

Functions

This section is empty.

Types

type AzureAuthProvider

type AzureAuthProvider struct{}

func (*AzureAuthProvider) FindCertificateCredential

func (a *AzureAuthProvider) FindCertificateCredential(tenantID string, clientID string, certPath string, password string, options *azidentity.ClientCertificateCredentialOptions) (*azidentity.ClientCertificateCredential, error)

FindCertificateCredential is a wrapper around azidentity.NewClientCertificateCredential and azidentity.ParseCertificates that loads certificates and a private key, in PEM or PKCS12 format.

func (*AzureAuthProvider) FindClientSecretCredentials

func (a *AzureAuthProvider) FindClientSecretCredentials(tenantID string, clientID string, clientSecret string, options *azidentity.ClientSecretCredentialOptions) (*azidentity.ClientSecretCredential, error)

FindClientSecretCredentials is a wrapper around azidentity.NewClientSecretCredential to make it easier to mock

func (*AzureAuthProvider) FindDefaultCredentials

FindDefaultCredentials is a wrapper around azidentity.NewDefaultAzureCredential to make it easier to mock

func (*AzureAuthProvider) FindUsernamePasswordCredentials

func (a *AzureAuthProvider) FindUsernamePasswordCredentials(tenantID string, clientID string, username string, password string, options *azidentity.UsernamePasswordCredentialOptions) (*azidentity.UsernamePasswordCredential, error)

FindUsernamePasswordCredentials is a wrapper around azidentity.NewUsernamePasswordCredential to make it easier to mock

type AzureAuthProviderAPI

type AzureAuthProviderAPI interface {
	FindDefaultCredentials(options *azidentity.DefaultAzureCredentialOptions) (*azidentity.DefaultAzureCredential, error)
	FindUsernamePasswordCredentials(tenantID string, clientID string, username string, password string, options *azidentity.UsernamePasswordCredentialOptions) (*azidentity.UsernamePasswordCredential, error)
	FindClientSecretCredentials(tenantID string, clientID string, clientSecret string, options *azidentity.ClientSecretCredentialOptions) (*azidentity.ClientSecretCredential, error)
	FindCertificateCredential(tenantID string, clientID string, certPath string, password string, options *azidentity.ClientCertificateCredentialOptions) (*azidentity.ClientCertificateCredential, error)
}

type AzureFactoryConfig

type AzureFactoryConfig struct {
	Credentials azcore.TokenCredential
}

type ConfigProvider

type ConfigProvider struct {
	AuthProvider AzureAuthProviderAPI
}

func (*ConfigProvider) GetAzureClientConfig

func (p *ConfigProvider) GetAzureClientConfig(cfg config.AzureConfig) (*AzureFactoryConfig, error)

type ConfigProviderAPI

type ConfigProviderAPI interface {
	GetAzureClientConfig(cfg config.AzureConfig) (*AzureFactoryConfig, error)
}

type MockAzureAuthProviderAPI

type MockAzureAuthProviderAPI struct {
	mock.Mock
}

MockAzureAuthProviderAPI is an autogenerated mock type for the AzureAuthProviderAPI type

func NewMockAzureAuthProviderAPI

func NewMockAzureAuthProviderAPI(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockAzureAuthProviderAPI

NewMockAzureAuthProviderAPI creates a new instance of MockAzureAuthProviderAPI. 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 (*MockAzureAuthProviderAPI) EXPECT

func (*MockAzureAuthProviderAPI) FindCertificateCredential

func (_m *MockAzureAuthProviderAPI) FindCertificateCredential(tenantID string, clientID string, certPath string, password string, options *azidentity.ClientCertificateCredentialOptions) (*azidentity.ClientCertificateCredential, error)

FindCertificateCredential provides a mock function with given fields: tenantID, clientID, certPath, password, options

func (*MockAzureAuthProviderAPI) FindClientSecretCredentials

func (_m *MockAzureAuthProviderAPI) FindClientSecretCredentials(tenantID string, clientID string, clientSecret string, options *azidentity.ClientSecretCredentialOptions) (*azidentity.ClientSecretCredential, error)

FindClientSecretCredentials provides a mock function with given fields: tenantID, clientID, clientSecret, options

func (*MockAzureAuthProviderAPI) FindDefaultCredentials

FindDefaultCredentials provides a mock function with given fields: options

func (*MockAzureAuthProviderAPI) FindUsernamePasswordCredentials

func (_m *MockAzureAuthProviderAPI) FindUsernamePasswordCredentials(tenantID string, clientID string, username string, password string, options *azidentity.UsernamePasswordCredentialOptions) (*azidentity.UsernamePasswordCredential, error)

FindUsernamePasswordCredentials provides a mock function with given fields: tenantID, clientID, username, password, options

type MockAzureAuthProviderAPI_Expecter

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

func (*MockAzureAuthProviderAPI_Expecter) FindCertificateCredential

func (_e *MockAzureAuthProviderAPI_Expecter) FindCertificateCredential(tenantID interface{}, clientID interface{}, certPath interface{}, password interface{}, options interface{}) *MockAzureAuthProviderAPI_FindCertificateCredential_Call

FindCertificateCredential is a helper method to define mock.On call

  • tenantID string
  • clientID string
  • certPath string
  • password string
  • options *azidentity.ClientCertificateCredentialOptions

func (*MockAzureAuthProviderAPI_Expecter) FindClientSecretCredentials

func (_e *MockAzureAuthProviderAPI_Expecter) FindClientSecretCredentials(tenantID interface{}, clientID interface{}, clientSecret interface{}, options interface{}) *MockAzureAuthProviderAPI_FindClientSecretCredentials_Call

FindClientSecretCredentials is a helper method to define mock.On call

  • tenantID string
  • clientID string
  • clientSecret string
  • options *azidentity.ClientSecretCredentialOptions

func (*MockAzureAuthProviderAPI_Expecter) FindDefaultCredentials

func (_e *MockAzureAuthProviderAPI_Expecter) FindDefaultCredentials(options interface{}) *MockAzureAuthProviderAPI_FindDefaultCredentials_Call

FindDefaultCredentials is a helper method to define mock.On call

  • options *azidentity.DefaultAzureCredentialOptions

func (*MockAzureAuthProviderAPI_Expecter) FindUsernamePasswordCredentials

func (_e *MockAzureAuthProviderAPI_Expecter) FindUsernamePasswordCredentials(tenantID interface{}, clientID interface{}, username interface{}, password interface{}, options interface{}) *MockAzureAuthProviderAPI_FindUsernamePasswordCredentials_Call

FindUsernamePasswordCredentials is a helper method to define mock.On call

  • tenantID string
  • clientID string
  • username string
  • password string
  • options *azidentity.UsernamePasswordCredentialOptions

type MockAzureAuthProviderAPI_FindCertificateCredential_Call

type MockAzureAuthProviderAPI_FindCertificateCredential_Call struct {
	*mock.Call
}

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

func (*MockAzureAuthProviderAPI_FindCertificateCredential_Call) Run

type MockAzureAuthProviderAPI_FindClientSecretCredentials_Call

type MockAzureAuthProviderAPI_FindClientSecretCredentials_Call struct {
	*mock.Call
}

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

func (*MockAzureAuthProviderAPI_FindClientSecretCredentials_Call) Run

type MockAzureAuthProviderAPI_FindDefaultCredentials_Call

type MockAzureAuthProviderAPI_FindDefaultCredentials_Call struct {
	*mock.Call
}

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

func (*MockAzureAuthProviderAPI_FindDefaultCredentials_Call) Run

type MockAzureAuthProviderAPI_FindUsernamePasswordCredentials_Call

type MockAzureAuthProviderAPI_FindUsernamePasswordCredentials_Call struct {
	*mock.Call
}

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

func (*MockAzureAuthProviderAPI_FindUsernamePasswordCredentials_Call) Run

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

func (_m *MockConfigProviderAPI) GetAzureClientConfig(cfg config.AzureConfig) (*AzureFactoryConfig, error)

GetAzureClientConfig provides a mock function with given fields: cfg

type MockConfigProviderAPI_Expecter

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

func (*MockConfigProviderAPI_Expecter) GetAzureClientConfig

func (_e *MockConfigProviderAPI_Expecter) GetAzureClientConfig(cfg interface{}) *MockConfigProviderAPI_GetAzureClientConfig_Call

GetAzureClientConfig is a helper method to define mock.On call

  • cfg config.AzureConfig

type MockConfigProviderAPI_GetAzureClientConfig_Call

type MockConfigProviderAPI_GetAzureClientConfig_Call struct {
	*mock.Call
}

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

func (*MockConfigProviderAPI_GetAzureClientConfig_Call) Return

func (*MockConfigProviderAPI_GetAzureClientConfig_Call) Run

func (*MockConfigProviderAPI_GetAzureClientConfig_Call) RunAndReturn

Jump to

Keyboard shortcuts

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