Documentation
¶
Overview ¶
Package controllers contains the Kubernetes operator reconciliation loops for handling the JWTs creation and management.
Index ¶
- func EnsureSysAccount(ctx context.Context, nURL string, c client.Client, operatorNs string, ...) (nkeys.KeyPair, string, string, string, error)
- func EnsureSysResolverUser(ctx context.Context, c client.Client, ns string, sysSeed []byte, rotate bool) (creds string, err error)
- func GetNATSConn() (*nats.Conn, error)
- func GetOrCreateOperatorKP(ctx context.Context, c client.Client, operatorNs string) (nkeys.KeyPair, string, error)
- func SetNatsCreds(creds string)
- func SetNatsURL(url string)
- type NatsAccountReconciler
- type NatsUserReconciler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureSysAccount ¶
func EnsureSysAccount(ctx context.Context, nURL string, c client.Client, operatorNs string, opKp nkeys.KeyPair, rotate bool) (nkeys.KeyPair, string, string, string, error)
EnsureSysAccount returns (sysKP, sysJWT string, sysPub string). If rotate==true it generates a *new* account keypair & JWT, replacing whatever is stored in the Secret.
func EnsureSysResolverUser ¶ added in v0.0.2
func GetNATSConn ¶ added in v0.1.3
func GetNATSConn() (*nats.Conn, error)
GetNATSConn returns a shared connection using env vars:
NATS_URL – e.g. nats://nats:4222 NATS_CREDS – path to resolver creds (user in $SYS)
func GetOrCreateOperatorKP ¶
func GetOrCreateOperatorKP(ctx context.Context, c client.Client, operatorNs string) (nkeys.KeyPair, string, error)
GetOrCreateOperatorKP ensures a Secret with operator seed & jwt exists and returns a loaded nkeys.KeyPair plus JWT string.
func SetNatsCreds ¶ added in v0.1.1
func SetNatsCreds(creds string)
func SetNatsURL ¶ added in v0.1.1
func SetNatsURL(url string)
Types ¶
type NatsAccountReconciler ¶
NatsAccountReconciler reconciles a NatsAccount object
func (*NatsAccountReconciler) SetupWithManager ¶
func (r *NatsAccountReconciler) SetupWithManager(mgr ctrl.Manager) error
type NatsUserReconciler ¶
NatsUserReconciler reconciles a NatsUser object
func (*NatsUserReconciler) SetupWithManager ¶
func (r *NatsUserReconciler) SetupWithManager(mgr ctrl.Manager) error
Click to show internal directories.
Click to hide internal directories.