@cosmicdrift/kumiko-guards 0.283.0 → 0.285.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/package.json +2 -2
- package/src/_lib/scan-scope.ts +8 -4
- package/src/changes.json +6 -0
- package/src/guard-direct-fetch.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-guards",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.285.0",
|
|
4
4
|
"description": "AST-based security guards for Kumiko repos: direct-fs/fetch, tenant escalation, admin-API, escape hatches and related checks, run over a shared ts-morph project.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"kumiko-guards": "./src/cli.ts"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@cosmicdrift/kumiko-repo-manifest": "0.
|
|
30
|
+
"@cosmicdrift/kumiko-repo-manifest": "0.285.0",
|
|
31
31
|
"ts-morph": "^28.0.0"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
package/src/_lib/scan-scope.ts
CHANGED
|
@@ -9,7 +9,8 @@ export type ScanExtension = "ts" | "tsx";
|
|
|
9
9
|
|
|
10
10
|
type ScanSpecBase = {
|
|
11
11
|
readonly extensions: readonly ScanExtension[];
|
|
12
|
-
/** Manifest roles to scan; omitted = every root
|
|
12
|
+
/** Manifest roles to scan; omitted = every root except "tooling" — a guard
|
|
13
|
+
* must opt in to scanning an infra/build-tooling root explicitly. */
|
|
13
14
|
readonly kinds?: readonly RepoKind[];
|
|
14
15
|
/** Repo-relative globs; in a kind "framework" root only files matching one of them are kept (replaces `within` there). */
|
|
15
16
|
readonly frameworkWithin?: readonly string[];
|
|
@@ -141,10 +142,13 @@ function scanRoot(spec: ScanSpec, root: RepoRoot): RootScan {
|
|
|
141
142
|
return { root, files, sourceSurface: sourceSurfaceHits.length };
|
|
142
143
|
}
|
|
143
144
|
|
|
145
|
+
function keepsRootKind(spec: ScanSpec, root: RepoRoot): boolean {
|
|
146
|
+
if (spec.kinds) return spec.kinds.includes(root.kind);
|
|
147
|
+
return root.kind !== "tooling";
|
|
148
|
+
}
|
|
149
|
+
|
|
144
150
|
export function scanRoots(spec: ScanSpec, roots: readonly RepoRoot[]): RootScan[] {
|
|
145
|
-
return roots
|
|
146
|
-
.filter((root) => !spec.kinds || spec.kinds.includes(root.kind))
|
|
147
|
-
.map((root) => scanRoot(spec, root));
|
|
151
|
+
return roots.filter((root) => keepsRootKind(spec, root)).map((root) => scanRoot(spec, root));
|
|
148
152
|
}
|
|
149
153
|
|
|
150
154
|
export function scanFiles(spec: ScanSpec, roots: readonly RepoRoot[]): string[] {
|
package/src/changes.json
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.284.0",
|
|
4
|
+
"type": "fix",
|
|
5
|
+
"title": "Fix Direct-Fetch Guard allowlist after egress moved to kumiko-http",
|
|
6
|
+
"detail": "The ALLOWLIST regex still pointed at the old packages/framework/src/http/egress.ts path; egress() now lives in packages/http/src/egress.ts (@cosmicdrift/kumiko-http), so the guard was about to self-flag its own allowed implementation as a raw-fetch violation."
|
|
7
|
+
},
|
|
2
8
|
{
|
|
3
9
|
"version": "0.283.0",
|
|
4
10
|
"type": "fix",
|
|
@@ -43,8 +43,8 @@ const EXCLUDE =
|
|
|
43
43
|
// Prefixed by RepoRoot.name (not kind): kind "app" is shared across
|
|
44
44
|
// unregistered repos (infra#560).
|
|
45
45
|
|
|
46
|
-
// packages/
|
|
47
|
-
const ALLOWLIST = [/^kumiko-framework\/packages\/
|
|
46
|
+
// packages/http/src/egress.ts IS the egress() implementation.
|
|
47
|
+
const ALLOWLIST = [/^kumiko-framework\/packages\/http\/src\/egress\.ts$/];
|
|
48
48
|
const ALLOW_MARKER = "guard-allow: same-origin fetch";
|
|
49
49
|
|
|
50
50
|
interface Violation {
|