@intutic/shared-types 2.4.0 → 2.5.1
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 +9 -9
- package/dist/anomaly.d.ts +0 -19
- package/dist/anomaly.d.ts.map +1 -1
- package/dist/apiKeyScopes.d.ts +100 -0
- package/dist/apiKeyScopes.d.ts.map +1 -0
- package/dist/apiKeyScopes.js +142 -0
- package/dist/apiKeyScopes.js.map +1 -0
- package/dist/attenuation.d.ts +10 -5
- package/dist/attenuation.d.ts.map +1 -1
- package/dist/attenuation.js +17 -4
- package/dist/attenuation.js.map +1 -1
- package/dist/auth.d.ts +35 -4
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +26 -6
- package/dist/auth.js.map +1 -1
- package/dist/chaos.d.ts +2225 -0
- package/dist/chaos.d.ts.map +1 -0
- package/dist/chaos.js +358 -0
- package/dist/chaos.js.map +1 -0
- package/dist/chaosGate.d.ts +166 -0
- package/dist/chaosGate.d.ts.map +1 -0
- package/dist/chaosGate.js +383 -0
- package/dist/chaosGate.js.map +1 -0
- package/dist/enums.d.ts +9 -26
- package/dist/enums.d.ts.map +1 -1
- package/dist/enums.js +11 -28
- package/dist/enums.js.map +1 -1
- package/dist/errors.d.ts +6 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +6 -1
- package/dist/errors.js.map +1 -1
- package/dist/finops.d.ts +4 -20
- package/dist/finops.d.ts.map +1 -1
- package/dist/guardrailIr.d.ts +6 -6
- package/dist/guardrailRender.d.ts +51 -0
- package/dist/guardrailRender.d.ts.map +1 -1
- package/dist/guardrailRender.js +69 -1
- package/dist/guardrailRender.js.map +1 -1
- package/dist/identity.d.ts +0 -18
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +1 -5
- package/dist/identity.js.map +1 -1
- package/dist/index.d.ts +22 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +75 -13
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +3 -100
- package/dist/intelligence.d.ts.map +1 -1
- package/dist/intelligence.js +3 -3
- package/dist/intelligence.js.map +1 -1
- package/dist/mcpBudgets.d.ts +16 -16
- package/dist/mcpDaemonPolicyCache.d.ts +32 -0
- package/dist/mcpDaemonPolicyCache.d.ts.map +1 -0
- package/dist/mcpDaemonPolicyCache.js +43 -0
- package/dist/mcpDaemonPolicyCache.js.map +1 -0
- package/dist/notifications.d.ts +1 -1
- package/dist/notifications.d.ts.map +1 -1
- package/dist/notifications.js +9 -4
- package/dist/notifications.js.map +1 -1
- package/dist/observability.d.ts +0 -31
- package/dist/observability.d.ts.map +1 -1
- package/dist/observability.js +0 -7
- package/dist/observability.js.map +1 -1
- package/dist/opaqueRefusal.d.ts +40 -0
- package/dist/opaqueRefusal.d.ts.map +1 -0
- package/dist/opaqueRefusal.js +53 -0
- package/dist/opaqueRefusal.js.map +1 -0
- package/dist/piiDetectors.d.ts +3 -0
- package/dist/piiDetectors.d.ts.map +1 -1
- package/dist/piiDetectors.js.map +1 -1
- package/dist/piiDetectors.json +11 -6
- package/dist/policyGuardrails.d.ts +5 -5
- package/dist/posturePresets.d.ts.map +1 -1
- package/dist/posturePresets.js +12 -3
- package/dist/posturePresets.js.map +1 -1
- package/dist/responses/common.d.ts +53 -0
- package/dist/responses/common.d.ts.map +1 -0
- package/dist/responses/common.js +43 -0
- package/dist/responses/common.js.map +1 -0
- package/dist/responses/gateways.d.ts +4999 -0
- package/dist/responses/gateways.d.ts.map +1 -0
- package/dist/responses/gateways.js +394 -0
- package/dist/responses/gateways.js.map +1 -0
- package/dist/responses/guardrails.d.ts +5200 -0
- package/dist/responses/guardrails.d.ts.map +1 -0
- package/dist/responses/guardrails.js +374 -0
- package/dist/responses/guardrails.js.map +1 -0
- package/dist/responses/identity.d.ts +1667 -0
- package/dist/responses/identity.d.ts.map +1 -0
- package/dist/responses/identity.js +292 -0
- package/dist/responses/identity.js.map +1 -0
- package/dist/responses/index.d.ts +15 -0
- package/dist/responses/index.d.ts.map +1 -0
- package/dist/responses/index.js +31 -0
- package/dist/responses/index.js.map +1 -0
- package/dist/responses/integrations.d.ts +4118 -0
- package/dist/responses/integrations.d.ts.map +1 -0
- package/dist/responses/integrations.js +400 -0
- package/dist/responses/integrations.js.map +1 -0
- package/dist/responses/observability.d.ts +3222 -0
- package/dist/responses/observability.d.ts.map +1 -0
- package/dist/responses/observability.js +598 -0
- package/dist/responses/observability.js.map +1 -0
- package/dist/responses/orgSops.d.ts +112 -0
- package/dist/responses/orgSops.d.ts.map +1 -0
- package/dist/responses/orgSops.js +29 -0
- package/dist/responses/orgSops.js.map +1 -0
- package/dist/responses/rules.d.ts +1948 -0
- package/dist/responses/rules.d.ts.map +1 -0
- package/dist/responses/rules.js +352 -0
- package/dist/responses/rules.js.map +1 -0
- package/dist/skillScan.d.ts +31 -0
- package/dist/skillScan.d.ts.map +1 -1
- package/dist/skillScan.js +25 -1
- package/dist/skillScan.js.map +1 -1
- package/dist/sop.d.ts +8 -1
- package/dist/sop.d.ts.map +1 -1
- package/dist/sop.js.map +1 -1
- package/dist/taskManagement.d.ts +34 -82
- package/dist/taskManagement.d.ts.map +1 -1
- package/dist/taskManagement.js +4 -4
- package/dist/toolPoison.d.ts +15 -2
- package/dist/toolPoison.d.ts.map +1 -1
- package/dist/toolPoison.js +14 -4
- package/dist/toolPoison.js.map +1 -1
- package/dist/workspaceSettings.d.ts +33 -14
- package/dist/workspaceSettings.d.ts.map +1 -1
- package/dist/workspaceSettings.js +3 -1
- package/dist/workspaceSettings.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
## Scope
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
One source module per domain under `src/`. Among them:
|
|
12
12
|
|
|
13
13
|
| Module | Key Types |
|
|
14
14
|
|--------|-----------|
|
|
15
|
-
| `enums` | `EnforcementAction`, `HarnessType`, `RiskLevel`, `
|
|
16
|
-
| `finops` | `TraceEntry`, `
|
|
15
|
+
| `enums` | `EnforcementAction`, `HarnessType`, `RiskLevel`, `SopLifecycleState` |
|
|
16
|
+
| `finops` | `TraceEntry`, `CostBreakdown`, `TraceFilters` |
|
|
17
17
|
| `sop` | SOP lifecycle types, rule schemas, hook definitions |
|
|
18
18
|
| `auth` | Session, token, credential types |
|
|
19
19
|
| `identity` | SSO/OIDC provider config, cross-workspace user identity |
|
|
@@ -23,23 +23,23 @@
|
|
|
23
23
|
| `notifications` | Notification channels, alert templates, delivery status |
|
|
24
24
|
| `billing` | Subscription tiers, usage metering, invoice types |
|
|
25
25
|
| `observability` | Trace spans, metric definitions, log schemas |
|
|
26
|
+
| `responses/` | The control plane's response schemas (`<Thing>Response`, zod with the inferred type): what each route that declares one answers with, as published in the OpenAPI document |
|
|
26
27
|
|
|
27
28
|
## Usage
|
|
28
29
|
|
|
29
30
|
```typescript
|
|
30
|
-
import { EnforcementAction, HarnessType } from '@intutic/shared-types';
|
|
31
|
-
import { traceEntrySchema } from '@intutic/shared-types/finops';
|
|
31
|
+
import { EnforcementAction, HarnessType, CreateTraceSchema } from '@intutic/shared-types';
|
|
32
32
|
|
|
33
33
|
// Zod validation
|
|
34
|
-
const parsed =
|
|
34
|
+
const parsed = CreateTraceSchema.parse(rawData);
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
## Design Principles
|
|
38
38
|
|
|
39
39
|
- **Single source of truth**: All cross-package types live here. No type duplication.
|
|
40
|
-
- **Zod
|
|
41
|
-
- **Barrel exports**:
|
|
42
|
-
- **
|
|
40
|
+
- **Zod at the boundaries**: API payloads have Zod schemas, with their TypeScript types inferred via `z.infer<>`; other shapes are plain interfaces.
|
|
41
|
+
- **Barrel exports**: `index.ts` is the single entry point; import from the package root (there are no subpath exports).
|
|
42
|
+
- **Minimal runtime dependencies**: Zod and `@intutic/anomaly-taxonomy`, nothing else.
|
|
43
43
|
|
|
44
44
|
## Installation
|
|
45
45
|
|
package/dist/anomaly.d.ts
CHANGED
|
@@ -219,23 +219,4 @@ export interface CapabilityMissInput {
|
|
|
219
219
|
similarityScore?: number;
|
|
220
220
|
recommendedAction?: 'AUTHOR_NEW_SOP' | 'EXTEND_EXISTING_SOP';
|
|
221
221
|
}
|
|
222
|
-
/**
|
|
223
|
-
* Drift direction classification.
|
|
224
|
-
*
|
|
225
|
-
* HLD §7.7 — Behavioral Drift Detector
|
|
226
|
-
*/
|
|
227
|
-
export type DriftDirection = 'POSITIVE_DRIFT' | 'NEGATIVE_DRIFT' | 'NEUTRAL_DRIFT';
|
|
228
|
-
/**
|
|
229
|
-
* Drift detection event payload.
|
|
230
|
-
*
|
|
231
|
-
* anomaly.drift.detected event
|
|
232
|
-
*/
|
|
233
|
-
export interface DriftEvent {
|
|
234
|
-
workspaceId: string;
|
|
235
|
-
sopId: string;
|
|
236
|
-
driftScore: number;
|
|
237
|
-
driftDirection: DriftDirection;
|
|
238
|
-
baselineScore: number;
|
|
239
|
-
currentScore: number;
|
|
240
|
-
}
|
|
241
222
|
//# sourceMappingURL=anomaly.d.ts.map
|
package/dist/anomaly.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anomaly.d.ts","sourceRoot":"","sources":["../src/anomaly.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAI7C;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,4DAA4D;IAC5D,IAAI,EAAE,WAAW,CAAA;IAEjB,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAA;IAElB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC;AAID;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,uCAAuC;IACvC,QAAQ,EAAE,OAAO,CAAA;IAEjB,0EAA0E;IAC1E,WAAW,EAAE,WAAW,GAAG,IAAI,CAAA;IA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oDAAoD;IACpD,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAE3B,+CAA+C;IAC/C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAE9B,0CAA0C;IAC1C,iBAAiB,EAAE,gBAAgB,GAAG,qBAAqB,CAAA;CAC5D;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,iBAAiB,CAAC,EAAE,gBAAgB,GAAG,qBAAqB,CAAA;CAC7D"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API key scopes — what a `vk_` key may do, on top of its owner's role.
|
|
3
|
+
*
|
|
4
|
+
* One small, fixed vocabulary, in the shape GitHub fine-grained tokens, Stripe
|
|
5
|
+
* restricted keys, OpenAI project keys and Cloudflare API tokens share: a
|
|
6
|
+
* resource area with a `read` or `write` level, `write` covering `read`, and
|
|
7
|
+
* everything not granted refused. Three kinds of scope:
|
|
8
|
+
*
|
|
9
|
+
* - `*` — everything the owner's role allows. The default, and what every key
|
|
10
|
+
* minted before scopes were enforced holds.
|
|
11
|
+
* - `gateway:use` — agent traffic: what the proxy, the hook gates, the SDKs,
|
|
12
|
+
* the MCP proxy and the sync daemon send with a key (LLM calls through the
|
|
13
|
+
* proxy, gate checks, hook events, trace sync-back, holds). The scope for a
|
|
14
|
+
* key that only runs agents.
|
|
15
|
+
* - `<area>:read` / `<area>:write` — the REST API by area.
|
|
16
|
+
*
|
|
17
|
+
* A request made with a key needs BOTH: the owner's role must allow the route
|
|
18
|
+
* and the key's scopes must cover it. A dashboard session has no scopes; only
|
|
19
|
+
* its role applies. The control plane maps every route to the scopes that
|
|
20
|
+
* cover it (`services/control-plane/src/lib/routeScopes.ts`) and refuses an
|
|
21
|
+
* uncovered request with 403 `INSUFFICIENT_SCOPE`.
|
|
22
|
+
*
|
|
23
|
+
* Mirrored by the Terraform provider's `validKeyScopes` (checked by
|
|
24
|
+
* `__tests__/apiKeyScopes.test.ts`) and published in `apps/docs/reference/api.md`
|
|
25
|
+
* (generated from this file).
|
|
26
|
+
*
|
|
27
|
+
* @module
|
|
28
|
+
*/
|
|
29
|
+
/** Every REST area a scope can name, with what it covers. Order is the display order. */
|
|
30
|
+
export declare const API_SCOPE_AREAS: {
|
|
31
|
+
readonly traces: "traces, agent sessions, plans, loop runs, trajectories, agents and the tamper-evident trace chain";
|
|
32
|
+
readonly usage: "usage, cost and routing analytics, cost prediction and provider incidents";
|
|
33
|
+
readonly findings: "findings, incidents, anomalies, holds and decisions, judge reviews, governance cards, trust scores and break-glass";
|
|
34
|
+
readonly sops: "SOPs and their lifecycle, skills, the dream cycle, MetaClaw and optimisation suggestions";
|
|
35
|
+
readonly policies: "policies, guardrails and policy documents, WASM rules, rule candidates and the evaluator sandbox";
|
|
36
|
+
readonly compliance: "compliance coverage, probes and evidence exports, and the audit timeline";
|
|
37
|
+
readonly inventory: "developer machines, harnesses, MCP servers, self-hosted gateways and governance coverage";
|
|
38
|
+
readonly settings: "workspace settings, provider credentials, region, orgs and teams, domains, SSO providers and the license";
|
|
39
|
+
readonly members: "members, invitations, roles, profiles and SCIM tokens";
|
|
40
|
+
readonly keys: "API keys, attenuated child keys and on-behalf-of tokens";
|
|
41
|
+
readonly billing: "billing, invoices, budgets and trials";
|
|
42
|
+
readonly siem: "SIEM destinations and their dead-letter queue, and notification rules";
|
|
43
|
+
readonly integrations: "connectors and the GitHub, Slack and task-tracker integrations";
|
|
44
|
+
};
|
|
45
|
+
/** A REST area a scope can name. */
|
|
46
|
+
export type ApiKeyScopeArea = keyof typeof API_SCOPE_AREAS;
|
|
47
|
+
/** The scope that covers agent traffic. */
|
|
48
|
+
export declare const GATEWAY_USE_SCOPE: "gateway:use";
|
|
49
|
+
/** The scope that covers everything the owner's role allows. */
|
|
50
|
+
export declare const ALL_SCOPES: "*";
|
|
51
|
+
/** One scope a key can hold. */
|
|
52
|
+
export type ApiKeyScope = typeof ALL_SCOPES | typeof GATEWAY_USE_SCOPE | `${ApiKeyScopeArea}:${'read' | 'write'}`;
|
|
53
|
+
/** A scope with what it grants, as the dashboard, the CLI and the docs show it. */
|
|
54
|
+
export interface ApiKeyScopeEntry {
|
|
55
|
+
scope: ApiKeyScope;
|
|
56
|
+
description: string;
|
|
57
|
+
}
|
|
58
|
+
/** The registry: every valid scope, in display order. */
|
|
59
|
+
export declare const API_SCOPES: readonly ApiKeyScopeEntry[];
|
|
60
|
+
/** Every valid scope string. */
|
|
61
|
+
export declare const API_SCOPE_NAMES: readonly ApiKeyScope[];
|
|
62
|
+
/** The least-privilege preset for a key that only runs agents, CI jobs or a proxy. */
|
|
63
|
+
export declare const AUTOMATION_KEY_SCOPES: readonly ApiKeyScope[];
|
|
64
|
+
/** Whether `scope` is in the registry. */
|
|
65
|
+
export declare function isApiKeyScope(scope: string): scope is ApiKeyScope;
|
|
66
|
+
/** The scopes in `scopes` that are not in the registry. */
|
|
67
|
+
export declare function unknownApiKeyScopes(scopes: readonly string[]): string[];
|
|
68
|
+
/**
|
|
69
|
+
* Whether a key holding `granted` may act with `required`: `*` grants every
|
|
70
|
+
* scope, and `<area>:write` grants `<area>:read`.
|
|
71
|
+
*/
|
|
72
|
+
export declare function scopeGrants(granted: readonly string[], required: string): boolean;
|
|
73
|
+
/** Whether a key holding `granted` may act with at least one of `anyOf`. */
|
|
74
|
+
export declare function scopesGrantAny(granted: readonly string[], anyOf: readonly string[]): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* What a key's stored scopes mean today.
|
|
77
|
+
*
|
|
78
|
+
* - All known: those scopes.
|
|
79
|
+
* - None known (a key written with free-form scope strings before scopes were
|
|
80
|
+
* enforced, such as `["read"]`): `*`, flagged `legacy`, for one release —
|
|
81
|
+
* until 2.6.0, when such a key is refused. The control plane logs a
|
|
82
|
+
* deprecation warning on each use and the dashboard marks the key.
|
|
83
|
+
* - Some known: the known ones; the unknown ones grant nothing.
|
|
84
|
+
* - Missing (a NULL column): `*`, the column's default.
|
|
85
|
+
*/
|
|
86
|
+
export declare function effectiveApiKeyScopes(stored: unknown): {
|
|
87
|
+
scopes: ApiKeyScope[];
|
|
88
|
+
legacy: boolean;
|
|
89
|
+
ignored: string[];
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* The smallest list granting the same as `scopes`: `*` alone when present,
|
|
93
|
+
* and an area's `read` dropped when its `write` is there. Registry order.
|
|
94
|
+
*/
|
|
95
|
+
export declare function compactScopes(scopes: readonly string[]): ApiKeyScope[];
|
|
96
|
+
/** What both `a` and `b` grant, compacted — a child key's reach under its parent. */
|
|
97
|
+
export declare function intersectScopes(a: readonly string[], b: readonly string[]): ApiKeyScope[];
|
|
98
|
+
/** The message naming the valid scopes, for a request that sent an unknown one. */
|
|
99
|
+
export declare function unknownScopesMessage(unknown: readonly string[]): string;
|
|
100
|
+
//# sourceMappingURL=apiKeyScopes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiKeyScopes.d.ts","sourceRoot":"","sources":["../src/apiKeyScopes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,yFAAyF;AACzF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;CAclB,CAAA;AAEV,oCAAoC;AACpC,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,eAAe,CAAA;AAE1D,2CAA2C;AAC3C,eAAO,MAAM,iBAAiB,EAAG,aAAsB,CAAA;AAEvD,gEAAgE;AAChE,eAAO,MAAM,UAAU,EAAG,GAAY,CAAA;AAEtC,gCAAgC;AAChC,MAAM,MAAM,WAAW,GAAG,OAAO,UAAU,GAAG,OAAO,iBAAiB,GAAG,GAAG,eAAe,IAAI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B,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAEvE"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* API key scopes — what a `vk_` key may do, on top of its owner's role.
|
|
4
|
+
*
|
|
5
|
+
* One small, fixed vocabulary, in the shape GitHub fine-grained tokens, Stripe
|
|
6
|
+
* restricted keys, OpenAI project keys and Cloudflare API tokens share: a
|
|
7
|
+
* resource area with a `read` or `write` level, `write` covering `read`, and
|
|
8
|
+
* everything not granted refused. Three kinds of scope:
|
|
9
|
+
*
|
|
10
|
+
* - `*` — everything the owner's role allows. The default, and what every key
|
|
11
|
+
* minted before scopes were enforced holds.
|
|
12
|
+
* - `gateway:use` — agent traffic: what the proxy, the hook gates, the SDKs,
|
|
13
|
+
* the MCP proxy and the sync daemon send with a key (LLM calls through the
|
|
14
|
+
* proxy, gate checks, hook events, trace sync-back, holds). The scope for a
|
|
15
|
+
* key that only runs agents.
|
|
16
|
+
* - `<area>:read` / `<area>:write` — the REST API by area.
|
|
17
|
+
*
|
|
18
|
+
* A request made with a key needs BOTH: the owner's role must allow the route
|
|
19
|
+
* and the key's scopes must cover it. A dashboard session has no scopes; only
|
|
20
|
+
* its role applies. The control plane maps every route to the scopes that
|
|
21
|
+
* cover it (`services/control-plane/src/lib/routeScopes.ts`) and refuses an
|
|
22
|
+
* uncovered request with 403 `INSUFFICIENT_SCOPE`.
|
|
23
|
+
*
|
|
24
|
+
* Mirrored by the Terraform provider's `validKeyScopes` (checked by
|
|
25
|
+
* `__tests__/apiKeyScopes.test.ts`) and published in `apps/docs/reference/api.md`
|
|
26
|
+
* (generated from this file).
|
|
27
|
+
*
|
|
28
|
+
* @module
|
|
29
|
+
*/
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.AUTOMATION_KEY_SCOPES = exports.API_SCOPE_NAMES = exports.API_SCOPES = exports.ALL_SCOPES = exports.GATEWAY_USE_SCOPE = exports.API_SCOPE_AREAS = void 0;
|
|
32
|
+
exports.isApiKeyScope = isApiKeyScope;
|
|
33
|
+
exports.unknownApiKeyScopes = unknownApiKeyScopes;
|
|
34
|
+
exports.scopeGrants = scopeGrants;
|
|
35
|
+
exports.scopesGrantAny = scopesGrantAny;
|
|
36
|
+
exports.effectiveApiKeyScopes = effectiveApiKeyScopes;
|
|
37
|
+
exports.compactScopes = compactScopes;
|
|
38
|
+
exports.intersectScopes = intersectScopes;
|
|
39
|
+
exports.unknownScopesMessage = unknownScopesMessage;
|
|
40
|
+
/** Every REST area a scope can name, with what it covers. Order is the display order. */
|
|
41
|
+
exports.API_SCOPE_AREAS = {
|
|
42
|
+
traces: 'traces, agent sessions, plans, loop runs, trajectories, agents and the tamper-evident trace chain',
|
|
43
|
+
usage: 'usage, cost and routing analytics, cost prediction and provider incidents',
|
|
44
|
+
findings: 'findings, incidents, anomalies, holds and decisions, judge reviews, governance cards, trust scores and break-glass',
|
|
45
|
+
sops: 'SOPs and their lifecycle, skills, the dream cycle, MetaClaw and optimisation suggestions',
|
|
46
|
+
policies: 'policies, guardrails and policy documents, WASM rules, rule candidates and the evaluator sandbox',
|
|
47
|
+
compliance: 'compliance coverage, probes and evidence exports, and the audit timeline',
|
|
48
|
+
inventory: 'developer machines, harnesses, MCP servers, self-hosted gateways and governance coverage',
|
|
49
|
+
settings: 'workspace settings, provider credentials, region, orgs and teams, domains, SSO providers and the license',
|
|
50
|
+
members: 'members, invitations, roles, profiles and SCIM tokens',
|
|
51
|
+
keys: 'API keys, attenuated child keys and on-behalf-of tokens',
|
|
52
|
+
billing: 'billing, invoices, budgets and trials',
|
|
53
|
+
siem: 'SIEM destinations and their dead-letter queue, and notification rules',
|
|
54
|
+
integrations: 'connectors and the GitHub, Slack and task-tracker integrations',
|
|
55
|
+
};
|
|
56
|
+
/** The scope that covers agent traffic. */
|
|
57
|
+
exports.GATEWAY_USE_SCOPE = 'gateway:use';
|
|
58
|
+
/** The scope that covers everything the owner's role allows. */
|
|
59
|
+
exports.ALL_SCOPES = '*';
|
|
60
|
+
/** The registry: every valid scope, in display order. */
|
|
61
|
+
exports.API_SCOPES = [
|
|
62
|
+
{ scope: exports.ALL_SCOPES, description: "Everything the key owner's role allows (the default)" },
|
|
63
|
+
{
|
|
64
|
+
scope: exports.GATEWAY_USE_SCOPE,
|
|
65
|
+
description: 'Agent traffic: LLM calls through the proxy, hook-gate checks, hook events, trace sync-back, sessions, holds, SOP rules, the policy snapshot and the workspace settings agents read',
|
|
66
|
+
},
|
|
67
|
+
...Object.entries(exports.API_SCOPE_AREAS).flatMap(([area, covers]) => [
|
|
68
|
+
{ scope: `${area}:read`, description: `Read ${covers}` },
|
|
69
|
+
{ scope: `${area}:write`, description: `Read and change ${covers}` },
|
|
70
|
+
]),
|
|
71
|
+
];
|
|
72
|
+
/** Every valid scope string. */
|
|
73
|
+
exports.API_SCOPE_NAMES = exports.API_SCOPES.map((s) => s.scope);
|
|
74
|
+
const SCOPE_SET = new Set(exports.API_SCOPE_NAMES);
|
|
75
|
+
/** The least-privilege preset for a key that only runs agents, CI jobs or a proxy. */
|
|
76
|
+
exports.AUTOMATION_KEY_SCOPES = [exports.GATEWAY_USE_SCOPE];
|
|
77
|
+
/** Whether `scope` is in the registry. */
|
|
78
|
+
function isApiKeyScope(scope) {
|
|
79
|
+
return SCOPE_SET.has(scope);
|
|
80
|
+
}
|
|
81
|
+
/** The scopes in `scopes` that are not in the registry. */
|
|
82
|
+
function unknownApiKeyScopes(scopes) {
|
|
83
|
+
return scopes.filter((s) => !SCOPE_SET.has(s));
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Whether a key holding `granted` may act with `required`: `*` grants every
|
|
87
|
+
* scope, and `<area>:write` grants `<area>:read`.
|
|
88
|
+
*/
|
|
89
|
+
function scopeGrants(granted, required) {
|
|
90
|
+
if (granted.includes(exports.ALL_SCOPES))
|
|
91
|
+
return true;
|
|
92
|
+
if (granted.includes(required))
|
|
93
|
+
return true;
|
|
94
|
+
if (required.endsWith(':read'))
|
|
95
|
+
return granted.includes(`${required.slice(0, -':read'.length)}:write`);
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
/** Whether a key holding `granted` may act with at least one of `anyOf`. */
|
|
99
|
+
function scopesGrantAny(granted, anyOf) {
|
|
100
|
+
return anyOf.some((r) => scopeGrants(granted, r));
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* What a key's stored scopes mean today.
|
|
104
|
+
*
|
|
105
|
+
* - All known: those scopes.
|
|
106
|
+
* - None known (a key written with free-form scope strings before scopes were
|
|
107
|
+
* enforced, such as `["read"]`): `*`, flagged `legacy`, for one release —
|
|
108
|
+
* until 2.6.0, when such a key is refused. The control plane logs a
|
|
109
|
+
* deprecation warning on each use and the dashboard marks the key.
|
|
110
|
+
* - Some known: the known ones; the unknown ones grant nothing.
|
|
111
|
+
* - Missing (a NULL column): `*`, the column's default.
|
|
112
|
+
*/
|
|
113
|
+
function effectiveApiKeyScopes(stored) {
|
|
114
|
+
if (!Array.isArray(stored))
|
|
115
|
+
return { scopes: [exports.ALL_SCOPES], legacy: false, ignored: [] };
|
|
116
|
+
const strings = stored.filter((s) => typeof s === 'string');
|
|
117
|
+
const known = strings.filter(isApiKeyScope);
|
|
118
|
+
const ignored = strings.filter((s) => !SCOPE_SET.has(s));
|
|
119
|
+
if (known.length === 0)
|
|
120
|
+
return { scopes: [exports.ALL_SCOPES], legacy: true, ignored };
|
|
121
|
+
return { scopes: compactScopes(known), legacy: false, ignored };
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The smallest list granting the same as `scopes`: `*` alone when present,
|
|
125
|
+
* and an area's `read` dropped when its `write` is there. Registry order.
|
|
126
|
+
*/
|
|
127
|
+
function compactScopes(scopes) {
|
|
128
|
+
if (scopes.includes(exports.ALL_SCOPES))
|
|
129
|
+
return [exports.ALL_SCOPES];
|
|
130
|
+
return exports.API_SCOPE_NAMES.filter((s) => s !== exports.ALL_SCOPES && scopes.includes(s) && !(s.endsWith(':read') && scopes.includes(`${s.slice(0, -':read'.length)}:write`)));
|
|
131
|
+
}
|
|
132
|
+
/** What both `a` and `b` grant, compacted — a child key's reach under its parent. */
|
|
133
|
+
function intersectScopes(a, b) {
|
|
134
|
+
if (a.includes(exports.ALL_SCOPES) && b.includes(exports.ALL_SCOPES))
|
|
135
|
+
return [exports.ALL_SCOPES];
|
|
136
|
+
return compactScopes(exports.API_SCOPE_NAMES.filter((s) => s !== exports.ALL_SCOPES && scopeGrants(a, s) && scopeGrants(b, s)));
|
|
137
|
+
}
|
|
138
|
+
/** The message naming the valid scopes, for a request that sent an unknown one. */
|
|
139
|
+
function unknownScopesMessage(unknown) {
|
|
140
|
+
return `Unknown scope${unknown.length === 1 ? '' : 's'} ${unknown.map((s) => `"${s}"`).join(', ')}. Valid scopes: ${exports.API_SCOPE_NAMES.join(', ')}`;
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=apiKeyScopes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiKeyScopes.js","sourceRoot":"","sources":["../src/apiKeyScopes.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;;;AA4DH,sCAEC;AAGD,kDAEC;AAMD,kCAKC;AAGD,wCAEC;AAaD,sDAOC;AAMD,sCAKC;AAGD,0CAGC;AAGD,oDAEC;AA3HD,yFAAyF;AAC5E,QAAA,eAAe,GAAG;IAC7B,MAAM,EAAE,mGAAmG;IAC3G,KAAK,EAAE,2EAA2E;IAClF,QAAQ,EAAE,oHAAoH;IAC9H,IAAI,EAAE,0FAA0F;IAChG,QAAQ,EAAE,kGAAkG;IAC5G,UAAU,EAAE,0EAA0E;IACtF,SAAS,EAAE,0FAA0F;IACrG,QAAQ,EAAE,0GAA0G;IACpH,OAAO,EAAE,uDAAuD;IAChE,IAAI,EAAE,yDAAyD;IAC/D,OAAO,EAAE,uCAAuC;IAChD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AC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,uBAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAA;AAClJ,CAAC"}
|
package/dist/attenuation.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Attenuation
|
|
2
|
+
* Attenuation types (Enterprise Identity & Compliance)
|
|
3
3
|
*
|
|
4
|
-
* DCT Token Attenuation (Patent Family A), OBO Ephemeral Tokens
|
|
5
|
-
*
|
|
4
|
+
* DCT Token Attenuation (Patent Family A), OBO Ephemeral Tokens and SSO
|
|
5
|
+
* Group Privilege Scoping. Per-user GDPR erasure has no types here: it is an
|
|
6
|
+
* operator script over the control plane's data erasure service.
|
|
6
7
|
*
|
|
7
8
|
* HLD §5.1, §5.6 — Zero-Trust Identity Broker
|
|
8
9
|
*
|
|
@@ -71,7 +72,7 @@ export interface AttenuationChainLink {
|
|
|
71
72
|
childKeyId: string;
|
|
72
73
|
/** Workspace scope */
|
|
73
74
|
workspaceId: string;
|
|
74
|
-
/**
|
|
75
|
+
/** Scopes granted to the child key */
|
|
75
76
|
grantedCaps: string[];
|
|
76
77
|
/** Chain expiry (ISO-8601) */
|
|
77
78
|
expiresAt: string;
|
|
@@ -81,7 +82,11 @@ export interface AttenuationChainLink {
|
|
|
81
82
|
/** Request schema for token attenuation. */
|
|
82
83
|
export declare const AttenuateTokenInputSchema: z.ZodObject<{
|
|
83
84
|
parentKeyId: z.ZodString;
|
|
84
|
-
|
|
85
|
+
/**
|
|
86
|
+
* The child key's scopes (`API_SCOPES`), each one granted by the parent
|
|
87
|
+
* key: a child can only narrow.
|
|
88
|
+
*/
|
|
89
|
+
requestedCaps: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>;
|
|
85
90
|
ttlSeconds: z.ZodOptional<z.ZodNumber>;
|
|
86
91
|
}, "strip", z.ZodTypeAny, {
|
|
87
92
|
parentKeyId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attenuation.d.ts","sourceRoot":"","sources":["../src/attenuation.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"attenuation.d.ts","sourceRoot":"","sources":["../src/attenuation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,+CAA+C;IAC/C,OAAO,EAAE,MAAM,CAAA;IACf,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,sBAAsB;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,qCAAqC;IACrC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,2DAA2D;IAC3D,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAA;IAChB,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,6CAA6C;AAC7C,eAAO,MAAM,wBAAwB;;;;;;;;;EAGnC,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAIzE;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAA;IAChB,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,kCAAkC;IAClC,kBAAkB,EAAE,MAAM,CAAA;IAC1B,8DAA8D;IAC9D,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAA;IACnB,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,sBAAsB;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,sCAAsC;IACtC,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,4CAA4C;AAC5C,eAAO,MAAM,yBAAyB;;IAEpC;;;OAGG;;;;;;;;;;;EASH,CAAA;AACF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAK3E;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAA;AAErE;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,0FAA0F;IAC1F,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,+DAA+D;IAC/D,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,4EAA4E;IAC5E,aAAa,EAAE,MAAM,EAAE,CAAA;CACxB"}
|
package/dist/attenuation.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Attenuation
|
|
3
|
+
* Attenuation types (Enterprise Identity & Compliance)
|
|
4
4
|
*
|
|
5
|
-
* DCT Token Attenuation (Patent Family A), OBO Ephemeral Tokens
|
|
6
|
-
*
|
|
5
|
+
* DCT Token Attenuation (Patent Family A), OBO Ephemeral Tokens and SSO
|
|
6
|
+
* Group Privilege Scoping. Per-user GDPR erasure has no types here: it is an
|
|
7
|
+
* operator script over the control plane's data erasure service.
|
|
7
8
|
*
|
|
8
9
|
* HLD §5.1, §5.6 — Zero-Trust Identity Broker
|
|
9
10
|
*
|
|
@@ -12,6 +13,7 @@
|
|
|
12
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
14
|
exports.AttenuateTokenInputSchema = exports.IssueOboTokenInputSchema = void 0;
|
|
14
15
|
const zod_1 = require("zod");
|
|
16
|
+
const apiKeyScopes_js_1 = require("./apiKeyScopes.js");
|
|
15
17
|
/** Request schema for OBO token issuance. */
|
|
16
18
|
exports.IssueOboTokenInputSchema = zod_1.z.object({
|
|
17
19
|
sessionId: zod_1.z.string().min(1).optional(),
|
|
@@ -20,7 +22,18 @@ exports.IssueOboTokenInputSchema = zod_1.z.object({
|
|
|
20
22
|
/** Request schema for token attenuation. */
|
|
21
23
|
exports.AttenuateTokenInputSchema = zod_1.z.object({
|
|
22
24
|
parentKeyId: zod_1.z.string().min(1),
|
|
23
|
-
|
|
25
|
+
/**
|
|
26
|
+
* The child key's scopes (`API_SCOPES`), each one granted by the parent
|
|
27
|
+
* key: a child can only narrow.
|
|
28
|
+
*/
|
|
29
|
+
requestedCaps: zod_1.z
|
|
30
|
+
.array(zod_1.z.string().min(1))
|
|
31
|
+
.min(1, 'At least one scope must be requested')
|
|
32
|
+
.superRefine((caps, ctx) => {
|
|
33
|
+
const unknown = (0, apiKeyScopes_js_1.unknownApiKeyScopes)(caps);
|
|
34
|
+
if (unknown.length > 0)
|
|
35
|
+
ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, message: (0, apiKeyScopes_js_1.unknownScopesMessage)(unknown) });
|
|
36
|
+
}),
|
|
24
37
|
ttlSeconds: zod_1.z.number().int().min(60).max(86400).optional(),
|
|
25
38
|
});
|
|
26
39
|
//# sourceMappingURL=attenuation.js.map
|
package/dist/attenuation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attenuation.js","sourceRoot":"","sources":["../src/attenuation.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"attenuation.js","sourceRoot":"","sources":["../src/attenuation.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,6BAAuB;AACvB,uDAA6E;AA2B7E,6CAA6C;AAChC,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACvC,WAAW,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,qCAAqC,CAAC;CACtF,CAAC,CAAA;AA0CF,4CAA4C;AAC/B,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B;;;OAGG;IACH,aAAa,EAAE,OAAC;SACb,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACxB,GAAG,CAAC,CAAC,EAAE,sCAAsC,CAAC;SAC9C,WAAW,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QACzB,MAAM,OAAO,GAAG,IAAA,qCAAmB,EAAC,IAAI,CAAC,CAAA;QACzC,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;YAAE,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,IAAA,sCAAoB,EAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAC/G,CAAC,CAAC;IACJ,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;CAC3D,CAAC,CAAA"}
|
package/dist/auth.d.ts
CHANGED
|
@@ -61,6 +61,15 @@ export interface AuthContext {
|
|
|
61
61
|
hardBudgets?: HardBudgetWire[];
|
|
62
62
|
/** The key's requests-per-minute and tokens-per-minute limits, when it has either. */
|
|
63
63
|
rateLimit?: KeyRateLimit;
|
|
64
|
+
/**
|
|
65
|
+
* What the `vk_` key may do on top of its owner's role (`apiKeyScopes.ts`),
|
|
66
|
+
* already resolved: `*` for a key whose stored scopes predate the registry,
|
|
67
|
+
* and narrowed by every key above an attenuated child. Absent on a session
|
|
68
|
+
* JWT, which has no scopes. The proxy reads it from the cached entry and
|
|
69
|
+
* refuses LLM traffic from a key without `gateway:use`; an entry without the
|
|
70
|
+
* field was written before scopes were enforced.
|
|
71
|
+
*/
|
|
72
|
+
scopes?: string[];
|
|
64
73
|
}
|
|
65
74
|
/** JWT access token payload (compact claims). */
|
|
66
75
|
export interface JwtPayload {
|
|
@@ -347,10 +356,19 @@ export declare const MagicLinkLoginInputSchema: z.ZodObject<{
|
|
|
347
356
|
}>;
|
|
348
357
|
/** Magic link login input. */
|
|
349
358
|
export type MagicLinkLoginInput = z.infer<typeof MagicLinkLoginInputSchema>;
|
|
359
|
+
/**
|
|
360
|
+
* A key's scope list: at least one, at most every scope, each one in the
|
|
361
|
+
* registry. An unknown scope is refused with a message naming the valid ones.
|
|
362
|
+
*/
|
|
363
|
+
export declare const ApiKeyScopeListSchema: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>;
|
|
350
364
|
/** API key creation request schema. */
|
|
351
365
|
export declare const CreateApiKeyInputSchema: z.ZodObject<{
|
|
352
366
|
label: z.ZodString;
|
|
353
|
-
|
|
367
|
+
/**
|
|
368
|
+
* What the key may do on top of its owner's role; `["*"]` (everything) when
|
|
369
|
+
* omitted. Every entry must be in the registry (`API_SCOPES`).
|
|
370
|
+
*/
|
|
371
|
+
scopes: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
354
372
|
expiresInDays: z.ZodOptional<z.ZodNumber>;
|
|
355
373
|
/**
|
|
356
374
|
* Optional per-key model allowlist. Omitted or empty inherits the workspace's
|
|
@@ -397,10 +415,10 @@ export interface CreateApiKeyResult {
|
|
|
397
415
|
rateLimit: KeyRateLimit;
|
|
398
416
|
}
|
|
399
417
|
/**
|
|
400
|
-
* `PATCH /api/v1/keys/:id` — replace a key's spend budgets and/or
|
|
401
|
-
* The only way to
|
|
418
|
+
* `PATCH /api/v1/keys/:id` — replace a key's spend budgets, rate limit and/or scopes.
|
|
419
|
+
* The only way to change them: any member creates their own keys, and only an
|
|
402
420
|
* OWNER or ADMIN may say what a key can spend, so a key is created unlimited
|
|
403
|
-
* and limited afterwards.
|
|
421
|
+
* and limited afterwards. Scopes are set at creation and may be replaced here.
|
|
404
422
|
* A field left out is unchanged; `budgets: []` removes every budget, and a
|
|
405
423
|
* `rateLimit` field set to `null` removes that limit.
|
|
406
424
|
*/
|
|
@@ -436,7 +454,10 @@ export declare const UpdateApiKeyInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
436
454
|
rpm?: number | null | undefined;
|
|
437
455
|
tpm?: number | null | undefined;
|
|
438
456
|
}>>;
|
|
457
|
+
/** Replaces the key's scopes; applies from the key's next request. */
|
|
458
|
+
scopes: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
439
459
|
}, "strict", z.ZodTypeAny, {
|
|
460
|
+
scopes?: string[] | undefined;
|
|
440
461
|
budgets?: {
|
|
441
462
|
period: "day" | "month";
|
|
442
463
|
limitUsd: number;
|
|
@@ -447,6 +468,7 @@ export declare const UpdateApiKeyInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
447
468
|
tpm?: number | null | undefined;
|
|
448
469
|
} | undefined;
|
|
449
470
|
}, {
|
|
471
|
+
scopes?: string[] | undefined;
|
|
450
472
|
budgets?: {
|
|
451
473
|
period: "day" | "month";
|
|
452
474
|
limitUsd: number;
|
|
@@ -457,6 +479,7 @@ export declare const UpdateApiKeyInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
457
479
|
tpm?: number | null | undefined;
|
|
458
480
|
} | undefined;
|
|
459
481
|
}>, {
|
|
482
|
+
scopes?: string[] | undefined;
|
|
460
483
|
budgets?: {
|
|
461
484
|
period: "day" | "month";
|
|
462
485
|
limitUsd: number;
|
|
@@ -467,6 +490,7 @@ export declare const UpdateApiKeyInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
467
490
|
tpm?: number | null | undefined;
|
|
468
491
|
} | undefined;
|
|
469
492
|
}, {
|
|
493
|
+
scopes?: string[] | undefined;
|
|
470
494
|
budgets?: {
|
|
471
495
|
period: "day" | "month";
|
|
472
496
|
limitUsd: number;
|
|
@@ -483,7 +507,14 @@ export interface ApiKeyInfo {
|
|
|
483
507
|
keyId: string;
|
|
484
508
|
keyPrefix: string;
|
|
485
509
|
label: string;
|
|
510
|
+
/** The scopes as stored on the key. */
|
|
486
511
|
scopes: string[];
|
|
512
|
+
/**
|
|
513
|
+
* The stored scopes are all outside the registry (free-form strings written
|
|
514
|
+
* before scopes were enforced), so the key works as `*` until 2.6.0, when it
|
|
515
|
+
* is refused. Re-create it, or set its scopes, before then.
|
|
516
|
+
*/
|
|
517
|
+
legacyScopes: boolean;
|
|
487
518
|
/** Per-key model allowlist; `null` when the key inherits the workspace list. */
|
|
488
519
|
allowedModels: string[] | null;
|
|
489
520
|
expiresAt: string | null;
|
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAGL,KAAK,cAAc,EACnB,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