Documentation ¶
Overview ¶
Package credential is a generated GoMock package.
Package credential is a generated GoMock package.
Package credential is a generated GoMock package.
Index ¶
- Constants
- type AWSCredentialManagementClient
- func (cpm *AWSCredentialManagementClient) Delete(ctx context.Context, name string) (bool, error)
- func (cpm *AWSCredentialManagementClient) Get(ctx context.Context, credentialName string) (ProviderCredentialConfiguration, error)
- func (cpm *AWSCredentialManagementClient) List(ctx context.Context) ([]CloudProviderStatus, error)
- func (cpm *AWSCredentialManagementClient) Put(ctx context.Context, credential ucp.AwsCredentialResource) error
- type AWSCredentialManagementClientInterface
- type AWSCredentialProperties
- type AzureCredentialManagementClient
- func (cpm *AzureCredentialManagementClient) Delete(ctx context.Context, name string) (bool, error)
- func (cpm *AzureCredentialManagementClient) Get(ctx context.Context, credentialName string) (ProviderCredentialConfiguration, error)
- func (cpm *AzureCredentialManagementClient) List(ctx context.Context) ([]CloudProviderStatus, error)
- func (cpm *AzureCredentialManagementClient) Put(ctx context.Context, credential ucp.AzureCredentialResource) error
- type AzureCredentialManagementClientInterface
- type AzureCredentialProperties
- type CloudProviderStatus
- type CredentialManagementClient
- type ErrUnsupportedCloudProvider
- type MockAWSCredentialManagementClientInterface
- func (m *MockAWSCredentialManagementClientInterface) Delete(arg0 context.Context, arg1 string) (bool, error)
- func (m *MockAWSCredentialManagementClientInterface) EXPECT() *MockAWSCredentialManagementClientInterfaceMockRecorder
- func (m *MockAWSCredentialManagementClientInterface) Get(arg0 context.Context, arg1 string) (ProviderCredentialConfiguration, error)
- func (m *MockAWSCredentialManagementClientInterface) List(arg0 context.Context) ([]CloudProviderStatus, error)
- func (m *MockAWSCredentialManagementClientInterface) Put(arg0 context.Context, arg1 v20231001preview.AwsCredentialResource) error
- type MockAWSCredentialManagementClientInterfaceMockRecorder
- func (mr *MockAWSCredentialManagementClientInterfaceMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockAWSCredentialManagementClientInterfaceMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockAWSCredentialManagementClientInterfaceMockRecorder) List(arg0 interface{}) *gomock.Call
- func (mr *MockAWSCredentialManagementClientInterfaceMockRecorder) Put(arg0, arg1 interface{}) *gomock.Call
- type MockAzureCredentialManagementClientInterface
- func (m *MockAzureCredentialManagementClientInterface) Delete(arg0 context.Context, arg1 string) (bool, error)
- func (m *MockAzureCredentialManagementClientInterface) EXPECT() *MockAzureCredentialManagementClientInterfaceMockRecorder
- func (m *MockAzureCredentialManagementClientInterface) Get(arg0 context.Context, arg1 string) (ProviderCredentialConfiguration, error)
- func (m *MockAzureCredentialManagementClientInterface) List(arg0 context.Context) ([]CloudProviderStatus, error)
- func (m *MockAzureCredentialManagementClientInterface) Put(arg0 context.Context, arg1 v20231001preview.AzureCredentialResource) error
- type MockAzureCredentialManagementClientInterfaceMockRecorder
- func (mr *MockAzureCredentialManagementClientInterfaceMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockAzureCredentialManagementClientInterfaceMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockAzureCredentialManagementClientInterfaceMockRecorder) List(arg0 interface{}) *gomock.Call
- func (mr *MockAzureCredentialManagementClientInterfaceMockRecorder) Put(arg0, arg1 interface{}) *gomock.Call
- type MockCredentialManagementClient
- func (m *MockCredentialManagementClient) Delete(arg0 context.Context, arg1 string) (bool, error)
- func (m *MockCredentialManagementClient) EXPECT() *MockCredentialManagementClientMockRecorder
- func (m *MockCredentialManagementClient) Get(arg0 context.Context, arg1 string) (ProviderCredentialConfiguration, error)
- func (m *MockCredentialManagementClient) List(arg0 context.Context) ([]CloudProviderStatus, error)
- func (m *MockCredentialManagementClient) PutAWS(arg0 context.Context, arg1 v20231001preview.AwsCredentialResource) error
- func (m *MockCredentialManagementClient) PutAzure(arg0 context.Context, arg1 v20231001preview.AzureCredentialResource) error
- type MockCredentialManagementClientMockRecorder
- func (mr *MockCredentialManagementClientMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockCredentialManagementClientMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockCredentialManagementClientMockRecorder) List(arg0 interface{}) *gomock.Call
- func (mr *MockCredentialManagementClientMockRecorder) PutAWS(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockCredentialManagementClientMockRecorder) PutAzure(arg0, arg1 interface{}) *gomock.Call
- type ProviderCredentialConfiguration
- type UCPCredentialManagementClient
- func (cpm *UCPCredentialManagementClient) Delete(ctx context.Context, providerName string) (bool, error)
- func (cpm *UCPCredentialManagementClient) Get(ctx context.Context, providerName string) (ProviderCredentialConfiguration, error)
- func (cpm *UCPCredentialManagementClient) List(ctx context.Context) ([]CloudProviderStatus, error)
- func (cpm *UCPCredentialManagementClient) PutAWS(ctx context.Context, credential ucp.AwsCredentialResource) error
- func (cpm *UCPCredentialManagementClient) PutAzure(ctx context.Context, credential ucp.AzureCredentialResource) error
Constants ¶
const ( AWSCredential = "aws" AWSPlaneName = "aws" ValidInfoTemplate = "enter valid info for %s" )
const ( AzureCredential = "azure" AzurePlaneName = "azurecloud" )
const ( AzurePlaneType = "azure" AWSPlaneType = "aws" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWSCredentialManagementClient ¶
type AWSCredentialManagementClient struct {
AWSCredentialClient ucp.AwsCredentialsClient
}
AWSCredentialManagementClient is used to interface with cloud provider configuration and credentials.
func (*AWSCredentialManagementClient) Delete ¶
Delete checks if a credential for the provider plane is registered and if so, deletes it; if not, it returns true without an error. If an error occurs, it returns false and the error.
func (*AWSCredentialManagementClient) Get ¶
func (cpm *AWSCredentialManagementClient) Get(ctx context.Context, credentialName string) (ProviderCredentialConfiguration, error)
"Get" retrieves the credentials for the specified cloud provider from the backend and returns a ProviderCredentialConfiguration object containing the credentials or an error if the credentials could not be retrieved.
func (*AWSCredentialManagementClient) List ¶
func (cpm *AWSCredentialManagementClient) List(ctx context.Context) ([]CloudProviderStatus, error)
List retrieves a list of AWS credentials and returns a slice of CloudProviderStatus objects containing the name and enabled status of each credential. If an error occurs, an error is returned.
func (*AWSCredentialManagementClient) Put ¶
func (cpm *AWSCredentialManagementClient) Put(ctx context.Context, credential ucp.AwsCredentialResource) error
"Put" checks if the credential type is "AWSCredential" and if so, creates or updates the credential in the AWS plane, otherwise it returns an error.
type AWSCredentialManagementClientInterface ¶
type AWSCredentialManagementClientInterface interface { // Get gets the credential registered with the given ucp provider plane. Get(ctx context.Context, name string) (ProviderCredentialConfiguration, error) // List lists the credentials registered with all ucp provider planes. List(ctx context.Context) ([]CloudProviderStatus, error) // Put registers an AWS credential with the respective ucp provider plane. Put(ctx context.Context, credential_config ucp.AwsCredentialResource) error // Delete unregisters credential from the given ucp provider plane. Delete(ctx context.Context, name string) (bool, error) }
AWSCredentialManagementClient is used to interface with cloud provider configuration and credentials.
type AWSCredentialProperties ¶
type AWSCredentialProperties struct { // AccessKeyID is the access key ID for the AWS credential. AccessKeyID *string }
type AzureCredentialManagementClient ¶
type AzureCredentialManagementClient struct {
AzureCredentialClient ucp.AzureCredentialsClient
}
AzureCredentialManagementClient is used to interface with cloud provider configuration and credentials.
func (*AzureCredentialManagementClient) Delete ¶
"Delete" checks if the credential for the provider plane is registered and returns true if not found, otherwise returns false and an error if one occurs.
func (*AzureCredentialManagementClient) Get ¶
func (cpm *AzureCredentialManagementClient) Get(ctx context.Context, credentialName string) (ProviderCredentialConfiguration, error)
"Get" retrieves an AzureCredentialResource from the AzureCredentialClient and returns a ProviderCredentialConfiguration object, or an error if the retrieval fails.
func (*AzureCredentialManagementClient) List ¶
func (cpm *AzureCredentialManagementClient) List(ctx context.Context) ([]CloudProviderStatus, error)
List retrieves a list of Azure credentials and returns a slice of CloudProviderStatus objects containing the name and enabled status of each credential.
func (*AzureCredentialManagementClient) Put ¶
func (cpm *AzureCredentialManagementClient) Put(ctx context.Context, credential ucp.AzureCredentialResource) error
"Put" checks if the credential type is supported by the AzureCredentialManagementClient, and if so, creates or updates the credential in Azure, otherwise it returns an error.
type AzureCredentialManagementClientInterface ¶
type AzureCredentialManagementClientInterface interface { // Get gets the credential registered with the given ucp provider plane. Get(ctx context.Context, name string) (ProviderCredentialConfiguration, error) // List lists the credentials registered with all ucp provider planes. List(ctx context.Context) ([]CloudProviderStatus, error) // Put registers an AWS credential with the respective ucp provider plane. Put(ctx context.Context, credential_config ucp.AzureCredentialResource) error // Delete unregisters credential from the given ucp provider plane. Delete(ctx context.Context, name string) (bool, error) }
AzureCredentialManagementClient is used to interface with cloud provider configuration and credentials.
type CloudProviderStatus ¶
type CloudProviderStatus struct { // Name is the name/kind of the provider. For right now this only supports Azure and AWS. Name string // Enabled is the enabled/disabled status of the provider. Enabled bool }
CloudProviderStatus is the representation of a cloud provider configuration.
type CredentialManagementClient ¶
type CredentialManagementClient interface { // Get gets the credential registered with the given ucp provider plane. Get(ctx context.Context, providerName string) (ProviderCredentialConfiguration, error) // List lists the credentials registered with all ucp provider planes. List(ctx context.Context) ([]CloudProviderStatus, error) // PutAWS registers an AWS credential with the respective ucp provider plane. PutAWS(ctx context.Context, credential_config ucp.AwsCredentialResource) error // PutAzure registers an Azure credential with the respective ucp provider plane. PutAzure(ctx context.Context, credential_config ucp.AzureCredentialResource) error // Delete unregisters credential from the given ucp provider plane. Delete(ctx context.Context, providerName string) (bool, error) }
CredentialManagementClient is used to interface with cloud provider configuration and credentials.
type ErrUnsupportedCloudProvider ¶
type ErrUnsupportedCloudProvider struct {
Message string
}
ErrUnsupportedCloudProvider represents error when the cloud provider is not supported by radius.
func (*ErrUnsupportedCloudProvider) Error ¶
func (fe *ErrUnsupportedCloudProvider) Error() string
ErrUnsupportedCloudProvider's Error() function returns a string indicating an unsupported cloud provider when called.
func (*ErrUnsupportedCloudProvider) Is ¶
func (fe *ErrUnsupportedCloudProvider) Is(target error) bool
Is() checks if the target error is of type ErrUnsupportedCloudProvider and returns a boolean value indicating the result.
type MockAWSCredentialManagementClientInterface ¶
type MockAWSCredentialManagementClientInterface struct {
// contains filtered or unexported fields
}
MockAWSCredentialManagementClientInterface is a mock of AWSCredentialManagementClientInterface interface.
func NewMockAWSCredentialManagementClientInterface ¶
func NewMockAWSCredentialManagementClientInterface(ctrl *gomock.Controller) *MockAWSCredentialManagementClientInterface
NewMockAWSCredentialManagementClientInterface creates a new mock instance.
func (*MockAWSCredentialManagementClientInterface) Delete ¶
func (m *MockAWSCredentialManagementClientInterface) Delete(arg0 context.Context, arg1 string) (bool, error)
Delete mocks base method.
func (*MockAWSCredentialManagementClientInterface) EXPECT ¶
func (m *MockAWSCredentialManagementClientInterface) EXPECT() *MockAWSCredentialManagementClientInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockAWSCredentialManagementClientInterface) Get ¶
func (m *MockAWSCredentialManagementClientInterface) Get(arg0 context.Context, arg1 string) (ProviderCredentialConfiguration, error)
Get mocks base method.
func (*MockAWSCredentialManagementClientInterface) List ¶
func (m *MockAWSCredentialManagementClientInterface) List(arg0 context.Context) ([]CloudProviderStatus, error)
List mocks base method.
func (*MockAWSCredentialManagementClientInterface) Put ¶
func (m *MockAWSCredentialManagementClientInterface) Put(arg0 context.Context, arg1 v20231001preview.AwsCredentialResource) error
Put mocks base method.
type MockAWSCredentialManagementClientInterfaceMockRecorder ¶
type MockAWSCredentialManagementClientInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockAWSCredentialManagementClientInterfaceMockRecorder is the mock recorder for MockAWSCredentialManagementClientInterface.
func (*MockAWSCredentialManagementClientInterfaceMockRecorder) Delete ¶
func (mr *MockAWSCredentialManagementClientInterfaceMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockAWSCredentialManagementClientInterfaceMockRecorder) Get ¶
func (mr *MockAWSCredentialManagementClientInterfaceMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call
Get indicates an expected call of Get.
func (*MockAWSCredentialManagementClientInterfaceMockRecorder) List ¶
func (mr *MockAWSCredentialManagementClientInterfaceMockRecorder) List(arg0 interface{}) *gomock.Call
List indicates an expected call of List.
func (*MockAWSCredentialManagementClientInterfaceMockRecorder) Put ¶
func (mr *MockAWSCredentialManagementClientInterfaceMockRecorder) Put(arg0, arg1 interface{}) *gomock.Call
Put indicates an expected call of Put.
type MockAzureCredentialManagementClientInterface ¶
type MockAzureCredentialManagementClientInterface struct {
// contains filtered or unexported fields
}
MockAzureCredentialManagementClientInterface is a mock of AzureCredentialManagementClientInterface interface.
func NewMockAzureCredentialManagementClientInterface ¶
func NewMockAzureCredentialManagementClientInterface(ctrl *gomock.Controller) *MockAzureCredentialManagementClientInterface
NewMockAzureCredentialManagementClientInterface creates a new mock instance.
func (*MockAzureCredentialManagementClientInterface) Delete ¶
func (m *MockAzureCredentialManagementClientInterface) Delete(arg0 context.Context, arg1 string) (bool, error)
Delete mocks base method.
func (*MockAzureCredentialManagementClientInterface) EXPECT ¶
func (m *MockAzureCredentialManagementClientInterface) EXPECT() *MockAzureCredentialManagementClientInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockAzureCredentialManagementClientInterface) Get ¶
func (m *MockAzureCredentialManagementClientInterface) Get(arg0 context.Context, arg1 string) (ProviderCredentialConfiguration, error)
Get mocks base method.
func (*MockAzureCredentialManagementClientInterface) List ¶
func (m *MockAzureCredentialManagementClientInterface) List(arg0 context.Context) ([]CloudProviderStatus, error)
List mocks base method.
func (*MockAzureCredentialManagementClientInterface) Put ¶
func (m *MockAzureCredentialManagementClientInterface) Put(arg0 context.Context, arg1 v20231001preview.AzureCredentialResource) error
Put mocks base method.
type MockAzureCredentialManagementClientInterfaceMockRecorder ¶
type MockAzureCredentialManagementClientInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockAzureCredentialManagementClientInterfaceMockRecorder is the mock recorder for MockAzureCredentialManagementClientInterface.
func (*MockAzureCredentialManagementClientInterfaceMockRecorder) Delete ¶
func (mr *MockAzureCredentialManagementClientInterfaceMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockAzureCredentialManagementClientInterfaceMockRecorder) Get ¶
func (mr *MockAzureCredentialManagementClientInterfaceMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call
Get indicates an expected call of Get.
func (*MockAzureCredentialManagementClientInterfaceMockRecorder) List ¶
func (mr *MockAzureCredentialManagementClientInterfaceMockRecorder) List(arg0 interface{}) *gomock.Call
List indicates an expected call of List.
func (*MockAzureCredentialManagementClientInterfaceMockRecorder) Put ¶
func (mr *MockAzureCredentialManagementClientInterfaceMockRecorder) Put(arg0, arg1 interface{}) *gomock.Call
Put indicates an expected call of Put.
type MockCredentialManagementClient ¶
type MockCredentialManagementClient struct {
// contains filtered or unexported fields
}
MockCredentialManagementClient is a mock of CredentialManagementClient interface.
func NewMockCredentialManagementClient ¶
func NewMockCredentialManagementClient(ctrl *gomock.Controller) *MockCredentialManagementClient
NewMockCredentialManagementClient creates a new mock instance.
func (*MockCredentialManagementClient) EXPECT ¶
func (m *MockCredentialManagementClient) EXPECT() *MockCredentialManagementClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockCredentialManagementClient) Get ¶
func (m *MockCredentialManagementClient) Get(arg0 context.Context, arg1 string) (ProviderCredentialConfiguration, error)
Get mocks base method.
func (*MockCredentialManagementClient) List ¶
func (m *MockCredentialManagementClient) List(arg0 context.Context) ([]CloudProviderStatus, error)
List mocks base method.
func (*MockCredentialManagementClient) PutAWS ¶
func (m *MockCredentialManagementClient) PutAWS(arg0 context.Context, arg1 v20231001preview.AwsCredentialResource) error
PutAWS mocks base method.
func (*MockCredentialManagementClient) PutAzure ¶
func (m *MockCredentialManagementClient) PutAzure(arg0 context.Context, arg1 v20231001preview.AzureCredentialResource) error
PutAzure mocks base method.
type MockCredentialManagementClientMockRecorder ¶
type MockCredentialManagementClientMockRecorder struct {
// contains filtered or unexported fields
}
MockCredentialManagementClientMockRecorder is the mock recorder for MockCredentialManagementClient.
func (*MockCredentialManagementClientMockRecorder) Delete ¶
func (mr *MockCredentialManagementClientMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockCredentialManagementClientMockRecorder) Get ¶
func (mr *MockCredentialManagementClientMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call
Get indicates an expected call of Get.
func (*MockCredentialManagementClientMockRecorder) List ¶
func (mr *MockCredentialManagementClientMockRecorder) List(arg0 interface{}) *gomock.Call
List indicates an expected call of List.
func (*MockCredentialManagementClientMockRecorder) PutAWS ¶
func (mr *MockCredentialManagementClientMockRecorder) PutAWS(arg0, arg1 interface{}) *gomock.Call
PutAWS indicates an expected call of PutAWS.
func (*MockCredentialManagementClientMockRecorder) PutAzure ¶
func (mr *MockCredentialManagementClientMockRecorder) PutAzure(arg0, arg1 interface{}) *gomock.Call
PutAzure indicates an expected call of PutAzure.
type ProviderCredentialConfiguration ¶
type ProviderCredentialConfiguration struct { CloudProviderStatus // AzureCredentials is used to set the credentials on Puts. It is NOT returned on Get/List. AzureCredentials *AzureCredentialProperties // AWSCredentials is used to set the credentials on Puts. It is NOT returned on Get/List. AWSCredentials *AWSCredentialProperties }
type UCPCredentialManagementClient ¶
type UCPCredentialManagementClient struct { AzClient AzureCredentialManagementClientInterface AWSClient AWSCredentialManagementClientInterface }
UCPCredentialManagementClient implements operations to manage credentials on ucp.
func (*UCPCredentialManagementClient) Delete ¶
func (cpm *UCPCredentialManagementClient) Delete(ctx context.Context, providerName string) (bool, error)
Delete() checks the provider name and calls the appropriate client's Delete function to delete the default secret name. It returns a boolean and an error if the provider name is invalid.
func (*UCPCredentialManagementClient) Get ¶
func (cpm *UCPCredentialManagementClient) Get(ctx context.Context, providerName string) (ProviderCredentialConfiguration, error)
Get retrieves the credential configuration for the specified cloud provider from the backend, or returns an error if the credential is not found or an error occurs. If the credential is not found, an empty credential configuration with the cloud provider's status set to disabled is returned.
func (*UCPCredentialManagementClient) List ¶
func (cpm *UCPCredentialManagementClient) List(ctx context.Context) ([]CloudProviderStatus, error)
List() lists the credentials from both Azure and AWS and returns a slice of CloudProviderStatus. It returns an error if either of the list operations fail.
func (*UCPCredentialManagementClient) PutAWS ¶
func (cpm *UCPCredentialManagementClient) PutAWS(ctx context.Context, credential ucp.AwsCredentialResource) error
PutAWS function takes in a context and an AWSCredentialResource object and returns an error if the AWSClient.Put call fails.
func (*UCPCredentialManagementClient) PutAzure ¶
func (cpm *UCPCredentialManagementClient) PutAzure(ctx context.Context, credential ucp.AzureCredentialResource) error
PutAzure takes in a context and an AzureCredentialResource object and attempts to store it through the Azure Client, returning an error if unsuccessful.