New reverse zone: pick from the networks your records use, sized around them
The Zones page's New reverse zone lists every network the records use without a reverse zone, in every view, also where nothing is suggested (suggestions off, dismissed, public views), marked. Picking one fills in the network and view; size buttons (/48 /56 /64 /128, /16 /24 /32) re-mask it around a record's address, so a /48 becomes the records' own /64. Fill stays on. jarl zone suggest-reverse --all [--view V]; GET /reverse-zones/suggestions?all=1&view=. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b1719ce362
commit
304c89dba4
12 files changed
+228
-31
No files matched your search
@@ -235,3 +235,30 @@ func TestChildZoneTakesRecords(t *testing.T) {
|
||||
t.Error("the delegation left the parent")
|
||||
}
|
||||
}
|
||||
|
||||
// With All, the networks no suggestion is made for unasked are listed too,
|
||||
// marked: views with suggestions off, dismissed ones, public views.
|
||||
func TestReverseCandidatesAll(t *testing.T) {
|
||||
env := linkedEnv(t)
|
||||
env.submit(env.admin, NewRequest(OpZoneCreate, 0, ZoneInput{Name: model.Ptr("example.com"), View: model.Ptr("external"), LinkWith: "internal"}))
|
||||
env.submit(env.admin, NewRequest(OpRRSetReplace, 0, RRSetInput{Zone: "example.com", View: "internal", Name: "nas", Type: "AAAA", Data: []string{"2a02:8013:7f3d:10::5"}, Local: model.Ptr(true)}))
|
||||
env.submit(env.admin, NewRequest(OpReverseDismiss, 0, DismissInput{View: "internal", Prefix: "192.0.2.10/32"}))
|
||||
internal := env.state().ViewByName("internal")
|
||||
env.submit(env.admin, NewRequest(OpViewUpdate, internal.ID, ViewInput{ReverseSuggestions: model.Ptr(false)}))
|
||||
list := func(opt ReverseOptions) []string {
|
||||
var out []string
|
||||
for _, s := range ReverseCandidates(env.state(), env.e.Exposures(env.state()), nil, opt) {
|
||||
out = append(out, s.View+" "+s.Prefix+" "+s.Hidden)
|
||||
}
|
||||
return out
|
||||
}
|
||||
want(t, "unasked", list(ReverseOptions{}))
|
||||
want(t, "internal, all", list(ReverseOptions{All: true, View: "internal"}),
|
||||
"internal 192.0.2.10/32 suggestions off", "internal 192.0.2.25/32 suggestions off", "internal 2a02:8013:7f3d:10::5/128 suggestions off")
|
||||
got := list(ReverseOptions{All: true, View: "external"})
|
||||
want(t, "external, all", got, "external 192.0.2.10/32 public view", "external 192.0.2.25/32 public view")
|
||||
|
||||
env.submit(env.admin, NewRequest(OpViewUpdate, internal.ID, ViewInput{ReverseSuggestions: model.Ptr(true)}))
|
||||
want(t, "dismissed", list(ReverseOptions{All: true, View: "internal"}),
|
||||
"internal 192.0.2.10/32 dismissed", "internal 192.0.2.25/32 ", "internal 2a02:8013:7f3d:10::5/128 ")
|
||||
}
|
||||
Reference in new issue
Block a user