Documentation
¶
Overview ¶
Package sealx seals tenant credentials at rest with AES-256-GCM (authenticate-then-store; the sealed form carries an authenticated timestamp blob, base64-encoded under the SealedPrefix).
Key format — three layers, read before the first "invalid key" error ¶
- New / NewSecrets take 32 RAW bytes (AES-256 key, not hex, not base64 — the []byte IS the key material).
- NewSecretsFromEnv reads PLOYKIT_SEAL_KEY and expects that value to be base64 (StdEncoding) of the 32 raw bytes — i.e. the direct output of `openssl rand -base64 32` works as-is.
- DeriveKey(base, domain) produces 32 raw bytes from a configured master secret (HMAC-SHA256, domain-separated) — its output feeds New/NewSecrets directly with no encoding step.
Failure posture (deliberate, see AGENTS.md): no key configured = new sealed writes are rejected and unsealed reads of legacy plaintext error out — there is no plaintext fallback; such credentials must be reconfigured.
Index ¶
Constants ¶
View Source
const EnvKey = "PLOYKIT_SEAL_KEY"
View Source
const SealedPrefix = "sealed:v1:"
Variables ¶
View Source
var ErrNoKey = errors.New("sealx: seal key not configured (set " + EnvKey + "); refusing to store plaintext")
View Source
var ErrPlaintext = errors.New("sealx: value is not sealed (no " + SealedPrefix + " prefix); legacy plaintext support removed 2026-10-07 — reconfigure the credential")
Functions ¶
Types ¶
type Secrets ¶
type Secrets struct {
// contains filtered or unexported fields
}
func NewSecrets ¶
func NewSecretsFromEnv ¶
Click to show internal directories.
Click to hide internal directories.