secrets

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateState

func CreateState(client *kubernetes.Clientset) error

CreateState creates an empty state of the credentials

func UpdateState

func UpdateState(client *kubernetes.Clientset, state *State) error

UpdateState updates the state of the credentials

Types

type CredsSecrets

type CredsSecrets struct {
	creds.Creds

	State *State
	// contains filtered or unexported fields
}

CredsSecrets implements CredsIf using Kubernetes secrets

func NewCredsSecrets

func NewCredsSecrets() *CredsSecrets

NewCredsSecrets creates a new CredsSecrets

func (*CredsSecrets) AllocateNatsAccount

func (c *CredsSecrets) AllocateNatsAccount(applicationName string) (string, error)

AllocateNatsAccount allocates a new nats account if possible

func (*CredsSecrets) DeleteAccount

func (c *CredsSecrets) DeleteAccount(applicationName string) error

DeleteAccount deletes the account from the credentials.

func (*CredsSecrets) DesiredState

func (c *CredsSecrets) DesiredState(applicationName string, usernames []string) (map[string]string, error)

DesiredState constructs the desired state of credentials for a given application name

type NatsAccountMapping

type NatsAccountMapping struct {
	Account         string `json:"Account"`
	ApplicationName string `json:"Application"`
}

State stores the current state of the credentials (all used accounts)

type State

type State struct {
	// UsedAccounts slice of used accounts
	UsedAccounts []NatsAccountMapping `json:"usedAccounts"`
}

State stores the current state of the credsmanager

func ReadState

func ReadState(client *kubernetes.Clientset) (*State, error)

ReadState reads the state of the credentials and returns struct State

Jump to

Keyboard shortcuts

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