common

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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 PerRPCCredentials

type PerRPCCredentials struct {
	IamToken string
}

func (PerRPCCredentials) GetRequestMetadata

func (t PerRPCCredentials) GetRequestMetadata(ctx context.Context, in ...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 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) 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

func (p *YandexCloudProvider) ValidateStore(store esv1beta1.GenericStore) error

Directories

Path Synopsis
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

Jump to

Keyboard shortcuts

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