vault

package
v0.0.0-...-24794f7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector struct {
	K8sSaVaultToken string

	RenewalInterval time.Duration
	Log             logger.Logger
	VaultRateLimit  int
	// contains filtered or unexported fields
}

func ConnectToVault

func ConnectToVault(ctx context.Context, cfg *config.Config) (*Connector, error)

func NewConnector

func NewConnector(address string, authPath string, authRole string, dbMountPath string, dbRole string, token string, VaultRateLimit int) *Connector

func (*Connector) CanIGetRoles

func (c *Connector) CanIGetRoles(serviceAccountName, namespace, vaultAuthPath, dbRole string) (bool, error)

func (*Connector) CreateOrphanToken

func (c *Connector) CreateOrphanToken(ctx context.Context, ttl string, policies []string) (string, error)

func (*Connector) DeleteData

func (c *Connector) DeleteData(ctx context.Context, podName, secretName, uuid, namespace, prefix string) (string, error)

func (*Connector) GetDbCredentials

func (c *Connector) GetDbCredentials(ctx context.Context, ttl, PodNameUID, namespace, secretName, prefix, serviceAccount string) (*DbCreds, error)

func (*Connector) GetKeyInformations

func (c *Connector) GetKeyInformations(ctx context.Context, podName, uuid, path, prefix string) (*KeyInformation, error)

func (*Connector) GetToken

func (c *Connector) GetToken() string

func (*Connector) HandlePodDeletionToken

func (c *Connector) HandlePodDeletionToken(ctx context.Context, keysInformation *KeyInformation, secretName, prefix string) error

func (*Connector) HandleTokens

func (c *Connector) HandleTokens(ctx context.Context, cfg *config.Config, keysInformations []*KeyInformation, secretName, prefix string, clientset k8s.KubernetesClient, SyncTTLSecond int) bool

func (*Connector) ListKeyInformations

func (c *Connector) ListKeyInformations(ctx context.Context, path, prefix string) ([]*KeyInformation, error)

func (*Connector) Login

func (c *Connector) Login(ctx context.Context) error

func (*Connector) RenewLease

func (c *Connector) RenewLease(ctx context.Context, leaseID string, leaseTTL int, uuid, namespace string) error

func (*Connector) RenewSelfToken

func (c *Connector) RenewSelfToken(ctx context.Context) error

func (*Connector) RenewToken

func (c *Connector) RenewToken(ctx context.Context, tokenId, uuid, namespace string, SyncTTLSecond int) error

func (*Connector) RevokeOrphanToken

func (c *Connector) RevokeOrphanToken(ctx context.Context, tokenId, uuid, namespace string) error

func (*Connector) RevokeSelfToken

func (c *Connector) RevokeSelfToken(ctx context.Context, tokenId, uuid, namespace string)

func (*Connector) SetToken

func (c *Connector) SetToken(token string)

func (*Connector) StartTokenRenewal

func (c *Connector) StartTokenRenewal(ctx context.Context, cfg *config.Config)

Permit to the renewer to renew is self token using to connect on Vault

func (*Connector) StoreData

func (c *Connector) StoreData(ctx context.Context, vaultInformation *KeyInformation, secretName, uuid, namespace, prefix string) (string, error)

type DbCreds

type DbCreds struct {
	Username    string
	Password    string
	DbLeaseId   string
	AuthLeaseId string
	DbTokenId   string
}

type KeyInformation

type KeyInformation struct {
	PodNameUID     string
	LeaseId        string
	TokenId        string
	Namespace      string
	PodName        string
	NodeName       string
	ServiceAccount string
}

func NewKeyInformation

func NewKeyInformation(podUuid, leaseId, tokenId, namespace, serviceAccount string, podName ...string) *KeyInformation

Jump to

Keyboard shortcuts

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