class

CRE::Rotators::EnvFileRotator

Inherits CRE::Rotators::Rotator < Reference < Object

EnvFileRotator manages credentials stored as KEY=value lines in a .env file. The rotation produces fresh random bytes (base64-encoded) and atomically swaps the live file on commit using temp+rename.

Cross-process safety: each instance writes to a per-PID pending file so two daemons targeting the same .env never collide on the staging write. The commit-time rename is serialized through an exclusive flock(2) on a sibling .lock file so the live file is updated by at most one process at a time.

Credential.tags must include: "path" - absolute path to the .env file "key" - the key whose value rotates

Constants

DEFAULT_BYTES = 32

Instance methods

apply(c : Domain::Credential, s : Domain::NewSecret) : Nil
Source
can_rotate?(c : Domain::Credential) : Bool
Source
commit(c : Domain::Credential, s : Domain::NewSecret) : Nil
Source
generate(c : Domain::Credential) : Domain::NewSecret
Source
kind
Source
rollback_apply(c : Domain::Credential, s : Domain::NewSecret) : Nil

Default no-op; rotators override when apply() creates reversible side effects.

Source
verify(c : Domain::Credential, s : Domain::NewSecret) : Bool
Source