@mp-lb/arcnet 0.3.0 → 0.3.2
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 +2 -2
- package/dist/createCli.d.ts.map +1 -1
- package/dist/createCli.js +2 -1
- package/dist/createCli.js.map +1 -1
- package/dist/environment/grantDomainOwner.d.ts +1 -1
- package/dist/environment/grantDomainOwner.d.ts.map +1 -1
- package/dist/environment/grantDomainOwner.js +8 -3
- package/dist/environment/grantDomainOwner.js.map +1 -1
- package/docs/public/commands.md +1 -0
- package/docs/public/llms-full.txt +3 -2
- package/package.json +2 -2
- package/src/createCli.ts +3 -2
- package/src/environment/grantDomainOwner.ts +8 -2
package/README.md
CHANGED
|
@@ -23,10 +23,10 @@ After a human Google identity has verified a base domain with its DNS TXT record
|
|
|
23
23
|
|
|
24
24
|
```sh
|
|
25
25
|
gcloud auth application-default login --scopes=https://www.googleapis.com/auth/siteverification,https://www.googleapis.com/auth/cloud-platform
|
|
26
|
-
arcnet environment domain-owner --domain example.com --email arc-deploy@arcnet-example.iam.gserviceaccount.com
|
|
26
|
+
arcnet environment domain-owner --domain example.com --email arc-deploy@arcnet-example.iam.gserviceaccount.com --quota-project arcnet-platform
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
The command is safe to rerun: it preserves all existing owners and adds the named account only if absent. Run it as a verified owner of the exact base domain. This grants domain ownership; it does not create the initial verification TXT record, project routing, Cloud Run mapping or DNS route. Those remain separate environment and project configuration steps.
|
|
29
|
+
Enable `siteverification.googleapis.com` on the quota project first. The signed-in owner needs Service Usage Consumer access there. The command is safe to rerun: it preserves all existing owners and adds the named account only if absent. Run it as a verified owner of the exact base domain. This grants domain ownership; it does not create the initial verification TXT record, project routing, Cloud Run mapping or DNS route. Those remain separate environment and project configuration steps.
|
|
30
30
|
|
|
31
31
|
## Layered secrets
|
|
32
32
|
|
package/dist/createCli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCli.d.ts","sourceRoot":"","sources":["../src/createCli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAepC,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"createCli.d.ts","sourceRoot":"","sources":["../src/createCli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAepC,eAAO,MAAM,SAAS,eAwIrB,CAAC"}
|
package/dist/createCli.js
CHANGED
|
@@ -35,8 +35,9 @@ export const createCli = () => {
|
|
|
35
35
|
.description("Grant a deploy identity ownership of an already verified base domain.")
|
|
36
36
|
.requiredOption("--domain <domain>", "Verified base domain")
|
|
37
37
|
.requiredOption("--email <email>", "Deploy service account email")
|
|
38
|
+
.requiredOption("--quota-project <id>", "GCP project with Site Verification API enabled")
|
|
38
39
|
.action(async (options) => {
|
|
39
|
-
output(await grantDomainOwner(options.domain, options.email));
|
|
40
|
+
output(await grantDomainOwner(options.domain, options.email, options.quotaProject));
|
|
40
41
|
});
|
|
41
42
|
cli
|
|
42
43
|
.command("version")
|
package/dist/createCli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCli.js","sourceRoot":"","sources":["../src/createCli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAA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AC;gBAC/D,CAAC,CAAC,OAAO,EAAE;gBACX,CAAC,CAAC,qBAAqB,CACnB,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,EAChC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,cAAc,CAAC,CACnC,CAAC,CACP,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED,GAAG;SACA,OAAO,CAAC,IAAI,CAAC;SACb,WAAW,CACV,gEAAgE,CACjE;SACA,MAAM,CAAC,GAAG,EAAE;QACX,MAAM,OAAO,GAAG,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa;YAC5B,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;QACnE,cAAc,CACZ,OAAO,CAAC,GAAG,CAAC,aAAa,EACzB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;aACpB,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,KAAK,IAAI,CAAC;aAC1C,IAAI,CAAC,EAAE,CAAC,CACZ,CAAC;QAEF,MAAM,CAAC,OAAO,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IAEL,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grantDomainOwner.d.ts","sourceRoot":"","sources":["../../src/environment/grantDomainOwner.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,MAAM,EACd,OAAO,MAAM,EACb,eAAc;IACZ,QAAQ,CAAC,EAAE,MAAM,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;CACnB;;;;
|
|
1
|
+
{"version":3,"file":"grantDomainOwner.d.ts","sourceRoot":"","sources":["../../src/environment/grantDomainOwner.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,MAAM,EACd,OAAO,MAAM,EACb,cAAc,MAAM,EACpB,eAAc;IACZ,QAAQ,CAAC,EAAE,MAAM,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;CACnB;;;;EAwDP,CAAC"}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { execFileSync } from "node:child_process";
|
|
2
|
-
export const grantDomainOwner = async (domain, email, dependencies = {}) => {
|
|
2
|
+
export const grantDomainOwner = async (domain, email, quotaProject, dependencies = {}) => {
|
|
3
3
|
if (!/^(?:[a-z0-9-]+\.)+[a-z]{2,}$/i.test(domain))
|
|
4
4
|
throw new Error("Provide a base domain such as example.com.");
|
|
5
5
|
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email))
|
|
6
6
|
throw new Error("Provide a service account email address.");
|
|
7
|
+
if (!/^[a-z][a-z0-9-]{4,61}[a-z0-9]$/.test(quotaProject))
|
|
8
|
+
throw new Error("Provide a valid Google quota project ID.");
|
|
7
9
|
const token = (dependencies.getToken?.() ??
|
|
8
10
|
execFileSync("gcloud", ["auth", "application-default", "print-access-token"], { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] })).trim();
|
|
9
11
|
const request = dependencies.request ?? fetch;
|
|
10
12
|
const base = "https://www.googleapis.com/siteVerification/v1/webResource";
|
|
11
|
-
const headers = {
|
|
13
|
+
const headers = {
|
|
14
|
+
Authorization: `Bearer ${token}`,
|
|
15
|
+
"x-goog-user-project": quotaProject,
|
|
16
|
+
};
|
|
12
17
|
const list = await request(base, { headers });
|
|
13
18
|
if (!list.ok) {
|
|
14
19
|
if (list.status === 403)
|
|
15
|
-
throw new Error(
|
|
20
|
+
throw new Error(`Google Site Verification denied access. Check the signed-in owner's siteverification scope, Service Usage Consumer permission, and that siteverification.googleapis.com is enabled on ${quotaProject}.`);
|
|
16
21
|
throw new Error(`Google Site Verification list failed (${list.status}).`);
|
|
17
22
|
}
|
|
18
23
|
const { items = [] } = (await list.json());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grantDomainOwner.js","sourceRoot":"","sources":["../../src/environment/grantDomainOwner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAQlD,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EACnC,MAAc,EACd,KAAa,EACb,eAGI,EAAE,EACN,EAAE;IACF,IAAI,CAAC,+BAA+B,CAAC,IAAI,CAAC,MAAM,CAAC;QAC/C,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,KAAK,CAAC;QAC3C,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAE9D,MAAM,KAAK,GAAG,CACZ,YAAY,CAAC,QAAQ,EAAE,EAAE;QACzB,YAAY,CACV,QAAQ,EACR,CAAC,MAAM,EAAE,qBAAqB,EAAE,oBAAoB,CAAC,EACrD,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CACxD,CACF,CAAC,IAAI,EAAE,CAAC;IACT,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,IAAI,KAAK,CAAC;IAC9C,MAAM,IAAI,GAAG,4DAA4D,CAAC;IAC1E,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"grantDomainOwner.js","sourceRoot":"","sources":["../../src/environment/grantDomainOwner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAQlD,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EACnC,MAAc,EACd,KAAa,EACb,YAAoB,EACpB,eAGI,EAAE,EACN,EAAE;IACF,IA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EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC1C,CAAC,CAAC"}
|
package/docs/public/commands.md
CHANGED
|
@@ -101,6 +101,7 @@ Grant a deploy identity ownership of an already verified base domain.
|
|
|
101
101
|
| --- | --- |
|
|
102
102
|
| `--domain <domain>` | Verified base domain |
|
|
103
103
|
| `--email <email>` | Deploy service account email |
|
|
104
|
+
| `--quota-project <id>` | GCP project with Site Verification API enabled |
|
|
104
105
|
|
|
105
106
|
## `arcnet version`
|
|
106
107
|
|
|
@@ -23,10 +23,10 @@ After a human Google identity has verified a base domain with its DNS TXT record
|
|
|
23
23
|
|
|
24
24
|
```sh
|
|
25
25
|
gcloud auth application-default login --scopes=https://www.googleapis.com/auth/siteverification,https://www.googleapis.com/auth/cloud-platform
|
|
26
|
-
arcnet environment domain-owner --domain example.com --email arc-deploy@arcnet-example.iam.gserviceaccount.com
|
|
26
|
+
arcnet environment domain-owner --domain example.com --email arc-deploy@arcnet-example.iam.gserviceaccount.com --quota-project arcnet-platform
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
The command is safe to rerun: it preserves all existing owners and adds the named account only if absent. Run it as a verified owner of the exact base domain. This grants domain ownership; it does not create the initial verification TXT record, project routing, Cloud Run mapping or DNS route. Those remain separate environment and project configuration steps.
|
|
29
|
+
Enable `siteverification.googleapis.com` on the quota project first. The signed-in owner needs Service Usage Consumer access there. The command is safe to rerun: it preserves all existing owners and adds the named account only if absent. Run it as a verified owner of the exact base domain. This grants domain ownership; it does not create the initial verification TXT record, project routing, Cloud Run mapping or DNS route. Those remain separate environment and project configuration steps.
|
|
30
30
|
|
|
31
31
|
## Layered secrets
|
|
32
32
|
|
|
@@ -166,6 +166,7 @@ Grant a deploy identity ownership of an already verified base domain.
|
|
|
166
166
|
| --- | --- |
|
|
167
167
|
| `--domain <domain>` | Verified base domain |
|
|
168
168
|
| `--email <email>` | Deploy service account email |
|
|
169
|
+
| `--quota-project <id>` | GCP project with Site Verification API enabled |
|
|
169
170
|
|
|
170
171
|
## `arcnet version`
|
|
171
172
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mp-lb/arcnet",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "ArcNet project installation and deployment CLI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@mp-lb/forum-secrets": "0.2.1",
|
|
38
|
-
"@mp-lb/zapper": "0.21.
|
|
38
|
+
"@mp-lb/zapper": "0.21.3",
|
|
39
39
|
"commander": "14.0.3",
|
|
40
40
|
"yaml": "2.8.1",
|
|
41
41
|
"zod": "4.4.1"
|
package/src/createCli.ts
CHANGED
|
@@ -43,8 +43,9 @@ export const createCli = () => {
|
|
|
43
43
|
.description("Grant a deploy identity ownership of an already verified base domain.")
|
|
44
44
|
.requiredOption("--domain <domain>", "Verified base domain")
|
|
45
45
|
.requiredOption("--email <email>", "Deploy service account email")
|
|
46
|
-
.
|
|
47
|
-
|
|
46
|
+
.requiredOption("--quota-project <id>", "GCP project with Site Verification API enabled")
|
|
47
|
+
.action(async (options: { domain: string; email: string; quotaProject: string }) => {
|
|
48
|
+
output(await grantDomainOwner(options.domain, options.email, options.quotaProject));
|
|
48
49
|
});
|
|
49
50
|
|
|
50
51
|
cli
|
|
@@ -9,6 +9,7 @@ type WebResource = {
|
|
|
9
9
|
export const grantDomainOwner = async (
|
|
10
10
|
domain: string,
|
|
11
11
|
email: string,
|
|
12
|
+
quotaProject: string,
|
|
12
13
|
dependencies: {
|
|
13
14
|
getToken?: () => string;
|
|
14
15
|
request?: typeof fetch;
|
|
@@ -18,6 +19,8 @@ export const grantDomainOwner = async (
|
|
|
18
19
|
throw new Error("Provide a base domain such as example.com.");
|
|
19
20
|
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email))
|
|
20
21
|
throw new Error("Provide a service account email address.");
|
|
22
|
+
if (!/^[a-z][a-z0-9-]{4,61}[a-z0-9]$/.test(quotaProject))
|
|
23
|
+
throw new Error("Provide a valid Google quota project ID.");
|
|
21
24
|
|
|
22
25
|
const token = (
|
|
23
26
|
dependencies.getToken?.() ??
|
|
@@ -29,12 +32,15 @@ export const grantDomainOwner = async (
|
|
|
29
32
|
).trim();
|
|
30
33
|
const request = dependencies.request ?? fetch;
|
|
31
34
|
const base = "https://www.googleapis.com/siteVerification/v1/webResource";
|
|
32
|
-
const headers = {
|
|
35
|
+
const headers = {
|
|
36
|
+
Authorization: `Bearer ${token}`,
|
|
37
|
+
"x-goog-user-project": quotaProject,
|
|
38
|
+
};
|
|
33
39
|
const list = await request(base, { headers });
|
|
34
40
|
if (!list.ok) {
|
|
35
41
|
if (list.status === 403)
|
|
36
42
|
throw new Error(
|
|
37
|
-
|
|
43
|
+
`Google Site Verification denied access. Check the signed-in owner's siteverification scope, Service Usage Consumer permission, and that siteverification.googleapis.com is enabled on ${quotaProject}.`,
|
|
38
44
|
);
|
|
39
45
|
throw new Error(`Google Site Verification list failed (${list.status}).`);
|
|
40
46
|
}
|