cred

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 14 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverLocation added in v0.3.3

func DiscoverLocation(ctx context.Context, name string) string

DiscoverLocation discover cred location

func TargetType added in v0.3.1

func TargetType(target string) (reflect.Type, error)

TargetType returns target type for string

Types

type Aws

type Aws struct {
	Id       string      `json:",omitempty"`
	Endpoint string      `json:",omitempty"`
	Region   string      `json:",omitempty"`
	Token    string      `json:",omitempty"`
	Session  *AwsSession `json:",omitempty"`
	SecretKey
}

Aws represents AWS credentials

type AwsSession added in v0.3.2

type AwsSession struct {
	RoleArn string `json:",omitempty"`
	Name    string `json:",omitempty"`
}

Aws represents AWS credentials

type Basic

type Basic struct {
	Endpoint          string `json:",omitempty"`
	Email             string `json:",omitempty"`
	Username          string `json:",omitempty"`
	Password          string `json:",omitempty"`
	EncryptedPassword string `json:",omitempty"`
}

Basic represents basic credentials

func (*Basic) Cipher

func (b *Basic) Cipher(ctx context.Context, key *kms.Key) error

Cipher ciphers password to encrypted password, clears password after that

func (*Basic) Decipher

func (b *Basic) Decipher(ctx context.Context, key *kms.Key) error

Decipher deciphers EncryptedPassword or returns error

type Generic

type Generic struct {
	SSH
	JwtConfig
	Aws
}

Generic represents generic credentials

func (*Generic) Cipher

func (g *Generic) Cipher(ctx context.Context, key *kms.Key) error

func (*Generic) Decipher

func (g *Generic) Decipher(ctx context.Context, key *kms.Key) error

func (*Generic) NewJWTConfig added in v0.8.0

func (c *Generic) NewJWTConfig(scopes ...string) (*jwt.Config, error)

NewJWTConfig returns new JWT config for supplied scopes

type JwtConfig

type JwtConfig struct {
	ClientEmail             string   `json:"client_email,omitempty"`
	TokenURL                string   `json:"token_url,omitempty"`
	PrivateKey              string   `json:"private_key,omitempty"`
	PrivateKeyID            string   `json:"private_key_id,omitempty"`
	ProjectID               string   `json:"project_id,omitempty"`
	TokenURI                string   `json:"token_uri,omitempty"`
	Type                    string   `json:"type,omitempty"`
	ClientX509CertURL       string   `json:"client_x509_cert_url,omitempty"`
	AuthProviderX509CertURL string   `json:"auth_provider_x509_cert_url,omitempty"`
	Scopes                  []string `json:",omitempty"`
}

JwtConfig represents jws config

type SHA1

type SHA1 struct {
	Key                   string `json:",omitempty"`
	EncryptedKey          string `json:",omitempty"`
	IntegrityKey          string `json:",omitempty"`
	EncryptedIntegrityKey string `json:",omitempty"`
}

SHA1 represents sha1 key secrets

func (*SHA1) Cipher

func (b *SHA1) Cipher(ctx context.Context, key *kms.Key) error

Cipher ciphers password to encrypted password, clears password after that

func (*SHA1) Decipher

func (b *SHA1) Decipher(ctx context.Context, key *kms.Key) error

Decipher deciphers EncryptedSecret or returns error

type SSH

type SSH struct {
	Basic
	PrivateKeyPath              string `json:",omitempty"`
	PrivateKeyPayload           []byte `json:",omitempty"`
	PrivateKeyPassword          string `json:",omitempty"`
	EncryptedPrivateKey         string `json:",omitempty"`
	EncryptedPrivateKeyPassword string `json:",omitempty"`
}

SSH represents SSH config

func (*SSH) Cipher

func (b *SSH) Cipher(ctx context.Context, key *kms.Key) error

Cipher ciphers sensitive data or error

func (*SSH) Config added in v0.7.0

func (s *SSH) Config(ctx context.Context) (*ssh.ClientConfig, error)

func (*SSH) Decipher

func (b *SSH) Decipher(ctx context.Context, key *kms.Key) error

Decipher deciphers sensitive data or error

func (*SSH) LoadPrivateKey added in v0.7.0

func (s *SSH) LoadPrivateKey(ctx context.Context) error

type SecretKey added in v0.9.3

type SecretKey struct {
	Key             string `json:",omitempty" yaml:"Key"`
	Secret          string `json:",omitempty" yaml:"Secret"`
	EncryptedSecret string `json:",omitempty" yaml:"EncryptedSecret"`
}

SecretKey represents a key

func (*SecretKey) Cipher added in v0.9.3

func (b *SecretKey) Cipher(ctx context.Context, key *kms.Key) error

Cipher ciphers password to encrypted password, clears password after that

func (*SecretKey) Decipher added in v0.9.3

func (b *SecretKey) Decipher(ctx context.Context, key *kms.Key) error

Decipher deciphers EncryptedSecret or returns error

func (*SecretKey) SetEnv added in v0.9.3

func (k *SecretKey) SetEnv() error

SetEnv sets env

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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