Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
tlimoncelli committed Dec 28, 2024
1 parent c5ee3e9 commit 667f079
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 38 deletions.
19 changes: 10 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/js/README-parse_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ scans for files named `DDD-*.js` where `DDD` is a three-digit number.
* `parse_tests/001-basic.json.ACTUAL` -- The ACTUAL output of "print-ir" for the `.js` file (not saved in git)
* `parse_tests/001-basic/foo.com.zone` -- Zonefiles from the domains mentioned in dnsconfig.js

NOTE: The zonefiles are only generated if a matching `DDD-name/DOMAINNAME.zone` file exists.
NOTE: The zonefiles are only tested if a matching `DDD-name/DOMAINNAME.zone` file exists.

Any files committed to Git should be in standard format.

Expand All @@ -33,7 +33,7 @@ fmtjson *.json *.json.ACTUAL

Back-port the ACTUAL results to the expected results:

(This is dangerous. Carefully inspect the resulting PR.)
(This is dangerous. You may be committing buggy results to the "expected" files. Carefully inspect the resulting PR.)

```
cd parse_tests
Expand Down
2 changes: 1 addition & 1 deletion pkg/js/parse_tests/001-basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ var REG = NewRegistrar("Third-Party", "NONE");
var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI");

D("foo.com", REG, DnsProvider(CF),
A("@", "1.2.3.4")
A("@", "1.2.3.4"),
);
4 changes: 2 additions & 2 deletions pkg/js/parse_tests/002-ttl.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var REG = NewRegistrar("Third-Party", "NONE");
var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI")
var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI");

D("foo.com", REG, DnsProvider(CF),
A("@", "1.2.3.4", TTL(42))
A("@", "1.2.3.4", TTL(42)),
);
2 changes: 1 addition & 1 deletion pkg/js/parse_tests/003-meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ var CLOUDFLARE = NewRegistrar("Cloudflare", "CLOUDFLAREAPI");
D("foo.com", CLOUDFLARE,
A("@", "1.2.3.4", {
"cloudflare_proxy": "ON"
})
}),
);
6 changes: 3 additions & 3 deletions pkg/js/parse_tests/004-ips.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
var REG = NewRegistrar("Third-Party", "NONE");
var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI")
var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI");

var BASE = IP("1.2.3.4")
var BASE = IP("1.2.3.4");

D("foo.com", REG, DnsProvider(CF, 0),
A("@", BASE),
A("p1", BASE + 1),
A("p255", BASE + 255)
A("p255", BASE + 255),
);
6 changes: 3 additions & 3 deletions pkg/js/parse_tests/006-transforms.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var REG = NewRegistrar("Third-Party", "NONE");
var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI")
var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI");

var TRANSFORM_INT = [{
low: "0.0.0.0",
Expand All @@ -13,10 +13,10 @@ var TRANSFORM_INT = [{
low: "1.1.1.1",
high: IP("2.2.2.2"),
newIP: ["3.3.3.3", "4.4.4.4", IP("5.5.5.5")]
}]
}];

D("foo.com", REG, DnsProvider(CF),
A("@", "1.2.3.4", {
transform: TRANSFORM_INT
})
}),
);
4 changes: 2 additions & 2 deletions pkg/js/parse_tests/007-importTransformTTL.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ var TRANSFORM_BASE = [{
D("foo1.com", "reg");

D("foo2.com", "reg",
IMPORT_TRANSFORM(TRANSFORM_BASE, "foo1.com", 60)
IMPORT_TRANSFORM(TRANSFORM_BASE, "foo1.com", 60),
);

D("foo3.com", "reg",
IMPORT_TRANSFORM_STRIP(TRANSFORM_NEWIP, "foo1.com", 99, ".com")
IMPORT_TRANSFORM_STRIP(TRANSFORM_NEWIP, "foo1.com", 99, ".com"),
);
2 changes: 1 addition & 1 deletion pkg/js/parse_tests/008-import.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
require("./import.js")
require("./import.js");
2 changes: 1 addition & 1 deletion pkg/js/parse_tests/010-alias.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
D("foo.com", "none",
ALIAS("@", "foo.com.")
ALIAS("@", "foo.com."),
);
2 changes: 1 addition & 1 deletion pkg/js/parse_tests/011-cfRedirect.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
D("foo.com", "none",
CF_REDIRECT("test.foo.com", "https://goo.com/$1"),
CF_TEMP_REDIRECT("test.foo.com", "https://goo.com/$1")
CF_TEMP_REDIRECT("test.foo.com", "https://goo.com/$1"),
);
2 changes: 1 addition & 1 deletion pkg/js/parse_tests/012-duration.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ D("foo.com", "none",
A("a", "1.2.3.5", TTL("300")),
A("b", "1.2.3.6", TTL("3m")),
A("c", "1.2.3.7", TTL("3h")),
A("d", "1.2.3.8", TTL("3d"))
A("d", "1.2.3.8", TTL("3d")),
);
2 changes: 1 addition & 1 deletion pkg/js/parse_tests/013-mx.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
D("foo.com", "none",
MX("@", 15, "foo.com.")
MX("@", 15, "foo.com."),
);
2 changes: 1 addition & 1 deletion pkg/js/parse_tests/014-caa.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ D("foo.com", "none",
// Optionally report violation to http://example.com
CAA("@", "iodef", "http://example.com"),
// Report violation to https://example.com
CAA("@", "iodef", "https://example.com", CAA_CRITICAL)
CAA("@", "iodef", "https://example.com", CAA_CRITICAL),
);
2 changes: 1 addition & 1 deletion pkg/js/parse_tests/015-tlsa.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
D("foo.com", "none",
TLSA("_443._tcp", 3, 1, 1, "MDFiYTQ3MTljODBiNmZlOTExYjA5MWE3YzA1MTI0YjY0ZWVlY2U5NjRlMDljMDU4ZWY4Zjk4MDVkYWNhNTQ2YiAgLQo=")
TLSA("_443._tcp", 3, 1, 1, "MDFiYTQ3MTljODBiNmZlOTExYjA5MWE3YzA1MTI0YjY0ZWVlY2U5NjRlMDljMDU4ZWY4Zjk4MDVkYWNhNTQ2YiAgLQo="),
);
6 changes: 3 additions & 3 deletions pkg/js/parse_tests/024-json-import.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var domains = require('./domain-ip-map.json')
var domains = require('./domain-ip-map.json');

var domain = "foo.com"
var ip = domains["foo.com"]
var domain = "foo.com";
var ip = domains["foo.com"];

D(domain, "none",
A("@", ip),
Expand Down
6 changes: 3 additions & 3 deletions pkg/js/parse_tests/049-json5-require.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var domains = require('./domain-ip-map.json5')
var domains = require('./domain-ip-map.json5');

var domain = "foo.com"
var ip = domains["foo.com"]
var domain = "foo.com";
var ip = domains["foo.com"];

D(domain, "none",
A("@", ip),
Expand Down
2 changes: 1 addition & 1 deletion pkg/js/parse_tests/051-HASH.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
D(HASH("SHA1", "abc"), "reg")
D(HASH("SHA1", "abc"), "reg");
2 changes: 1 addition & 1 deletion pkg/js/parse_tests/import.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
D("foo.com", "none",
A("@", "1.2.3.4")
A("@", "1.2.3.4"),
);

0 comments on commit 667f079

Please sign in to comment.