caa 7.0.0 → 8.0.0
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/README.md +4 -4
- package/index.js +6 -8
- package/package.json +9 -18
package/README.md
CHANGED
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
npm i caa
|
|
10
10
|
```
|
|
11
11
|
```js
|
|
12
|
-
import caa from
|
|
12
|
+
import {caa, caaMatches} from "caa";
|
|
13
13
|
|
|
14
|
-
await caa(
|
|
14
|
+
await caa("subdomain.example.com");
|
|
15
15
|
// => [{flags: 0, tag: 'issue', value: 'letsencrypt.org', issuerCritical: false}]
|
|
16
16
|
|
|
17
|
-
await caa.matches(
|
|
17
|
+
await caa.matches("subdomain.example.com", "letsencrypt.org");
|
|
18
18
|
// => true
|
|
19
19
|
|
|
20
20
|
```
|
|
@@ -24,7 +24,7 @@ await caa.matches('subdomain.example.com', 'letsencrypt.org');
|
|
|
24
24
|
|
|
25
25
|
Retrieve the CAA records which apply to `name`. Returns a [`CAA` object](https://github.com/mafintosh/dns-packet/#caa).
|
|
26
26
|
|
|
27
|
-
### `
|
|
27
|
+
### `caaMatches(name, ca, [options])`
|
|
28
28
|
|
|
29
29
|
Test if the CAA record for `name` matches for certificate authority `ca`.
|
|
30
30
|
|
package/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {getServers} from "dns";
|
|
1
|
+
import {getServers} from "node:dns";
|
|
2
|
+
import {promisify} from "node:util";
|
|
4
3
|
import dnsSocket from "dns-socket";
|
|
5
4
|
import tlds from "tlds";
|
|
6
|
-
import {promisify} from "util";
|
|
7
5
|
|
|
8
6
|
const defaults = {
|
|
9
7
|
ignoreTLDs: false,
|
|
@@ -90,7 +88,7 @@ const resolve = async ({name, query, servers, port, recursions, retries, tries,
|
|
|
90
88
|
}
|
|
91
89
|
};
|
|
92
90
|
|
|
93
|
-
export
|
|
91
|
+
export async function caa(name, opts = {}) {
|
|
94
92
|
if (typeof name !== "string") throw new Error(`Expected a string for 'name', got ${name}`);
|
|
95
93
|
name = normalizeName(name);
|
|
96
94
|
|
|
@@ -99,7 +97,7 @@ export default async function caa(name, opts = {}) {
|
|
|
99
97
|
opts.servers = (systemServers && systemServers.length) ? systemServers : defaults.servers;
|
|
100
98
|
}
|
|
101
99
|
|
|
102
|
-
opts =
|
|
100
|
+
opts = {...defaults, ...opts};
|
|
103
101
|
|
|
104
102
|
const socket = opts.dnsSocket || dnsSocket();
|
|
105
103
|
const query = promisify(socket.query.bind(socket));
|
|
@@ -118,7 +116,7 @@ export default async function caa(name, opts = {}) {
|
|
|
118
116
|
return caa || [];
|
|
119
117
|
}
|
|
120
118
|
|
|
121
|
-
|
|
119
|
+
export async function caaMatches(name, ca, opts = {}) {
|
|
122
120
|
if (typeof name !== "string") throw new Error(`Expected a string for 'name', got ${name}`);
|
|
123
121
|
if (typeof ca !== "string") throw new Error(`Expected a string for 'ca', got ${ca}`);
|
|
124
122
|
|
|
@@ -139,4 +137,4 @@ caa.matches = async (name, ca, opts = {}) => {
|
|
|
139
137
|
|
|
140
138
|
if (names.includes(";")) return false;
|
|
141
139
|
return !names.length || names.includes(ca);
|
|
142
|
-
}
|
|
140
|
+
}
|
package/package.json
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "caa",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "rfc6844-conform CAA record lookup and validation",
|
|
5
5
|
"author": "silverwind <me@silverwind.io>",
|
|
6
6
|
"repository": "silverwind/caa",
|
|
7
7
|
"license": "BSD-2-Clause",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"exports": "./index.js",
|
|
10
|
-
"scripts": {
|
|
11
|
-
"test": "make test"
|
|
12
|
-
},
|
|
13
10
|
"engines": {
|
|
14
|
-
"node": ">=
|
|
11
|
+
"node": ">=14"
|
|
15
12
|
},
|
|
16
13
|
"files": [
|
|
17
14
|
"index.js"
|
|
@@ -23,20 +20,14 @@
|
|
|
23
20
|
"certificate authority"
|
|
24
21
|
],
|
|
25
22
|
"dependencies": {
|
|
26
|
-
"dns-socket": "^4.2.
|
|
27
|
-
"tlds": "^1.
|
|
23
|
+
"dns-socket": "^4.2.2",
|
|
24
|
+
"tlds": "^1.236.0"
|
|
28
25
|
},
|
|
29
26
|
"devDependencies": {
|
|
30
|
-
"
|
|
31
|
-
"eslint": "
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"versions": "8.4.7"
|
|
36
|
-
},
|
|
37
|
-
"jest": {
|
|
38
|
-
"verbose": false,
|
|
39
|
-
"testTimeout": 10000,
|
|
40
|
-
"transform": {}
|
|
27
|
+
"eslint": "8.34.0",
|
|
28
|
+
"eslint-config-silverwind": "65.1.0",
|
|
29
|
+
"updates": "13.2.8",
|
|
30
|
+
"versions": "10.4.1",
|
|
31
|
+
"vitest": "0.28.4"
|
|
41
32
|
}
|
|
42
33
|
}
|