@wenathlan/argan 2.0.84 → 2.0.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// # dnssec.
|
|
1
|
+
// # dnssec.test — honest unit tests for the DNSSEC validation math, runnable
|
|
2
2
|
// with the node built-in runner (no install, no dependencies):
|
|
3
|
-
// node --test tests/dnssec.
|
|
3
|
+
// node --test tests/dnssec.test.ts
|
|
4
4
|
import assert from "node:assert/strict";
|
|
5
5
|
import { describe, it } from "node:test";
|
|
6
6
|
import {
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
validateSignatureWindow,
|
|
16
16
|
DnssecValidationError,
|
|
17
17
|
type DnsKey,
|
|
18
|
-
} from "../dnssec.
|
|
18
|
+
} from "../dnssec.ts";
|
|
19
19
|
|
|
20
20
|
/** A small DNSKEY whose key tag was computed by hand from the RFC 4034 Appendix B loop. */
|
|
21
21
|
const ZONEKEY: DnsKey = { flags: 256, protocol: 3, algorithm: 8, publicKey: "qrs=" };
|
|
@@ -23,7 +23,7 @@ const ZONEKEY: DnsKey = { flags: 256, protocol: 3, algorithm: 8, publicKey: "qrs
|
|
|
23
23
|
/** A fresh RRSIG presentation line over www.example.com. (2026 window). */
|
|
24
24
|
const SIGNATURELINE = "A 8 3 300 20261231235959 20260101000000 18928 www.example.com. dGVzdHNpZ25hdHVyZQ==";
|
|
25
25
|
|
|
26
|
-
describe("dnssec
|
|
26
|
+
describe("dnssec presentation parsing", () => {
|
|
27
27
|
it("parses an RRSIG line with its zone-file timestamps", () => {
|
|
28
28
|
const sig = parseRrSig(SIGNATURELINE);
|
|
29
29
|
assert.equal(sig.typeCovered, "A");
|
|
@@ -48,7 +48,7 @@ describe("dnssec.validate presentation parsing", () => {
|
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
describe("dnssec
|
|
51
|
+
describe("dnssec key tag and chain math", () => {
|
|
52
52
|
it("computes the RFC 4034 Appendix B checksum by hand", () => {
|
|
53
53
|
// rdata = 01 00 03 08 aa bb → 256 + 0 + 768 + 8 + 43520 + 187 = 44739
|
|
54
54
|
assert.equal(keyTag(ZONEKEY), 44739);
|
|
@@ -83,7 +83,7 @@ describe("dnssec.validate key tag and chain math", () => {
|
|
|
83
83
|
});
|
|
84
84
|
});
|
|
85
85
|
|
|
86
|
-
describe("dnssec
|
|
86
|
+
describe("dnssec clock and ttl windows", () => {
|
|
87
87
|
const sig = parseRrSig(SIGNATURELINE);
|
|
88
88
|
|
|
89
89
|
it("answers ok inside the validity window and names the reason outside", () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// #
|
|
1
|
+
// # zonediff.test — honest unit tests for the zone diff, runnable with the node
|
|
2
2
|
// built-in runner (no install, no dependencies):
|
|
3
|
-
// node --test tests/
|
|
3
|
+
// node --test tests/zonediff.test.ts
|
|
4
4
|
import assert from "node:assert/strict";
|
|
5
5
|
import { describe, it } from "node:test";
|
|
6
6
|
import { nextSerial } from "../argan.ts";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
serialForPublication,
|
|
13
13
|
ZoneDiffError,
|
|
14
14
|
type ZoneRecord,
|
|
15
|
-
} from "../
|
|
15
|
+
} from "../zonediff.ts";
|
|
16
16
|
|
|
17
17
|
const ORIGIN = "example.com.";
|
|
18
18
|
|
|
@@ -21,7 +21,7 @@ function record(name: string, type: string, ttl: number | undefined, data: strin
|
|
|
21
21
|
return { name, type, ttl, data };
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
describe("
|
|
24
|
+
describe("zonediff parser", () => {
|
|
25
25
|
it("parses absolute and relative owners, @, ttl and class in both orders", () => {
|
|
26
26
|
const text = [
|
|
27
27
|
"example.com. 300 IN SOA ns1.example.com. hostmaster.example.com. 1 2 3 4 5",
|
|
@@ -92,7 +92,7 @@ describe("zone.diff parser", () => {
|
|
|
92
92
|
});
|
|
93
93
|
});
|
|
94
94
|
|
|
95
|
-
describe("
|
|
95
|
+
describe("zonediff planner", () => {
|
|
96
96
|
it("answers an empty diff for identical records", () => {
|
|
97
97
|
const zone = [
|
|
98
98
|
record("example.com.", "A", 300, "192.0.2.1"),
|