randval

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package randval generates random secret values used across kubeaid-cli — alphanumeric passwords for OIDC client secrets and Keycloak admin credentials, plus base64-encoded byte keys for symmetric crypto (e.g. NetBird's datastoreEncryptionKey).

Used by the secrets-fill path that auto-populates blank fields in the operator's secrets.yaml on first run, so SealedSecrets render with stable plaintext across re-runs.

Index

Constants

View Source
const (
	PasswordLength = 32
)

passwordAlphabet keeps generated passwords shell- / YAML- / kubectl-safe. 32 chars from this alphabet gives ~190 bits of entropy — well past the 128-bit threshold that justifies storing the value rather than rotating it on every use.

Variables

This section is empty.

Functions

func Base64Key

func Base64Key(byteLen int) (string, error)

Base64Key returns byteLen random bytes encoded as standard- padding base64. Used where the consumer expects a fixed-byte- length key rather than a printable-charset password — e.g. NetBird's datastoreEncryptionKey, which the Mgmt server base64- decodes into a 32-byte AES key.

func Password

func Password() (string, error)

Password returns a fresh PasswordLength-character alphanumeric password from passwordAlphabet, drawn from crypto/rand.

Types

This section is empty.

Jump to

Keyboard shortcuts

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