@theholocron/holocron-plugin-cloudflare 5.0.0-alpha.431 → 5.0.0-alpha.433
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/dist/index.mjs +11 -4
- package/package.json +7 -7
package/dist/index.mjs
CHANGED
|
@@ -400,18 +400,22 @@ function generateProxyScript(config) {
|
|
|
400
400
|
].join("\n");
|
|
401
401
|
}
|
|
402
402
|
// src/probes/token/parse-token-args.ts
|
|
403
|
-
/** Reads the words after the probe name: `--layer <word>` and any number of zone names. */
|
|
403
|
+
/** Reads the words after the probe name: `--layer <word>`, `--token-name <VAR>` and any number of zone names. */
|
|
404
404
|
function parseTokenArgs(args) {
|
|
405
405
|
const zones = [];
|
|
406
406
|
let layer;
|
|
407
|
+
let tokenName;
|
|
407
408
|
for (let i = 0; i < args.length; i++) {
|
|
408
409
|
const arg = args[i];
|
|
409
410
|
if (arg === "--layer") layer = args[++i];
|
|
410
411
|
else if (arg.startsWith("--layer=")) layer = arg.slice(8);
|
|
412
|
+
else if (arg === "--token-name") tokenName = args[++i];
|
|
413
|
+
else if (arg.startsWith("--token-name=")) tokenName = arg.slice(13);
|
|
411
414
|
else if (!arg.startsWith("--")) zones.push(arg);
|
|
412
415
|
}
|
|
413
416
|
return {
|
|
414
417
|
...layer ? { layer } : {},
|
|
418
|
+
...tokenName ? { tokenName } : {},
|
|
415
419
|
zones
|
|
416
420
|
};
|
|
417
421
|
}
|
|
@@ -493,7 +497,7 @@ function rowFor({ label, outcome }, rule) {
|
|
|
493
497
|
* `--token cloudflare=<token>` or `--environment <layer>` checks another one; the account id is the plugin's own.
|
|
494
498
|
*
|
|
495
499
|
* A token with no layer is only described. When the CLI passes `--layer` (because `--environment` named `ci`, `dev` or
|
|
496
|
-
* `local`), the results are judged against what that layer's token is meant to carry (the plugin's `tokens` declaration, read with `tokenExpectations()`) and shown in
|
|
500
|
+
* `local`) with `--token-name` (the declared token the Environment held, so the expectations are that token's own), the results are judged against what that layer's token is meant to carry (the plugin's `tokens` declaration, read with `tokenExpectations()`) and shown in
|
|
497
501
|
* two groups, what it should have and what it should not, where a missing or extra permission fails. The other words
|
|
498
502
|
* limit the zone checks to those zones; otherwise up to five are read. How the token is chosen is in `holocron probe --help`.
|
|
499
503
|
*/
|
|
@@ -506,8 +510,11 @@ function tokenProbe(ctx) {
|
|
|
506
510
|
const token = ctx.token();
|
|
507
511
|
probe.secret(token);
|
|
508
512
|
const client = ctx.client();
|
|
509
|
-
const { layer, zones: wanted } = parseTokenArgs(probe.args ?? []);
|
|
510
|
-
const rules = layer ? tokenExpectations(tokens, {
|
|
513
|
+
const { layer, tokenName, zones: wanted } = parseTokenArgs(probe.args ?? []);
|
|
514
|
+
const rules = layer ? tokenExpectations(tokens, {
|
|
515
|
+
layer,
|
|
516
|
+
...tokenName ? { envName: tokenName } : {}
|
|
517
|
+
})[0]?.rules : void 0;
|
|
511
518
|
if (layer && !rules) probe.say({
|
|
512
519
|
status: "info",
|
|
513
520
|
label: layer,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/holocron-plugin-cloudflare",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.433",
|
|
4
4
|
"description": "Holocron plugin for Cloudflare. Implements the dns capability against Cloudflare's REST API — zone resolution, DNS record management.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -44,20 +44,20 @@
|
|
|
44
44
|
"tsx": "4.23.15",
|
|
45
45
|
"typescript": "^5.9.3",
|
|
46
46
|
"vitest": "^5.1.0",
|
|
47
|
-
"@theholocron/cloudflare-client": "^1.58.0-alpha.29",
|
|
48
|
-
"@theholocron/cli": "5.0.0-alpha.431",
|
|
49
47
|
"@theholocron/eslint-config": "^8.9.0-alpha.17",
|
|
48
|
+
"@theholocron/cli": "5.0.0-alpha.433",
|
|
50
49
|
"@theholocron/http-client": "^1.58.0-alpha.29",
|
|
51
|
-
"@theholocron/tsconfig": "^8.9.0-alpha.17",
|
|
52
|
-
"@theholocron/kyber": "5.0.0-alpha.431",
|
|
53
50
|
"@theholocron/misc-utils": "^1.17.0-alpha.4",
|
|
51
|
+
"@theholocron/cloudflare-client": "^1.58.0-alpha.29",
|
|
52
|
+
"@theholocron/kyber": "5.0.0-alpha.433",
|
|
54
53
|
"@theholocron/tsdown-config": "^8.9.0-alpha.17",
|
|
55
|
-
"@theholocron/vitest-config": "^8.9.0-alpha.17"
|
|
54
|
+
"@theholocron/vitest-config": "^8.9.0-alpha.17",
|
|
55
|
+
"@theholocron/tsconfig": "^8.9.0-alpha.17"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@theholocron/cloudflare-client": "^1.53.1",
|
|
59
59
|
"@theholocron/misc-utils": "^1.16.0",
|
|
60
|
-
"@theholocron/cli": "5.0.0-alpha.
|
|
60
|
+
"@theholocron/cli": "5.0.0-alpha.433"
|
|
61
61
|
},
|
|
62
62
|
"peerDependenciesMeta": {
|
|
63
63
|
"@theholocron/cloudflare-client": {}
|