account

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecretNameAccountRootTemplate = "%s-ac-root-%s"
	SecretNameAccountSignTemplate = "%s-ac-sign-%s"
)

Variables

This section is empty.

Functions

func WithNamespace

func WithNamespace(namespace string) func(*Manager)

Types

type AccountGetter

type AccountGetter interface {
	Get(ctx context.Context, accountRefName string, namespace string) (account *natsv1alpha1.Account, err error)
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(accounts AccountGetter, natsClient NatsClient, secretClient SecretClient, opts ...func(*Manager)) *Manager

func (*Manager) Create

func (*Manager) Delete

func (a *Manager) Delete(ctx context.Context, state *natsv1alpha1.Account) error

func (*Manager) Import

func (*Manager) Update

type NatsClient

type NatsClient interface {
	EnsureConnected(namespace string) error
	Disconnect()
	LookupAccountJWT(string) (string, error)
	UploadAccountJWT(jwt string) error
	DeleteAccountJWT(jwt string) error
}

type SecretClient

type SecretClient interface {
	// TODO: Keys created should be immutable
	Apply(ctx context.Context, owner *secret.Owner, meta metav1.ObjectMeta, valueMap map[string]string) error
	Get(ctx context.Context, namespace string, name string) (map[string]string, error)
	GetByLabels(ctx context.Context, namespace string, labels map[string]string) (*v1.SecretList, error)
	Delete(ctx context.Context, namespace string, name string) error
	DeleteByLabels(ctx context.Context, namespace string, labels map[string]string) error
	Label(ctx context.Context, namespace, name string, labels map[string]string) error
}

Jump to

Keyboard shortcuts

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