cloud

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cloud provides cloud generic operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Azure

type Azure struct {
	Client azure.AZer
	// CredentialsFile is the path to a JSON formatted file containing client_id, client_secret and tenant of a
	// ServicePrincipal that is allowed to access the MasterKeyVault and AzureRM.
	CredentialsFile string
	// Vault is the name of the KeyVault to access.
	Vault string

	Log logr.Logger
	// contains filtered or unexported fields
}

func (*Azure) Login

func (a *Azure) Login() (*ServicePrincipal, error)

Login performs a cloud provider login (a prerequisite for most cli commands)

func (*Azure) VaultGet

func (a *Azure) VaultGet(name, field string) (string, error)

VaultGet reads a secret from a vault. Vault access is rate limited to once per 5m.

type Cloud

type Cloud interface {
	// Login perform cloud provider login.
	Login() (*ServicePrincipal, error)
	// VaultGet reads a secret from a vault.
	VaultGet(name, field string) (string, error)
}

type Fake

type Fake struct {
}

func (Fake) Login

func (f Fake) Login() (*ServicePrincipal, error)

func (Fake) VaultGet

func (f Fake) VaultGet(name, field string) (string, error)

type ServicePrincipal

type ServicePrincipal struct {
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	Tenant       string `json:"tenant"`
}

Jump to

Keyboard shortcuts

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