mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Add SSHFP DNS record support. (#439)
* Add SSHFP DNS record support. * Fix integration test.
This commit is contained in:
@@ -262,6 +262,13 @@ func srv(name string, priority, weight, port uint16, target string) *rec {
|
||||
return r
|
||||
}
|
||||
|
||||
func sshfp(name string, algorithm uint8, fingerprint uint8, target string) *rec {
|
||||
r := makeRec(name, target, "SSHFP")
|
||||
r.SshfpAlgorithm = algorithm
|
||||
r.SshfpFingerprint = fingerprint
|
||||
return r
|
||||
}
|
||||
|
||||
func txt(name, target string) *rec {
|
||||
// FYI: This must match the algorithm in pkg/js/helpers.js TXT.
|
||||
r := makeRec(name, target, "TXT")
|
||||
@@ -426,6 +433,20 @@ func makeTests(t *testing.T) []*TestCase {
|
||||
)
|
||||
}
|
||||
|
||||
// SSHFP
|
||||
if !providers.ProviderHasCabability(*providerToRun, providers.CanUseSSHFP) {
|
||||
t.Log("Skipping SSHFP Tests because provider does not support them")
|
||||
} else {
|
||||
tests = append(tests, tc("Empty"),
|
||||
tc("SSHFP record", sshfp("@", 1, 1, "66c7d5540b7d75a1fb4c84febfa178ad99bdd67c")),
|
||||
tc("SSHFP change algorithm", sshfp("@", 2, 1, "66c7d5540b7d75a1fb4c84febfa178ad99bdd67c")),
|
||||
tc("SSHFP change value", sshfp("@", 2, 1, "745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc")),
|
||||
tc("SSHFP change fingerprint", sshfp("@", 2, 2, "745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc")),
|
||||
tc("SSHFP many records", sshfp("@", 1, 1, "66c7d5540b7d75a1fb4c84febfa178ad99bdd67c"), sshfp("@", 1, 2, "745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc"), sshfp("@", 2, 1, "66c7d5540b7d75a1fb4c84febfa178ad99bdd67c")),
|
||||
tc("SSHFP delete", sshfp("@", 1, 1, "66c7d5540b7d75a1fb4c84febfa178ad99bdd67c")),
|
||||
)
|
||||
}
|
||||
|
||||
// CAA
|
||||
if !providers.ProviderHasCabability(*providerToRun, providers.CanUseCAA) {
|
||||
t.Log("Skipping CAA Tests because provider does not support them")
|
||||
|
||||
Reference in New Issue
Block a user