account

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 21 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

This section is empty.

Types

type Config added in v0.6.0

type Config struct {
	OperatorNatsCluster *OperatorNatsCluster
	// OperatorNamespace is the Kubernetes namespace where the operator is deployed.
	// TODO: [#102][#144] When sunsetting DefaultNatsURL, remove this field if it no longer serves a purpose.
	OperatorNamespace domain.Namespace
	// DefaultNatsURL is a comma-separated list of NATS server URLs to use when OperatorNatsCluster is not configured.
	// Deprecated: This field is deprecated and will be removed in a future release.
	// TODO: [#102][#144] Sunset DefaultNatsURL (NATS_URL)
	DefaultNatsURL string
}

func NewConfig added in v0.6.0

func NewConfig(operatorNatsCluster *OperatorNatsCluster, operatorNamespace domain.Namespace, defaultNatsURL string) (*Config, error)

type Manager

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

func NewManager

func NewManager(
	natsClient ports.NatsClient,
	accountReader ports.AccountReader,
	natsClusterReader ports.NatsClusterReader,
	secretClient ports.SecretClient,
	configMapReader ports.ConfigMapReader,
	config *Config,
) (*Manager, error)

func (*Manager) Create

func (a *Manager) Create(ctx context.Context, state *v1alpha1.Account) (*controller.AccountResult, error)

func (*Manager) Delete

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

func (*Manager) Import

func (a *Manager) Import(ctx context.Context, state *v1alpha1.Account) (*controller.AccountResult, error)

func (*Manager) SignUserJWT added in v0.6.0

func (a *Manager) SignUserJWT(ctx context.Context, accountRef domain.NamespacedName, claims *jwt.UserClaims) (*user.SignedUserJWT, error)

func (*Manager) Update

func (a *Manager) Update(ctx context.Context, state *v1alpha1.Account) (*controller.AccountResult, error)

type OperatorNatsCluster added in v0.6.0

type OperatorNatsCluster struct {
	ClusterRef v1alpha1.NatsClusterRef
	// Optional controls account-level overrides when ClusterRef is configured.
	// false (default) means account-level cluster refs must not deviate.
	Optional bool
}

func NewOperatorNatsCluster added in v0.6.0

func NewOperatorNatsCluster(clusterRef v1alpha1.NatsClusterRef, optional bool) (*OperatorNatsCluster, error)

type Secrets added in v0.6.0

type Secrets struct {
	Root nkeys.KeyPair
	Sign nkeys.KeyPair
}

Jump to

Keyboard shortcuts

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