@theholocron/holocron-plugin-github 5.0.0-alpha.585 → 5.0.0-alpha.587
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 +10 -3
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
import { AGGREGATE_CHECK_NAME, AuthError, MissingTokenError, ProviderApiError, areaLabelsForFiles, areaLabelsForTitle, connectionProbe, createFeatureResolver, pickByCreation, readKeysLimited, reportProgress, requiredChecksVerdict, tokenExpectations, whoamiAction } from "@theholocron/cli";
|
|
3
|
-
import { createGitHubClient, createGitHubClient as createGitHubClient$1 } from "@theholocron/github-client";
|
|
2
|
+
import { AGGREGATE_CHECK_NAME, AuthError, MissingTokenError, ProviderApiError, areaLabelsForFiles, areaLabelsForTitle, connectionProbe, createFeatureResolver, pickByCreation, readKeysLimited, reportProgress, requiredChecksVerdict, tokenExpectations, tokenRotationRows, whoamiAction } from "@theholocron/cli";
|
|
3
|
+
import { createGitHubClient, createGitHubClient as createGitHubClient$1, parseTokenExpiration } from "@theholocron/github-client";
|
|
4
4
|
import { mkdir, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
|
|
5
5
|
import { dirname, join } from "node:path";
|
|
6
6
|
import { findRootSync } from "@theholocron/fs-utils";
|
|
@@ -4394,7 +4394,8 @@ function rowFor({ label, permission, outcome }, rule) {
|
|
|
4394
4394
|
* With no layer the token is only described. When the CLI passes `--layer` (because `--environment` named `ci`, `dev` or
|
|
4395
4395
|
* `local`), the results are judged against what that token is meant to carry in that layer (the plugin's `tokens`
|
|
4396
4396
|
* declaration, read with `tokenExpectations()`) and shown in two groups, what it should have and what it should not,
|
|
4397
|
-
* where a missing or extra permission fails.
|
|
4397
|
+
* where a missing or extra permission fails. A judged token also gets a `Rotation` group: its expiry (GitHub's
|
|
4398
|
+
* `github-authentication-token-expiration` header) against the layer's rotation, failing under 14 days left.
|
|
4398
4399
|
*/
|
|
4399
4400
|
function tokenProbe(ctx) {
|
|
4400
4401
|
return {
|
|
@@ -4434,6 +4435,7 @@ function tokenProbe(ctx) {
|
|
|
4434
4435
|
return;
|
|
4435
4436
|
}
|
|
4436
4437
|
const scopes = identity.headers.get("x-oauth-scopes");
|
|
4438
|
+
const expiresAt = parseTokenExpiration(identity.headers.get("github-authentication-token-expiration"));
|
|
4437
4439
|
probe.say({
|
|
4438
4440
|
status: "ok",
|
|
4439
4441
|
label: "token",
|
|
@@ -4469,6 +4471,11 @@ function tokenProbe(ctx) {
|
|
|
4469
4471
|
});
|
|
4470
4472
|
for (const t of inGroup) probe.say(rowFor(t, rule));
|
|
4471
4473
|
}
|
|
4474
|
+
probe.say({
|
|
4475
|
+
status: "heading",
|
|
4476
|
+
label: "Rotation"
|
|
4477
|
+
});
|
|
4478
|
+
for (const r of tokenRotationRows(expiresAt ? { expiresAt } : {}, declared.rotation, (ctx.now ?? (() => /* @__PURE__ */ new Date()))())) probe.say(r);
|
|
4472
4479
|
}
|
|
4473
4480
|
};
|
|
4474
4481
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/holocron-plugin-github",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.587",
|
|
4
4
|
"description": "Holocron plugin for GitHub. Implements source, ci, secrets, environments, and issues capabilities against the GitHub REST API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ci",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"tsx": "4.23.15",
|
|
45
45
|
"typescript": "^6.0.3",
|
|
46
46
|
"vitest": "^5.1.1",
|
|
47
|
-
"@theholocron/cli": "5.0.0-alpha.
|
|
47
|
+
"@theholocron/cli": "5.0.0-alpha.587",
|
|
48
48
|
"@theholocron/eslint-config": "^8.9.0-alpha.24",
|
|
49
49
|
"@theholocron/fs-utils": "^1.17.0-alpha.9",
|
|
50
50
|
"@theholocron/github-client": "^1.58.0-alpha.70",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@theholocron/fs-utils": "^1.16.0",
|
|
59
59
|
"@theholocron/github-client": "^1.58.0",
|
|
60
60
|
"@theholocron/misc-utils": "^1.16.0",
|
|
61
|
-
"@theholocron/cli": "5.0.0-alpha.
|
|
61
|
+
"@theholocron/cli": "5.0.0-alpha.587"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": ">=22"
|