@alphafox/cli 0.3.17 → 0.3.19

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.
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Raw API allowlist from the generated Operation Registry.
3
- * Finite set: infra catalog paths + CLI-included operation facade paths.
4
- * Unknown `/api/v1/*` paths are denied — raw API cannot bypass the catalog.
2
+ * Finite set: infrastructure catalog paths, CLI-included operation facade paths,
3
+ * and explicitly documented direct admin paths.
4
+ * Unknown paths are denied — raw API cannot bypass the catalog or admin allowlist.
5
5
  */
6
6
  /**
7
7
  * Infra paths always allowed (exact, except `/api/v1/operations/*`).
@@ -17,9 +17,9 @@ export declare function normalizeApiPath(path: string): string;
17
17
  export declare function isInternalDisallowedPath(path: string): boolean;
18
18
  /** Match OpenAPI-style templates: /api/v1/engine-backtest/experiments/{experimentId}. */
19
19
  export declare function pathTemplateMatches(template: string, actual: string, catchAll?: boolean): boolean;
20
+ export declare function isDirectAdminAllowlistedPath(path: string): boolean;
20
21
  /**
21
- * Finite allow set: infra catalog paths + generated operation facade paths.
22
- * Unknown `/api/v1/*` paths are denied.
23
- * Matching always uses the segment-resolved path (no `..` prefix smuggling).
22
+ * Finite allow set: infrastructure paths, generated facade paths, and exact
23
+ * direct admin paths. Matching always uses the segment-resolved path.
24
24
  */
25
25
  export declare function isFacadeAllowlistedPath(path: string, extraAllow?: readonly string[]): boolean;
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  /**
3
- * Raw API allowlist from the generated Operation Registry.
4
- * Finite set: infra catalog paths + CLI-included operation facade paths.
5
- * Unknown `/api/v1/*` paths are denied — raw API cannot bypass the catalog.
3
+ * Finite set: infrastructure catalog paths, CLI-included operation facade paths,
4
+ * and explicitly documented direct admin paths.
5
+ * Unknown paths are denied — raw API cannot bypass the catalog or admin allowlist.
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.FACILITY_ALWAYS_ALLOW = void 0;
9
9
  exports.normalizeApiPath = normalizeApiPath;
10
10
  exports.isInternalDisallowedPath = isInternalDisallowedPath;
11
11
  exports.pathTemplateMatches = pathTemplateMatches;
12
+ exports.isDirectAdminAllowlistedPath = isDirectAdminAllowlistedPath;
12
13
  exports.isFacadeAllowlistedPath = isFacadeAllowlistedPath;
13
14
  const operations_1 = require("./operations");
14
15
  const INTERNAL_PREFIXES = [
@@ -29,6 +30,9 @@ exports.FACILITY_ALWAYS_ALLOW = [
29
30
  "/api/v1/openapi",
30
31
  "/api/v1/operations",
31
32
  ];
33
+ const DIRECT_ADMIN_ALLOW = {
34
+ "/api/admin/passivbot-paper-acceptance-traders": true,
35
+ };
32
36
  /**
33
37
  * Decode percent-encoded path segments (up to twice for double-encoding)
34
38
  * without turning encoded slashes into separators mid-segment incorrectly:
@@ -128,6 +132,9 @@ function isInfraAllowlisted(n) {
128
132
  }
129
133
  return false;
130
134
  }
135
+ function isDirectAdminAllowlistedPath(path) {
136
+ return DIRECT_ADMIN_ALLOW[normalizeApiPath(path)] === true;
137
+ }
131
138
  function isCatalogPathMatch(n) {
132
139
  for (const op of operations_1.CATALOG_OPERATIONS) {
133
140
  if (pathTemplateMatches(op.path, n, Boolean(op.catchAll))) {
@@ -145,15 +152,17 @@ function isExtraAllowMatch(n, extraAllow) {
145
152
  return false;
146
153
  }
147
154
  /**
148
- * Finite allow set: infra catalog paths + generated operation facade paths.
149
- * Unknown `/api/v1/*` paths are denied.
150
- * Matching always uses the segment-resolved path (no `..` prefix smuggling).
155
+ * Finite allow set: infrastructure paths, generated facade paths, and exact
156
+ * direct admin paths. Matching always uses the segment-resolved path.
151
157
  */
152
158
  function isFacadeAllowlistedPath(path, extraAllow = []) {
153
159
  const n = normalizeApiPath(path);
154
160
  if (isInternalDisallowedPath(n)) {
155
161
  return false;
156
162
  }
163
+ if (isDirectAdminAllowlistedPath(n)) {
164
+ return true;
165
+ }
157
166
  if (n !== "/api/v1" && !n.startsWith("/api/v1/")) {
158
167
  return false;
159
168
  }
@@ -2,16 +2,16 @@
2
2
  "source": {
3
3
  "package": "@alphafoxai/contracts",
4
4
  "export": "public-api",
5
- "contractsSha": "3325449547f129a185a854ee6b81ba3efb447e5e",
6
- "registryVersion": "2.1.0",
7
- "contractVersion": "2026-08-30",
8
- "scannedAt": "2026-08-30",
9
- "totalOperations": 278,
10
- "cliOperations": 259
5
+ "contractsSha": "c2b17780baea3236ab1b7c0ec982f3f93f1ae08d",
6
+ "registryVersion": "3.0.0",
7
+ "contractVersion": "2026-08-31",
8
+ "scannedAt": "2026-08-31",
9
+ "totalOperations": 277,
10
+ "cliOperations": 258
11
11
  },
12
12
  "compatibility": {
13
- "contractVersion": "2026-08-30",
14
- "registryVersion": "2.1.0",
13
+ "contractVersion": "2026-08-31",
14
+ "registryVersion": "3.0.0",
15
15
  "minCliVersion": "0.0.0",
16
16
  "maxCliVersion": "0.99.99",
17
17
  "openapi": "3.1.0"
@@ -5262,30 +5262,6 @@
5262
5262
  "responseSchema": "JsonValue",
5263
5263
  "errorSchema": "ProblemDetails"
5264
5264
  },
5265
- {
5266
- "operationId": "trading.passivbot_paper_acceptance_traders.create",
5267
- "method": "POST",
5268
- "path": "/api/v1/trading/passivbot-paper-acceptance-traders",
5269
- "role": "user",
5270
- "risk": "write",
5271
- "auth": "bearer",
5272
- "scopes": [
5273
- "openid",
5274
- "profile",
5275
- "trading:write"
5276
- ],
5277
- "stream": false,
5278
- "file": false,
5279
- "pagination": false,
5280
- "idempotent": false,
5281
- "mvp": false,
5282
- "catchAll": false,
5283
- "contractStatus": "shared",
5284
- "requestBodySchema": "createPassivbotPaperAcceptanceTraderRequestSchema",
5285
- "querySchema": null,
5286
- "responseSchema": "createTraderResponseSchema",
5287
- "errorSchema": "ProblemDetails"
5288
- },
5289
5265
  {
5290
5266
  "operationId": "trading.rebate_copy_traders.create",
5291
5267
  "method": "POST",