Repository navigation
fix(gateway): normalize the domain in the remaining ZT-Domain admin RPCs - #1356
Merged
Merged
Conversation
ZT-Domain records are keyed by the normalized domain -- trimmed, lowercased,
with the wildcard prefix and root dot stripped -- and Add/Get/Update/Delete all
normalize before touching the store. RenewZtDomainCert, ForceReleaseCertLock
and ListCertAttestations addressed the store with the caller's spelling.
ForceReleaseCertLock is the worst of the three: it is the escape hatch out of a
renewal that wedged, and deleting a key that does not exist is not an error, so
ForceReleaseCertLock("APP.example.com") returned Ok and logged a released lock
while app.example.com stayed locked until the timeout. ListCertAttestations
reported a domain as never attested, and RenewZtDomainCert failed with "config
not found" for a domain that is configured.
Normalize in all three. Force-release moves into a small helper so the path can
be tested without standing up a Proxy, and so the log names the key that was
actually released.
This was referenced Sep 24, 2026
kvinwang
added this pull request to stack #1361
September 24, 2026 08:06
kvinwang
added a commit
that referenced
this pull request
Sep 25, 2026
…k and ListCertAttestations PR #1356 normalizes the domain in both methods and refuses a name that is not a DNS name, so the empty request tc-gw-admin-027 and tc-gw-admin-028 sent is now an error. Both send a wildcard, upper-case, trailing-dot spelling and assert the empty and malformed domains are refused. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Sep 25, 2026
…in spelling PR #1262 removed certificate issuance from the startup path; the certificate-bootstrap cases now restart a node against a silent ACME directory with an uncertified domain configured and require it to listen. PR #1356 normalizes the domain in ForceReleaseCertLock and ListCertAttestations; tc-gw-certificat-002 releases a crashed node's lock with a non-normalized spelling and tc-gw-certificat-007 lists history under one. Signed-off-by: Kevin Wang <wy721@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split from #1235.
normalize_zt_domainis applied byAddZtDomain,GetZtDomain,UpdateZtDomainandDeleteZtDomain, but not byRenewZtDomainCert,ForceReleaseCertLockandListCertAttestations, which build KV keys from the raw input.The worst case is
ForceReleaseCertLock, the documented escape hatch from a wedged renewal: called withAPP.example.comit deleted a key that never existed, returnedOk(())and logged a release, while renewal stayed wedged.ListCertAttestationssilently reported a configured domain as never attested.Fixed by normalizing in all three. Force-release is moved into a small free helper so it is testable without a
Proxy.force_release_uses_the_key_the_lock_was_taken_underandforce_release_refuses_a_malformed_domainfail againstnext.