pub fn rotation_state_dir(secrets_dir: &Path) -> PathBufExpand description
Resolve the directory JWT rotation state is persisted to.
Rotation slots are runtime-mutated state, not provisioned credentials, so
they need a writable home (#803). When secrets_dir is writable (bare
metal, dev, non-systemd) the slots live there, as before. When it is
read-only — the systemd $CREDENTIALS_DIRECTORY ramfs — slots fall back to
the unit’s $STATE_DIRECTORY (StateDirectory=), or to the XDG state dir
when not running under systemd. Loading always checks the state dir first
and falls back to secrets_dir, so credentials provisioned into the
credstore still bootstrap the first boot.