internal

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheGetK8sConfigOutput

func CacheGetK8sConfigOutput(cacheKey string, tenantName string) (creds *clientauthv1beta1.ExecCredential)

CacheGetAwsConfigOutput tries to read prior K8s creds from the cache.

func DieIf

func DieIf(err error, msg string)

func Fatal

func Fatal(msg string, err error)

func MustInitCache

func MustInitCache(cmd string, disabled bool)

MustInitCache initializes the cacheDir or panics.

func OutputAwsCreds

func OutputAwsCreds(creds *AwsConfigOutput, cacheKey string)

func OutputDuploCreds

func OutputDuploCreds(creds *DuploCredsOutput)

func OutputK8sCreds

func OutputK8sCreds(creds *clientauthv1beta1.ExecCredential, cacheKey string)

func PingAWSCreds added in v0.5.5

func PingAWSCreds(creds *AwsConfigOutput) error

func PingDuploCreds added in v0.5.5

func PingDuploCreds(creds *DuploCredsOutput, host string) error

func PingK8sCreds added in v0.5.5

func PingK8sCreds(creds *clientauthv1beta1.ExecCredential, tenantName string) error

Types

type AwsConfigOutput

type AwsConfigOutput struct {
	Version         int    `json:"Version"`
	ConsoleUrl      string `json:"ConsoleUrl"`
	AccessKeyId     string `json:"AccessKeyId"`
	SecretAccessKey string `json:"SecretAccessKey"`
	Region          string `json:"Region"`
	SessionToken    string `json:"SessionToken,omitempty"`
	Expiration      string `json:"Expiration,omitempty"`
}

func CacheGetAwsConfigOutput

func CacheGetAwsConfigOutput(cacheKey string) (creds *AwsConfigOutput)

CacheGetAwsConfigOutput tries to read prior AWS creds from the cache.

func ConvertAwsCreds

func ConvertAwsCreds(creds *duplocloud.AwsJitCredentials) *AwsConfigOutput

type DuploCredsOutput

type DuploCredsOutput struct {
	Version    int    `json:"Version"`
	DuploToken string `json:"DuploToken,omitempty"`
	NeedOTP    bool   `json:"NeedOTP"`
}

func CacheGetDuploOutput

func CacheGetDuploOutput(cacheKey string, host string) (creds *DuploCredsOutput)

CacheGetDuploOutput tries to read prior AWS creds from the cache.

func MustDuploClient

func MustDuploClient(host, token string, interactive, admin bool) (client *duplocloud.Client, creds *DuploCredsOutput)

MustDuploClient retrieves a duplo client (and credentials) or panics.

type TokenResult

type TokenResult struct {
	Token string `json:"token"`
	OTP   string `json:"otp,omitempty"`
	// contains filtered or unexported fields
}

func MustTokenInteractive

func MustTokenInteractive(host string, admin bool, cmd string) (tokenResult TokenResult)

func TokenViaPost

func TokenViaPost(baseUrl string, admin bool, cmd string, timeout time.Duration) TokenResult

Jump to

Keyboard shortcuts

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