cloud

package
v0.24.10 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Endpoint to the google metadata server, which provides access tokens.
	// See: https://cloud.google.com/compute/docs/access/authenticate-workloads
	GoogleMetadataServerTokenEndpoint = "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token"
)

Variables

View Source
var (
	ErrUnexpectedHost = errors.New("Unexpected host")
)
View Source
var (
	ErrUnexpectedResponse = errors.New("Unexpected response")
)

Functions

This section is empty.

Types

type AWSProvider added in v0.17.0

type AWSProvider struct {
	HttpClient *http.Client
	Host       string
}

AWSProvider is the dedicated provider for accessing AWS services.

func (*AWSProvider) FetchCredentials added in v0.17.0

func (provider *AWSProvider) FetchCredentials(ctx context.Context) (*Credentials, error)

type AzureProvider added in v0.19.0

type AzureProvider struct {
	HttpClient *http.Client
	Host       string
}

AzureProvider is the dedicated provider for accessing Azure cloud services.

func (*AzureProvider) FetchCredentials added in v0.19.0

func (provider *AzureProvider) FetchCredentials(ctx context.Context) (*Credentials, error)

type Credentials

type Credentials struct {
	Username string
	Password string
}

Temporary workload credentials used for cloud provider authentication and accessing cloud provider services.

type GCPProvider added in v0.17.0

type GCPProvider struct {
	HttpClient *http.Client
}

GCPProvider is the dedicated provider for accessing Google Cloud services.

func (*GCPProvider) FetchCredentials added in v0.17.0

func (provider *GCPProvider) FetchCredentials(ctx context.Context) (*Credentials, error)

type GoogleToken

type GoogleToken struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
	TokenType   string `json:"token_type"`
}

Access token for accessing google services like artifact registry.

type Provider added in v0.17.0

type Provider interface {
	// FetchCredentials uses the configured provider identity and access management approach to receive temporary credentials for accessing cloud provider services, like container registries.
	FetchCredentials(context.Context) (*Credentials, error)
}

A Provider is a widely recognized cloud computing platform that provides several services for managing access and hosting containers.

func GetProvider added in v0.17.0

func GetProvider(providerID ProviderID, host string, httpClient *http.Client) Provider

GetProvider constructs a cloud Provider based on the given identifier or nil if no provider for given identifier could be constructed. Currently supported: gcp, aws, azure

type ProviderID added in v0.17.0

type ProviderID string
const (
	AWS   ProviderID = "aws"
	GCP   ProviderID = "gcp"
	Azure ProviderID = "azure"
)

Jump to

Keyboard shortcuts

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