Documentation
¶
Overview ¶
Package kms connects IAM to the canonical Lux KMS (github.com/luxfi/kms) over the native ZAP protocol.
Separation of concerns: a consumer points at ONE KMS endpoint; the KMS deployment owns its MPC node set, threshold, and unlock — none of those are a consumer's concern. (This replaces the old BASE_KMS_NODES / _THRESHOLD / _ORG_SLUG / _PASSPHRASE contract, which leaked KMS-cluster internals into every consumer.)
KMS_ADDR KMS endpoint host:port (default zap.kms.svc.cluster.local:9999) KMS_PATH secret path prefix (default "/") KMS_ENV secret environment (default "default")
When KMS_ADDR is unset the client is disabled and callers fall back to plain os.Getenv — local dev / sandbox keep working with no KMS. IAM is a READER: writing secrets is the KMS service's responsibility, so there is no Set here (matches the canonical luxfi/kms top-level API).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a process-wide singleton that fronts the canonical luxfi/kms client. It holds only the single-endpoint Config — no node list, threshold, org, or passphrase.
func Global ¶
func Global() *Client
Global returns the process-wide client, or nil if KMS is not configured.
func Init ¶
Init parses env and stores the process-wide singleton. Returns (nil, nil) when KMS is not configured.
func InitWithConfig ¶
InitWithConfig is Init with an explicit Config (tests point Addr at a stub KMS endpoint).
func (*Client) Env ¶ added in v1.19.6
Env returns the configured environment slug (replaces the old Org(); the KMS env is the only scoping a consumer sees).
type Config ¶
Config is the single-endpoint luxfi/kms config (Addr/Path/Env). Aliased so callers and tests don't import luxfi/kms directly.
func LoadConfig ¶
LoadConfig reads KMS_ADDR/KMS_PATH/KMS_ENV. Returns (nil, nil) when KMS_ADDR is unset — the caller treats that as "KMS disabled" and falls back to plain env vars.