Give unresolved hosts deterministic hostname identity #10

Open
lost-rob0t wants to merge 6 commits from agent/unresolved-host-identity into master
lost-rob0t commented 2026-08-16 05:44:58 +00:00 (Migrated from github.com)

Summary

Fixes #9 without changing existing resolved-host IDs.

Identity policy

  • non-empty IP: preserve the historical IP-only hash exactly
  • empty IP + hostname: use tagged hostname identity digest-id("hostname", canonical-hostname)
  • hostname canonicalization for identity is case-insensitive, trims surrounding whitespace, and ignores a trailing DNS dot
  • empty IP + empty hostname: reject instead of minting the shared empty-string digest

The stored hostname itself is not rewritten by identity normalization.

Compatibility

Resolved hosts still produce exactly digest-id(ip), so existing central host IDs do not migrate.

Tests

Extends hosts-test for:

  • resolved historical hash equality
  • same IP / different hostname compatibility
  • case/trailing-dot-equivalent unresolved hostnames
  • distinct unresolved hostnames
  • invalid fully empty host
  • new-host hostname-only construction
  • v0.9 encode/decode round-trip preserving unresolved host identity

Closes #9 when repository CI is green.

## Summary Fixes #9 without changing existing resolved-host IDs. ### Identity policy - non-empty IP: preserve the historical IP-only hash exactly - empty IP + hostname: use tagged hostname identity `digest-id("hostname", canonical-hostname)` - hostname canonicalization for identity is case-insensitive, trims surrounding whitespace, and ignores a trailing DNS dot - empty IP + empty hostname: reject instead of minting the shared empty-string digest The stored hostname itself is not rewritten by identity normalization. ### Compatibility Resolved hosts still produce exactly `digest-id(ip)`, so existing central host IDs do not migrate. ### Tests Extends `hosts-test` for: - resolved historical hash equality - same IP / different hostname compatibility - case/trailing-dot-equivalent unresolved hostnames - distinct unresolved hostnames - invalid fully empty host - `new-host` hostname-only construction - v0.9 encode/decode round-trip preserving unresolved host identity Closes #9 when repository CI is green.
nsaspy changed title from WIP: Give unresolved hosts deterministic hostname identity to Give unresolved hosts deterministic hostname identity 2026-08-27 19:57:39 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin agent/unresolved-host-identity:agent/unresolved-host-identity
git switch agent/unresolved-host-identity

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff agent/unresolved-host-identity
git switch agent/unresolved-host-identity
git rebase master
git switch master
git merge --ff-only agent/unresolved-host-identity
git switch agent/unresolved-host-identity
git rebase master
git switch master
git merge --no-ff agent/unresolved-host-identity
git switch master
git merge --squash agent/unresolved-host-identity
git switch master
git merge --ff-only agent/unresolved-host-identity
git switch master
git merge agent/unresolved-host-identity
git push origin master
Sign in to join this conversation.
No description provided.