You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
deploy/k8s: sticky SH_REFRESH_* settings in moca-settings (follow-up to #467) #470
Follow-up from #467 (B14, #395), deferred there by review agreement.
Goal
An operator of deploy/k8s can set the refresh-token limits the same way as the token TTLs: as sticky setup.sh inputs stored in the moca-settings ConfigMap.
SH_REFRESH_MAX_TTL_SECONDS (90 days; must be ≥ idle, refused at boot otherwise)
SH_REFRESH_REUSE_GRACE_SECONDS (30 s, 1–300)
They are wired into deploy/compose/docker-compose.yml and deploy/vm/env/control-plane.env.example. They are not wired into deploy/k8s, where only the defaults apply.
fix(deploy/k8s): combined trust file, trust line on every run, settable token TTLs (#432) #464 added the sticky plumbing for SH_API_TOKEN_TTL_SECONDS and SH_SESSION_TOKEN_TTL_SECONDS: setup.sh's parse_args validation, write_settings (stored in moca-settings, included in the settings hash that rolls the control plane), and deploy/k8s/base/control-plane.yaml's configMapKeyRef env entries.
Scope
Add the three variables to setup.sh next to the token TTLs:
sticky, as the TTLs are (unset keeps the stored value, empty means the default);
validated as whole seconds;
grace limited to 1–300;
max ≥ idle checked at setup time, so a bad pair fails the run instead of crash-looping the control plane.
Add the configMapKeyRef env entries to base/control-plane.yaml.
Document them in deploy/k8s/README.md §2's sticky-settings list.
Extend the existing deploy/k8s setup tests for the new keys: stored, reused, cleared, and the hash changes.
Acceptance
SH_REFRESH_MAX_TTL_SECONDS=604800 deploy/k8s/setup.sh … stores the value, rolls the control plane once, and a re-run without it keeps the value.
A max below the idle limit is refused by setup.sh with a message that names both variables.
Activity