Skip to content

fix(config): treat allow_unsynced_clock as live in requires_reboot - #317

Merged
Bugs5382 merged 1 commit into
mainfrom
fix/301-unsynced-clock-live
Sep 30, 2026
Merged

Bugs5382 merged 1 commit into
mainfrom
fix/301-unsynced-clock-live

Conversation

@Bugs5382

@Bugs5382 Bugs5382 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

What and why

pki.allow_unsynced_clock lifts the signing clock gate. The signer reads it from the stored config on every signing request (CASigner.checkClock, through the live config getter), and nothing reads it at boot: the clock gate wired into the signer only reports whether the time source has synced, and the SNTP engine never looks at the flag. So a change to the flag alone already takes effect at once, but config apply still answered requires_reboot=true for it and cryptosctl status showed Reboot: pending for nothing.

This classes it as a live field in NeedsReboot, next to pki.profiles, pki.root_leaf_issuance and pki.allow_unverified_revocation_url, the same way #307 did for the revocation override. Any other field in the same apply still needs a reboot.

  • internal/config/reboot.go: blank AllowUnsyncedClock in hotNormalized, and list it in the doc comment.
  • internal/init/run.go, internal/node/providers.go: the comments naming the live fields list it too.
  • docs/time-sync.md: says a change to it alone takes effect at once with requires_reboot=false.

Refs #301

Docs: CryptOS-PKI/docs#63 updates the pages that list the live fields.

Merge order: merge CryptOS-PKI/docs#59 first (the companion of #307), then this PR together with CryptOS-PKI/docs#63, which is branched from #59's branch.

Verification

  • Lint clean
  • Tests pass
  • Build succeeds
  • Documentation updated (if behavior or API changed)

How this was verified

  • Test first, through the real apply path: TestConfigStoreApply_AllowUnsyncedClockIsLive seeds a stored config, reads it back with ConfigStore.Current, flips only pki.allow_unsynced_clock (on, then off) and sends it through ConfigStore.Apply. It failed before the fix with setting only allow_unsynced_clock=true answered requires_reboot (and the same for false), and passes after. A matching subtest in TestNeedsRebootLiveFields goes through the store and a protobuf wire round trip.
  • task ci (fmt, golangci-lint, vet, go test ./..., build) passes locally, and task license exits 0 with the CryptOS Authors header on the new test file.

The signer reads pki.allow_unsynced_clock from the stored config on every
signing request, and nothing reads it at boot, so a change to it alone
takes effect at once. ConfigStore.Apply still answered requires_reboot=true
for it. Class it as hot next to allow_unverified_revocation_url.

Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
@Bugs5382 Bugs5382 self-assigned this Sep 30, 2026
@Bugs5382
Bugs5382 marked this pull request as ready for review September 30, 2026 17:07
@github-actions github-actions Bot added the fix Bug fix (fix). Patch. label Sep 30, 2026
@Bugs5382

Copy link
Copy Markdown
Contributor Author

Merging for the v0.1.0 test run: CI green and mergeable at merge time.

@Bugs5382
Bugs5382 merged commit 03f2859 into main Sep 30, 2026
@Bugs5382
Bugs5382 deleted the fix/301-unsynced-clock-live branch September 30, 2026 17:35
@Bugs5382 Bugs5382 added this to the v0.1.0 milestone Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix (fix). Patch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant