common

package
v0.9.16 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGrpcConnection

func NewGrpcConnection(
	ctx context.Context,
	apiEndpoint string,
	apiEndpointID string,
	authorizedKey *iamkey.Key,
	caCertificate []byte,
) (*grpc.ClientConn, error)

Creates a connection to the given Yandex.Cloud API endpoint.

Types

type AdaptInputFunc

type AdaptInputFunc func(store esv1beta1.GenericStore) (*SecretsClientInput, error)

type IamToken

type IamToken struct {
	Token     string
	ExpiresAt time.Time
}

func NewIamToken

func NewIamToken(ctx context.Context, apiEndpoint string, authorizedKey *iamkey.Key, caCertificate []byte) (*IamToken, error)

Exchanges the given authorized key to an IAM token.

type NewIamTokenFunc

type NewIamTokenFunc func(ctx context.Context, apiEndpoint string, authorizedKey *iamkey.Key, caCertificate []byte) (*IamToken, error)

type NewSecretGetterFunc

type NewSecretGetterFunc func(ctx context.Context, apiEndpoint string, authorizedKey *iamkey.Key, caCertificate []byte) (SecretGetter, error)

type NewSecretSetterFunc added in v0.7.0

type NewSecretSetterFunc func()

type PerRPCCredentials

type PerRPCCredentials struct {
	IamToken string
}

func (PerRPCCredentials) GetRequestMetadata

func (t PerRPCCredentials) GetRequestMetadata(_ context.Context, _ ...string) (map[string]string, error)

func (PerRPCCredentials) RequireTransportSecurity

func (PerRPCCredentials) RequireTransportSecurity() bool

type SecretGetter

type SecretGetter interface {
	GetSecret(ctx context.Context, iamToken, resourceID, versionID, property string) ([]byte, error)
	GetSecretMap(ctx context.Context, iamToken, resourceID, versionID string) (map[string][]byte, error)
}

Adapts the secrets received from a remote Yandex.Cloud service for the format expected by v1beta1.SecretsClient.

type SecretSetter added in v0.7.0

type SecretSetter interface {
	SetSecret() error
}

type SecretsClientInput

type SecretsClientInput struct {
	APIEndpoint   string
	AuthorizedKey esmeta.SecretKeySelector
	CACertificate *esmeta.SecretKeySelector
}

type YandexCloudProvider

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

Implementation of v1beta1.Provider.

func InitYandexCloudProvider

func InitYandexCloudProvider(
	logger logr.Logger,
	clock clock2.Clock,
	adaptInputFunc AdaptInputFunc,
	newSecretGetterFunc NewSecretGetterFunc,
	newIamTokenFunc NewIamTokenFunc,
	iamTokenCleanupDelay time.Duration,
) *YandexCloudProvider

func (*YandexCloudProvider) Capabilities added in v0.7.0

func (*YandexCloudProvider) CleanUpIamTokenMap

func (p *YandexCloudProvider) CleanUpIamTokenMap()

func (*YandexCloudProvider) IsIamTokenCached

func (p *YandexCloudProvider) IsIamTokenCached(authorizedKey *iamkey.Key) bool

Used for testing.

func (*YandexCloudProvider) NewClient

NewClient constructs a Yandex.Cloud Provider.

func (*YandexCloudProvider) ValidateStore

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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