@cat-factory/server 0.226.0 → 0.227.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/dist/app.d.ts +29 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +131 -88
- package/dist/app.js.map +1 -1
- package/dist/http/workspaceAccess.d.ts +65 -40
- package/dist/http/workspaceAccess.d.ts.map +1 -1
- package/dist/http/workspaceAccess.js +84 -44
- package/dist/http/workspaceAccess.js.map +1 -1
- package/dist/modules/agentPrompts/AgentPromptController.js +2 -2
- package/dist/modules/agentPrompts/AgentPromptController.js.map +1 -1
- package/dist/modules/agentSettings/WorkspaceAgentSettingsController.js +2 -2
- package/dist/modules/agentSettings/WorkspaceAgentSettingsController.js.map +1 -1
- package/dist/modules/bootstrap/BootstrapController.js +2 -2
- package/dist/modules/bootstrap/BootstrapController.js.map +1 -1
- package/dist/modules/capabilityCredentials/CapabilityCredentialsController.d.ts +2 -2
- package/dist/modules/capabilityCredentials/CapabilityCredentialsController.d.ts.map +1 -1
- package/dist/modules/capabilityCredentials/CapabilityCredentialsController.js +4 -11
- package/dist/modules/capabilityCredentials/CapabilityCredentialsController.js.map +1 -1
- package/dist/modules/consensus/ConsensusGroupController.js +2 -2
- package/dist/modules/consensus/ConsensusGroupController.js.map +1 -1
- package/dist/modules/documents/DocumentSourceController.d.ts +10 -0
- package/dist/modules/documents/DocumentSourceController.d.ts.map +1 -1
- package/dist/modules/documents/DocumentSourceController.js +37 -4
- package/dist/modules/documents/DocumentSourceController.js.map +1 -1
- package/dist/modules/environments/EnvironmentController.d.ts.map +1 -1
- package/dist/modules/environments/EnvironmentController.js +6 -2
- package/dist/modules/environments/EnvironmentController.js.map +1 -1
- package/dist/modules/foundationalServices/FoundationalServiceController.d.ts.map +1 -1
- package/dist/modules/foundationalServices/FoundationalServiceController.js +14 -13
- package/dist/modules/foundationalServices/FoundationalServiceController.js.map +1 -1
- package/dist/modules/fragmentLibrary/FragmentLibraryController.d.ts.map +1 -1
- package/dist/modules/fragmentLibrary/FragmentLibraryController.js +17 -11
- package/dist/modules/fragmentLibrary/FragmentLibraryController.js.map +1 -1
- package/dist/modules/github/GitHubController.js +3 -3
- package/dist/modules/github/GitHubController.js.map +1 -1
- package/dist/modules/gitlab/GitLabController.js +2 -2
- package/dist/modules/gitlab/GitLabController.js.map +1 -1
- package/dist/modules/incidentEnrichment/IncidentEnrichmentController.js +2 -2
- package/dist/modules/incidentEnrichment/IncidentEnrichmentController.js.map +1 -1
- package/dist/modules/merge/RiskPolicyController.js +2 -2
- package/dist/modules/merge/RiskPolicyController.js.map +1 -1
- package/dist/modules/modelPresets/ModelPresetController.js +2 -2
- package/dist/modules/modelPresets/ModelPresetController.js.map +1 -1
- package/dist/modules/notificationWebhook/NotificationWebhookController.js +2 -2
- package/dist/modules/notificationWebhook/NotificationWebhookController.js.map +1 -1
- package/dist/modules/packageRegistries/PackageRegistriesController.js +2 -2
- package/dist/modules/packageRegistries/PackageRegistriesController.js.map +1 -1
- package/dist/modules/preview/PreviewController.js +2 -2
- package/dist/modules/preview/PreviewController.js.map +1 -1
- package/dist/modules/providers/ApiKeyController.js +2 -2
- package/dist/modules/providers/ApiKeyController.js.map +1 -1
- package/dist/modules/providers/VendorCredentialController.js +2 -2
- package/dist/modules/providers/VendorCredentialController.js.map +1 -1
- package/dist/modules/publicApi/PublicApiKeyController.js +2 -2
- package/dist/modules/publicApi/PublicApiKeyController.js.map +1 -1
- package/dist/modules/recurring/TrackerSettingsController.js +2 -2
- package/dist/modules/recurring/TrackerSettingsController.js.map +1 -1
- package/dist/modules/releaseHealth/ReleaseHealthController.js +2 -2
- package/dist/modules/releaseHealth/ReleaseHealthController.js.map +1 -1
- package/dist/modules/runners/RunnerPoolController.js +2 -2
- package/dist/modules/runners/RunnerPoolController.js.map +1 -1
- package/dist/modules/sandbox/SandboxController.js +2 -2
- package/dist/modules/sandbox/SandboxController.js.map +1 -1
- package/dist/modules/settings/WorkspaceSettingsController.js +2 -2
- package/dist/modules/settings/WorkspaceSettingsController.js.map +1 -1
- package/dist/modules/sharedStack/SharedStackController.js +2 -2
- package/dist/modules/sharedStack/SharedStackController.js.map +1 -1
- package/dist/modules/slack/SlackController.js +2 -2
- package/dist/modules/slack/SlackController.js.map +1 -1
- package/dist/modules/tasks/TaskSourceController.js +2 -2
- package/dist/modules/tasks/TaskSourceController.js.map +1 -1
- package/dist/modules/testSecrets/TestSecretsController.js +2 -2
- package/dist/modules/testSecrets/TestSecretsController.js.map +1 -1
- package/dist/modules/toolServers/ToolServerController.d.ts +1 -1
- package/dist/modules/toolServers/ToolServerController.d.ts.map +1 -1
- package/dist/modules/toolServers/ToolServerController.js +3 -9
- package/dist/modules/toolServers/ToolServerController.js.map +1 -1
- package/dist/modules/tutorial/TutorialController.js +1 -1
- package/dist/modules/tutorial/TutorialController.js.map +1 -1
- package/dist/modules/validation/ValidationConfigController.d.ts.map +1 -1
- package/dist/modules/validation/ValidationConfigController.js +5 -2
- package/dist/modules/validation/ValidationConfigController.js.map +1 -1
- package/dist/modules/vcs/VcsConnectController.d.ts +9 -1
- package/dist/modules/vcs/VcsConnectController.d.ts.map +1 -1
- package/dist/modules/vcs/VcsConnectController.js +11 -3
- package/dist/modules/vcs/VcsConnectController.js.map +1 -1
- package/package.json +5 -5
|
@@ -93,80 +93,120 @@ export function blockEditActor(c) {
|
|
|
93
93
|
return { role: access.role, managesPolicy: access.permissions.has('settings.manage') };
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
96
|
+
* The controller-level admin-tier gate (workspace-rbac, slice 6): every WRITE served under one of
|
|
97
|
+
* `prefixes` requires `permission`, with ZERO per-handler code. Reads (GET/HEAD) pass straight
|
|
98
|
+
* through, so the controller stays viewer-readable (`workspace.read`, satisfied by the gate
|
|
99
|
+
* resolution) while its mutations are admin-only. Use
|
|
100
|
+
* {@link mountWorkspacePermissionIncludingReads} for the rare controller whose READ is the
|
|
101
|
+
* sensitive half.
|
|
102
102
|
*
|
|
103
|
-
* This is the method-shaped counterpart to the gate's viewer floor: the floor rejects viewer
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* drift a shadow route-map would suffer can't happen. It runs BEFORE the handler, so an
|
|
103
|
+
* This is the method-shaped counterpart to the gate's viewer floor: the floor rejects viewer writes
|
|
104
|
+
* wholesale (non-GET ⇒ ≥ member) in ONE place; this rejects member writes on the admin groups in
|
|
105
|
+
* ONE place per group. Because it is co-located with the controller's own mount (not a central
|
|
106
|
+
* path→permission table), a new route under a gated prefix inherits the correct gate automatically:
|
|
107
|
+
* the drift a shadow route-map would suffer can't happen. It runs BEFORE the handler, so an
|
|
108
108
|
* unauthorized caller is refused even when the underlying integration is unwired (a member never
|
|
109
|
-
* learns whether Slack/GitHub/etc. is configured)
|
|
109
|
+
* learns whether Slack/GitHub/etc. is configured), and before body validation, so a malformed
|
|
110
|
+
* payload cannot turn a refusal into a 422 that answers the same question.
|
|
110
111
|
*
|
|
111
112
|
* `OPTIONS` (CORS preflight) is never gated. Where a controller mixes gated and ungated writes
|
|
112
|
-
* under one
|
|
113
|
+
* under one prefix (e.g. workspace create vs rename), call {@link requirePermission} per-handler
|
|
113
114
|
* instead of mounting this.
|
|
114
115
|
*
|
|
115
|
-
*
|
|
116
|
-
* re-registers each of `sub`'s entries under
|
|
117
|
-
* `ALL /workspaces/:workspaceId/*` on the shared app
|
|
118
|
-
* mounted on the same prefix. Hono
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
116
|
+
* **`prefixes` are the controller's OWN top-level paths, and taking them is the whole point of this
|
|
117
|
+
* helper.** `app.route('/workspaces/:workspaceId', sub)` re-registers each of `sub`'s entries under
|
|
118
|
+
* that prefix, so a `sub.use('*', …)` becomes `ALL /workspaces/:workspaceId/*` on the shared app and
|
|
119
|
+
* matches routes OTHER controllers mounted on the same prefix. Hono runs a matching middleware for
|
|
120
|
+
* every route registered after it, which made the blast radius depend on the order in `app.ts`: the
|
|
121
|
+
* admin document and task-source controllers are registered ahead of the human-gate controllers, so
|
|
122
|
+
* their `'*'` mounts refused a plain member's review decisions, requirement answers and initiative
|
|
123
|
+
* writes with `integrations.manage`. Nobody noticed because an account admin resolves as a workspace
|
|
124
|
+
* admin, and dogfooding happens as one. Passing prefixes cannot reach a sibling whatever the order,
|
|
125
|
+
* and it is why no middleware factory is exported from this module: a `'*'` mount is now
|
|
126
|
+
* unrepresentable rather than merely discouraged. `permissionMounts.test.ts` pins the invariant
|
|
127
|
+
* (a member is refused exactly the writes their own controller gates).
|
|
128
|
+
*
|
|
129
|
+
* Each prefix is mounted twice, bare and `/*`, because Hono's `*` does not match the bare prefix.
|
|
130
|
+
* A prefix may carry params (`/services/:blockId/test-secrets`), which is how a controller whose
|
|
131
|
+
* routes hang off a shared first segment gates its own without claiming the segment.
|
|
125
132
|
*/
|
|
126
|
-
export function
|
|
127
|
-
|
|
133
|
+
export function mountWorkspacePermission(app, permission, prefixes) {
|
|
134
|
+
mountGate(app, prefixes, { permission, gatesReads: false }, (c, next) => {
|
|
128
135
|
const method = c.req.method;
|
|
129
136
|
if (method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS') {
|
|
130
137
|
requirePermission(c, permission);
|
|
131
138
|
}
|
|
132
139
|
return next();
|
|
133
|
-
};
|
|
140
|
+
});
|
|
134
141
|
}
|
|
135
142
|
/**
|
|
136
143
|
* The same controller-level gate, applied to READS as well.
|
|
137
144
|
*
|
|
138
|
-
* {@link
|
|
145
|
+
* {@link mountWorkspacePermission} lets GET/HEAD through by design: on almost every admin
|
|
139
146
|
* controller the permission guards MUTATION and the configuration itself is viewer-readable. A few
|
|
140
|
-
* controllers invert that, because their READ is the sensitive half
|
|
147
|
+
* controllers invert that, because their READ is the sensitive half. The capability-credential
|
|
141
148
|
* checklist and the tool-server inventory both project the credential KEY NAMES this deployment's
|
|
142
149
|
* capabilities want, which is exactly what the workspace snapshot withholds from a viewer ("no
|
|
143
150
|
* business learning which environment variables the deployment sets"). Moving the value into a
|
|
144
151
|
* sealed row did not change that judgement, and neither did adding a second surface over the same
|
|
145
|
-
* registry.
|
|
152
|
+
* registry. `vcsConnectController` is the third and the plainest: it serves ONE read and no write,
|
|
153
|
+
* so the writes-only mount left it enforcing nothing at all.
|
|
146
154
|
*
|
|
147
155
|
* A separate function rather than an option, so the choice is legible at the mount and a controller
|
|
148
156
|
* cannot acquire it by a default changing underneath it. `OPTIONS` still passes: a CORS preflight
|
|
149
157
|
* carries no credentials to judge, and refusing it breaks the browser before the real request that
|
|
150
158
|
* this gate is here to refuse.
|
|
151
159
|
*
|
|
152
|
-
* The failure this exists to prevent is not hypothetical
|
|
153
|
-
* gated (in the controller, in the SPA's tab gate, in the store's 403
|
|
154
|
-
* every member's GET through, because "gated on `secrets.manage`"
|
|
155
|
-
* and covered only its writes.
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
* {@link requireWorkspacePermission}: a `'*'` mount lands on `/workspaces/:workspaceId/*` and can
|
|
159
|
-
* refuse a SIBLING controller's routes. That is survivable while only writes are gated (the
|
|
160
|
-
* siblings it can reach are admin-tier anyway); gating READS makes it fatal, because the same
|
|
161
|
-
* pattern then refuses every member-readable GET registered after it — `GET /github/repos` was the
|
|
162
|
-
* one that caught it. Two patterns are needed, `/thing` and `/thing/*`: Hono's `*` does not match
|
|
163
|
-
* the bare prefix.
|
|
160
|
+
* The failure this exists to prevent is not hypothetical, and all three call sites hit it: each
|
|
161
|
+
* documented the read as gated (in the controller, in the SPA's tab gate, in the store's 403
|
|
162
|
+
* handling) while the mount let every member's GET through, because "gated on `secrets.manage`"
|
|
163
|
+
* reads as covering the controller and covered only its writes. `permissionMounts.test.ts` now
|
|
164
|
+
* asserts the READS of an `IncludingReads` controller are covered too, so the gap cannot reopen
|
|
165
|
+
* by a prefix going missing.
|
|
164
166
|
*/
|
|
165
|
-
export function
|
|
166
|
-
|
|
167
|
+
export function mountWorkspacePermissionIncludingReads(app, permission, prefixes) {
|
|
168
|
+
mountGate(app, prefixes, { permission, gatesReads: true }, (c, next) => {
|
|
167
169
|
if (c.req.method !== 'OPTIONS')
|
|
168
170
|
requirePermission(c, permission);
|
|
169
171
|
return next();
|
|
170
|
-
};
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
const MOUNTED_GATE = Symbol('workspacePermissionGate');
|
|
175
|
+
/**
|
|
176
|
+
* What a mounted gate enforces, or `undefined` for any other middleware.
|
|
177
|
+
*
|
|
178
|
+
* Read off a controller's route table by `permissionMounts.test.ts`, which asserts that a member is
|
|
179
|
+
* refused exactly the writes their own controller gates AND that a gated controller leaves none of
|
|
180
|
+
* its own routes uncovered. It exists because a controller's middleware is not necessarily a
|
|
181
|
+
* permission gate: `executionController` and `notificationController` both mount their own `ALL`
|
|
182
|
+
* middleware, and treating every middleware entry as a gate made the derived expectation wrong for
|
|
183
|
+
* them. Tagging the handler is what lets the invariant be READ from what the mount actually did
|
|
184
|
+
* instead of from a second list somebody has to keep in step.
|
|
185
|
+
*
|
|
186
|
+
* Read it off a STANDALONE-built controller, not the composed app: `app.route()` passes a sub-app's
|
|
187
|
+
* handlers through untouched only while the sub-app has no error handler of its own, and wraps them
|
|
188
|
+
* (losing this tag) the moment one calls `app.onError`. No controller does today, and the invariant
|
|
189
|
+
* does not depend on none ever doing.
|
|
190
|
+
*/
|
|
191
|
+
export function permissionGateOf(handler) {
|
|
192
|
+
if (typeof handler !== 'function')
|
|
193
|
+
return undefined;
|
|
194
|
+
const tagged = handler[MOUNTED_GATE];
|
|
195
|
+
return typeof tagged === 'object' && tagged !== null ? tagged : undefined;
|
|
196
|
+
}
|
|
197
|
+
/** Mount one gate on each prefix, bare and `/*` (Hono's `*` does not match the bare prefix). */
|
|
198
|
+
function mountGate(app, prefixes, mounted, gate) {
|
|
199
|
+
if (prefixes.length === 0) {
|
|
200
|
+
// A gated controller with no prefix would gate nothing while reading as gated, which is the
|
|
201
|
+
// silent hole this whole helper exists to close. A prefix that matches none of the controller's
|
|
202
|
+
// routes is the same hole one step later, so `permissionMounts.test.ts` refuses that too: this
|
|
203
|
+
// throw can only catch the spelling of it that names no path at all.
|
|
204
|
+
throw new Error('mountWorkspacePermission: at least one path prefix is required');
|
|
205
|
+
}
|
|
206
|
+
Object.defineProperty(gate, MOUNTED_GATE, { value: mounted });
|
|
207
|
+
for (const prefix of prefixes) {
|
|
208
|
+
app.use(prefix, gate);
|
|
209
|
+
app.use(`${prefix}/*`, gate);
|
|
210
|
+
}
|
|
171
211
|
}
|
|
172
212
|
//# sourceMappingURL=workspaceAccess.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaceAccess.js","sourceRoot":"","sources":["../../src/http/workspaceAccess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAuB,MAAM,wBAAwB,CAAA;AACvF,OAAO,EACL,cAAc,EACd,sBAAsB,GAGvB,MAAM,qBAAqB,CAAA;AAI5B,8EAA8E;AAC9E,wFAAwF;AACxF,yFAAyF;AACzF,mFAAmF;AACnF,EAAE;AACF,yFAAyF;AACzF,sFAAsF;AACtF,wFAAwF;AACxF,2FAA2F;AAC3F,8FAA8F;AAC9F,4FAA4F;AAC5F,8FAA8F;AAC9F,uFAAuF;AACvF,8EAA8E;AAE9E;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,SAA0B,EAC1B,WAAmB,EACnB,MAAc;IAEd,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QAC9F,MAAM,EAAE,MAAM,8BAA8B,CAAC,SAAS,EAAE,WAAW,EAAE,MAAM,CAAC;KAC7E,CAAC,CAA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2
|
import { promptIdForKind, promptVersionLabel } from '@cat-factory/agents';
|
|
3
3
|
import { buildHonoRoute } from '@toad-contracts/hono';
|
|
4
4
|
import { Hono } from 'hono';
|
|
5
|
-
import {
|
|
5
|
+
import { mountWorkspacePermission } from '../../http/workspaceAccess.js';
|
|
6
6
|
import { param } from '../../http/params.js';
|
|
7
7
|
import { requireCapability } from '../../http/guards.js';
|
|
8
8
|
import { NotFoundError, ValidationError } from '@cat-factory/kernel';
|
|
@@ -56,7 +56,7 @@ function detailFor(c, agentKind, revisions) {
|
|
|
56
56
|
*/
|
|
57
57
|
export function agentPromptController() {
|
|
58
58
|
const app = new Hono();
|
|
59
|
-
app
|
|
59
|
+
mountWorkspacePermission(app, 'settings.manage', ['/agent-prompts']);
|
|
60
60
|
buildHonoRoute(app, listAgentPromptsContract, async (c) => {
|
|
61
61
|
const prompts = requireAgentPrompts(c);
|
|
62
62
|
return c.json(await prompts.service.listSummaries(param(c, 'workspaceId')), 200);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentPromptController.js","sourceRoot":"","sources":["../../../src/modules/agentPrompts/AgentPromptController.ts"],"names":[],"mappings":"AACA,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"AgentPromptController.js","sourceRoot":"","sources":["../../../src/modules/agentPrompts/AgentPromptController.ts"],"names":[],"mappings":"AACA,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,eAAe,EAAE,kBAA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QAC5F,0FAA0F;QAC1F,sFAAsF;QACtF,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;YACpC,MAAM,IAAI,eAAe,CAAC,mDAAmD,EAAE;gBAC7E,MAAM,EAAE,qBAAqB;gBAC7B,QAAQ,EAAE,SAAS;gBACnB,MAAM,EAAE,OAAO,CAAC,SAAS;aAC1B,CAAC,CAAA;QACJ,CAAC;QACD,6FAA6F;QAC7F,mFAAmF;QACnF,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,IAAI,CAC1C,WAAW,EACX,SAAS,EACT,EAAE,IAAI,EAAE,OAAO,CAAC,UAAU,EAAE,EAC5B,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAClB,CAAA;QACD,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,CAAA;IACxD,CAAC,CAAC,CAAA;IAEF,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { listWorkspaceAgentSettingsContract, updateWorkspaceAgentSettingsContract, } from '@cat-factory/contracts';
|
|
2
2
|
import { buildHonoRoute } from '@toad-contracts/hono';
|
|
3
3
|
import { Hono } from 'hono';
|
|
4
|
-
import {
|
|
4
|
+
import { mountWorkspacePermission } from '../../http/workspaceAccess.js';
|
|
5
5
|
import { param } from '../../http/params.js';
|
|
6
6
|
import { requireCapability } from '../../http/guards.js';
|
|
7
7
|
/** Resolve the agent-settings module, or refuse with a 503 naming what isn't wired. */
|
|
@@ -20,7 +20,7 @@ function requireAgentSettings(c) {
|
|
|
20
20
|
*/
|
|
21
21
|
export function workspaceAgentSettingsController() {
|
|
22
22
|
const app = new Hono();
|
|
23
|
-
app
|
|
23
|
+
mountWorkspacePermission(app, 'settings.manage', ['/agent-settings']);
|
|
24
24
|
buildHonoRoute(app, listWorkspaceAgentSettingsContract, async (c) => {
|
|
25
25
|
const settings = requireAgentSettings(c);
|
|
26
26
|
return c.json(await settings.service.list(param(c, 'workspaceId')), 200);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceAgentSettingsController.js","sourceRoot":"","sources":["../../../src/modules/agentSettings/WorkspaceAgentSettingsController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kCAAkC,EAClC,oCAAoC,GACrC,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"WorkspaceAgentSettingsController.js","sourceRoot":"","sources":["../../../src/modules/agentSettings/WorkspaceAgentSettingsController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kCAAkC,EAClC,oCAAoC,GACrC,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAExD,uFAAuF;AACvF,SAAS,oBAAoB,CAAmB,CAAa;IAC3D,OAAO,iBAAiB,CACtB,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,sBAAsB,EACzC,mCAAmC,CACpC,CAAA;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,gCAAgC;IAC9C,MAAM,GAAG,GAAG,IAAI,IAAI,EAAU,CAAA;IAC9B,wBAAwB,CAAC,GAAG,EAAE,iBAAiB,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAA;IAErE,cAAc,CAAC,GAAG,EAAE,kCAAkC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;QAClE,MAAM,QAAQ,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAA;QACxC,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;IAC1E,CAAC,CAAC,CAAA;IAEF,cAAc,CAAC,GAAG,EAAE,oCAAoC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;QACpE,MAAM,QAAQ,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAA;QACxC,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAC1C,2FAA2F;QAC3F,0FAA0F;QAC1F,+CAA+C;QAC/C,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,MAAM,CAC3C,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,EACvB,SAAS,EACT,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CACpB,CAAA;QACD,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IAC7B,CAAC,CAAC,CAAA;IAEF,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createReferenceArchitectureContract, deleteReferenceArchitectureContract, getBootstrapJobContract, listBootstrapJobsContract, listReferenceArchitecturesContract, startBootstrapJobContract, updateReferenceArchitectureContract, } from '@cat-factory/contracts';
|
|
2
2
|
import { buildHonoRoute } from '@toad-contracts/hono';
|
|
3
3
|
import { Hono } from 'hono';
|
|
4
|
-
import {
|
|
4
|
+
import { mountWorkspacePermission } from '../../http/workspaceAccess.js';
|
|
5
5
|
import { param } from '../../http/params.js';
|
|
6
6
|
import { UnavailableError } from '@cat-factory/kernel';
|
|
7
7
|
import { requireCapability } from '../../http/guards.js';
|
|
@@ -17,7 +17,7 @@ function requireBootstrap(c) {
|
|
|
17
17
|
*/
|
|
18
18
|
export function bootstrapController() {
|
|
19
19
|
const app = new Hono();
|
|
20
|
-
app
|
|
20
|
+
mountWorkspacePermission(app, 'integrations.manage', ['/bootstrap']);
|
|
21
21
|
// ---- reference architectures -------------------------------------------
|
|
22
22
|
buildHonoRoute(app, listReferenceArchitecturesContract, async (c) => {
|
|
23
23
|
const bootstrap = requireBootstrap(c);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BootstrapController.js","sourceRoot":"","sources":["../../../src/modules/bootstrap/BootstrapController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EACnC,mCAAmC,EACnC,uBAAuB,EACvB,yBAAyB,EACzB,kCAAkC,EAClC,yBAAyB,EACzB,mCAAmC,GACpC,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"BootstrapController.js","sourceRoot":"","sources":["../../../src/modules/bootstrap/BootstrapController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EACnC,mCAAmC,EACnC,uBAAuB,EACvB,yBAAyB,EACzB,kCAAkC,EAClC,yBAAyB,EACzB,mCAAmC,GACpC,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAExD,kFAAkF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KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAChF,GAAG,CACJ,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,4EAA4E;IAC5E,uEAAuE;IACvE,cAAc,CAAC,GAAG,EAAE,yBAAyB,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;QACzD,MAAM,SAAS,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAA;QACrC,oFAAoF;QACpF,oCAAoC;QACpC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;YACpC,MAAM,IAAI,gBAAgB,CACxB,2FAA2F,CAC5F,CAAA;QACH,CAAC;QACD,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;QAC3F,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IACzB,CAAC,CAAC,CAAA;IAEF,8EAA8E;IAC9E,6EAA6E;IAE7E,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -14,8 +14,8 @@ import type { AppEnv } from '../../http/env.js';
|
|
|
14
14
|
* learning which environment variables the deployment sets"). Moving the value into a row does
|
|
15
15
|
* not change that judgement.
|
|
16
16
|
*
|
|
17
|
-
* Which is why the mount is `
|
|
18
|
-
* `
|
|
17
|
+
* Which is why the mount is `mountWorkspacePermissionIncludingReads` and not the usual
|
|
18
|
+
* `mountWorkspacePermission`: that one passes GET/HEAD straight through, so for a release this
|
|
19
19
|
* controller documented a gated read (here, in the SPA's tab gate, and in the store's 403 branch)
|
|
20
20
|
* while every member's GET was answered in full.
|
|
21
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CapabilityCredentialsController.d.ts","sourceRoot":"","sources":["../../../src/modules/capabilityCredentials/CapabilityCredentialsController.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAiD/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,+BAA+B,IAAI,IAAI,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"CapabilityCredentialsController.d.ts","sourceRoot":"","sources":["../../../src/modules/capabilityCredentials/CapabilityCredentialsController.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAiD/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,+BAA+B,IAAI,IAAI,CAAC,MAAM,CAAC,CAoC9D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { deleteCapabilityCredentialContract, getCapabilityCredentialsContract, setCapabilityCredentialContract, setCapabilityCredentialsContract, } from '@cat-factory/contracts';
|
|
2
2
|
import { buildHonoRoute } from '@toad-contracts/hono';
|
|
3
3
|
import { Hono } from 'hono';
|
|
4
|
-
import {
|
|
4
|
+
import { mountWorkspacePermissionIncludingReads } from '../../http/workspaceAccess.js';
|
|
5
5
|
import { param } from '../../http/params.js';
|
|
6
6
|
import { requireCapability } from '../../http/guards.js';
|
|
7
7
|
import { buildCapabilityCredentialsView, collectDeclaredCapabilityCredentials, } from './declaredCredentials.js';
|
|
@@ -47,21 +47,14 @@ async function viewFor(container, stored) {
|
|
|
47
47
|
* learning which environment variables the deployment sets"). Moving the value into a row does
|
|
48
48
|
* not change that judgement.
|
|
49
49
|
*
|
|
50
|
-
* Which is why the mount is `
|
|
51
|
-
* `
|
|
50
|
+
* Which is why the mount is `mountWorkspacePermissionIncludingReads` and not the usual
|
|
51
|
+
* `mountWorkspacePermission`: that one passes GET/HEAD straight through, so for a release this
|
|
52
52
|
* controller documented a gated read (here, in the SPA's tab gate, and in the store's 403 branch)
|
|
53
53
|
* while every member's GET was answered in full.
|
|
54
54
|
*/
|
|
55
55
|
export function capabilityCredentialsController() {
|
|
56
56
|
const app = new Hono();
|
|
57
|
-
|
|
58
|
-
// does not match the bare prefix). A `'*'` mount becomes `ALL /workspaces/:workspaceId/*` on the
|
|
59
|
-
// shared app, so it would refuse a SIBLING controller's routes too: harmless while the gate let
|
|
60
|
-
// GETs through, and an outage for every member-readable GET registered after this one once it
|
|
61
|
-
// stopped.
|
|
62
|
-
const gate = requireWorkspacePermissionIncludingReads('secrets.manage');
|
|
63
|
-
app.use('/capability-credentials', gate);
|
|
64
|
-
app.use('/capability-credentials/*', gate);
|
|
57
|
+
mountWorkspacePermissionIncludingReads(app, 'secrets.manage', ['/capability-credentials']);
|
|
65
58
|
buildHonoRoute(app, getCapabilityCredentialsContract, async (c) => {
|
|
66
59
|
const svc = requireCapabilityCredentials(c);
|
|
67
60
|
const stored = await svc.listStored(param(c, 'workspaceId'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CapabilityCredentialsController.js","sourceRoot":"","sources":["../../../src/modules/capabilityCredentials/CapabilityCredentialsController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kCAAkC,EAClC,gCAAgC,EAChC,+BAA+B,EAC/B,gCAAgC,GACjC,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"CapabilityCredentialsController.js","sourceRoot":"","sources":["../../../src/modules/capabilityCredentials/CapabilityCredentialsController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kCAAkC,EAClC,gCAAgC,EAChC,+BAA+B,EAC/B,gCAAgC,GACjC,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,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AC,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,CAAA;IAC/D,CAAC,CAAC,CAAA;IAEF,cAAc,CAAC,GAAG,EAAE,kCAAkC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;QAClE,MAAM,GAAG,GAAG,4BAA4B,CAAC,CAAC,CAAC,CAAA;QAC3C,MAAM,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAA;QACnE,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAC1B,CAAC,CAAC,CAAA;IAEF,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createConsensusGroupContract, deleteConsensusGroupContract, listConsensusGroupsContract, updateConsensusGroupContract, } from '@cat-factory/contracts';
|
|
2
2
|
import { buildHonoRoute } from '@toad-contracts/hono';
|
|
3
3
|
import { Hono } from 'hono';
|
|
4
|
-
import {
|
|
4
|
+
import { mountWorkspacePermission } from '../../http/workspaceAccess.js';
|
|
5
5
|
import { param } from '../../http/params.js';
|
|
6
6
|
import { requireCapability } from '../../http/guards.js';
|
|
7
7
|
/** Resolve the consensus-group module, or refuse with a 503 naming what isn't wired. */
|
|
@@ -18,7 +18,7 @@ function requireConsensusGroups(c) {
|
|
|
18
18
|
*/
|
|
19
19
|
export function consensusGroupController() {
|
|
20
20
|
const app = new Hono();
|
|
21
|
-
app
|
|
21
|
+
mountWorkspacePermission(app, 'settings.manage', ['/consensus-groups']);
|
|
22
22
|
buildHonoRoute(app, listConsensusGroupsContract, async (c) => {
|
|
23
23
|
const groups = requireConsensusGroups(c);
|
|
24
24
|
return c.json(await groups.service.list(param(c, 'workspaceId')), 200);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsensusGroupController.js","sourceRoot":"","sources":["../../../src/modules/consensus/ConsensusGroupController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,EAC5B,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ConsensusGroupController.js","sourceRoot":"","sources":["../../../src/modules/consensus/ConsensusGroupController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,EAC5B,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAExD,wFAAwF;AACxF,SAAS,sBAAsB,CAAmB,CAAa;IAC7D,OAAO,iBAAiB,CACtB,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,eAAe,EAClC,+CAA+C,CAChD,CAAA;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB;IACtC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAU,CAAA;IAC9B,wBAAwB,CAAC,GAAG,EAAE,iBAAiB,EAAE,CAAC,mBAAmB,CAAC,CAAC,CAAA;IAEvE,cAAc,CAAC,GAAG,EAAE,2BAA2B,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;QAC3D,MAAM,MAAM,GAAG,sBAAsB,CAAC,CAAC,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AE,aAAa,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAA;QAClF,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAC1B,CAAC,CAAC,CAAA;IAEF,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -5,6 +5,16 @@ import type { AppEnv } from '../../http/env.js';
|
|
|
5
5
|
* connection management, page import, document listing, structure
|
|
6
6
|
* planning/spawning, and linking a page to a block as agent context. Mounted
|
|
7
7
|
* under `/workspaces/:workspaceId`.
|
|
8
|
+
*
|
|
9
|
+
* **This controller MIXES tiers, and which half a route lands in is the whole point.**
|
|
10
|
+
* Storing a credential is integration management; reaching for a page and putting it on a task is
|
|
11
|
+
* board AUTHORING, done by whoever authors the task. Holding the whole controller at
|
|
12
|
+
* `integrations.manage` made every write admin-only, so the persona the feature exists for (someone
|
|
13
|
+
* who links the spec or the design their task is about, and is not an operator) could not attach
|
|
14
|
+
* anything at all: the Add-task picker imports-then-links, so it failed on its first write. Import,
|
|
15
|
+
* search, plan, spawn and link therefore sit at the MEMBER tier the auth gate's write floor already
|
|
16
|
+
* enforces, exactly as `boardController`'s writes do, and only the two credential routes plus the
|
|
17
|
+
* workspace-wide role tags keep the admin gate below.
|
|
8
18
|
*/
|
|
9
19
|
export declare function documentSourceController(): Hono<AppEnv>;
|
|
10
20
|
//# sourceMappingURL=DocumentSourceController.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentSourceController.d.ts","sourceRoot":"","sources":["../../../src/modules/documents/DocumentSourceController.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAsB/C
|
|
1
|
+
{"version":3,"file":"DocumentSourceController.d.ts","sourceRoot":"","sources":["../../../src/modules/documents/DocumentSourceController.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAsB/C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAAC,MAAM,CAAC,CAsKvD"}
|
|
@@ -3,7 +3,7 @@ import * as v from 'valibot';
|
|
|
3
3
|
import { buildHonoRoute } from '@toad-contracts/hono';
|
|
4
4
|
import { Hono } from 'hono';
|
|
5
5
|
import { ValidationError } from '@cat-factory/kernel';
|
|
6
|
-
import { blockEditActor,
|
|
6
|
+
import { blockEditActor, mountWorkspacePermission } from '../../http/workspaceAccess.js';
|
|
7
7
|
import { param } from '../../http/params.js';
|
|
8
8
|
import { requireCapability } from '../../http/guards.js';
|
|
9
9
|
/** Resolve the documents module, or refuse with a 503 naming what isn't wired. */
|
|
@@ -23,10 +23,37 @@ function sourceParam(c) {
|
|
|
23
23
|
* connection management, page import, document listing, structure
|
|
24
24
|
* planning/spawning, and linking a page to a block as agent context. Mounted
|
|
25
25
|
* under `/workspaces/:workspaceId`.
|
|
26
|
+
*
|
|
27
|
+
* **This controller MIXES tiers, and which half a route lands in is the whole point.**
|
|
28
|
+
* Storing a credential is integration management; reaching for a page and putting it on a task is
|
|
29
|
+
* board AUTHORING, done by whoever authors the task. Holding the whole controller at
|
|
30
|
+
* `integrations.manage` made every write admin-only, so the persona the feature exists for (someone
|
|
31
|
+
* who links the spec or the design their task is about, and is not an operator) could not attach
|
|
32
|
+
* anything at all: the Add-task picker imports-then-links, so it failed on its first write. Import,
|
|
33
|
+
* search, plan, spawn and link therefore sit at the MEMBER tier the auth gate's write floor already
|
|
34
|
+
* enforces, exactly as `boardController`'s writes do, and only the two credential routes plus the
|
|
35
|
+
* workspace-wide role tags keep the admin gate below.
|
|
26
36
|
*/
|
|
27
37
|
export function documentSourceController() {
|
|
28
38
|
const app = new Hono();
|
|
29
|
-
|
|
39
|
+
// The admin-tier half, named path by path rather than as a whole-controller mount:
|
|
40
|
+
//
|
|
41
|
+
// - connect/disconnect write and clear the per-workspace source CREDENTIAL, which is integration
|
|
42
|
+
// management by definition. Gating at the mount rather than per-handler keeps the refusal ahead
|
|
43
|
+
// of body validation, so a member is refused whether or not their payload is well-formed and
|
|
44
|
+
// never learns which sources this deployment configured;
|
|
45
|
+
// - the per-DocKind template / exemplar tags are workspace-wide authoring CONFIG, not one task's
|
|
46
|
+
// context. One tag decides what EVERY doc run in the board writes from, the same blast radius
|
|
47
|
+
// that keeps the fragment library and the agent-prompt overrides at the admin tier. The
|
|
48
|
+
// writes-only gate leaves the GET open, so the management panel still renders for anyone who
|
|
49
|
+
// can read the board.
|
|
50
|
+
//
|
|
51
|
+
// Everything else this controller serves is the member half, and mounts nothing.
|
|
52
|
+
mountWorkspacePermission(app, 'integrations.manage', [
|
|
53
|
+
'/document-sources/:source/connect',
|
|
54
|
+
'/document-sources/:source/connection',
|
|
55
|
+
'/document-role-links',
|
|
56
|
+
]);
|
|
30
57
|
// ---- source discovery ---------------------------------------------------
|
|
31
58
|
// The configured sources + their connect/import metadata (drives the UI). A
|
|
32
59
|
// 503 here is how the frontend learns the integration is off.
|
|
@@ -55,6 +82,9 @@ export function documentSourceController() {
|
|
|
55
82
|
const documents = requireDocuments(c);
|
|
56
83
|
return c.json(await documents.importService.listDocuments(param(c, 'workspaceId')), 200);
|
|
57
84
|
});
|
|
85
|
+
// Member tier. It does spend an outbound call against the source under the workspace's stored
|
|
86
|
+
// credential, which is the reason the tool-server probe is gated: the difference is that here the
|
|
87
|
+
// call IS the feature, and the same credential is spent by every run a member may already start.
|
|
58
88
|
buildHonoRoute(app, importDocumentContract, async (c) => {
|
|
59
89
|
const documents = requireDocuments(c);
|
|
60
90
|
const document = await documents.importService.import(param(c, 'workspaceId'), sourceParam(c), c.req.valid('json').ref);
|
|
@@ -68,7 +98,9 @@ export function documentSourceController() {
|
|
|
68
98
|
return c.json({ results }, 200);
|
|
69
99
|
});
|
|
70
100
|
// ---- planning / spawning ------------------------------------------------
|
|
71
|
-
// Preview the board structure a page would expand into (no writes).
|
|
101
|
+
// Preview the board structure a page would expand into (no writes). Member tier because the
|
|
102
|
+
// spawn it previews is a board write; in `llm` planner mode it also spends one model call, a
|
|
103
|
+
// smaller spend than the run the same member may start on what it produces.
|
|
72
104
|
buildHonoRoute(app, planDocumentContract, async (c) => {
|
|
73
105
|
const documents = requireDocuments(c);
|
|
74
106
|
const workspaceId = param(c, 'workspaceId');
|
|
@@ -88,7 +120,8 @@ export function documentSourceController() {
|
|
|
88
120
|
return c.json({ plan, result }, 201);
|
|
89
121
|
});
|
|
90
122
|
// ---- context links ------------------------------------------------------
|
|
91
|
-
// Attach an imported page to a block as extra agent context.
|
|
123
|
+
// Attach an imported page to a block as extra agent context. Member tier: this is the write the
|
|
124
|
+
// designer/author flow ends on, and it edits one block's context, nothing workspace-wide.
|
|
92
125
|
buildHonoRoute(app, linkDocumentContract, async (c) => {
|
|
93
126
|
const documents = requireDocuments(c);
|
|
94
127
|
const { source, externalId, blockId } = c.req.valid('json');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentSourceController.js","sourceRoot":"","sources":["../../../src/modules/documents/DocumentSourceController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,gCAAgC,EAChC,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,2BAA2B,EAC3B,+BAA+B,EAC/B,6BAA6B,EAC7B,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,6BAA6B,GAE9B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAGrD,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"DocumentSourceController.js","sourceRoot":"","sources":["../../../src/modules/documents/DocumentSourceController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,gCAAgC,EAChC,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,2BAA2B,EAC3B,+BAA+B,EAC/B,6BAA6B,EAC7B,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,6BAA6B,GAE9B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAGrD,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxF,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAExD,kFAAkF;AAClF,SAAS,gBAAgB,CAAmB,CAAa;IACvD,OAAO,iBAAiB,CACtB,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,SAAS,EAC5B,+CAA+C,CAChD,CAAA;AACH,CAAC;AAED,uEAAuE;AACvE,SAAS,WAAW,CAAmB,CAAa;IAClD,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAA;IACjC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,wBAAwB,EAAE,MAAM,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,eAAe,CAAC,4BAA4B,MAAM,GAAG,CAAC,CAAA;IAClE,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;;;;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AClD,MAAM,SAAS,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAA;QACtF,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAC1B,CAAC,CAAC,CAAA;IAEF,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentController.d.ts","sourceRoot":"","sources":["../../../src/modules/environments/EnvironmentController.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AA6B/C;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"EnvironmentController.d.ts","sourceRoot":"","sources":["../../../src/modules/environments/EnvironmentController.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AA6B/C;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAAC,MAAM,CAAC,CA0MpD"}
|
|
@@ -2,7 +2,7 @@ import { bootstrapEnvironmentRepoContract, describeEnvironmentProviderContract,
|
|
|
2
2
|
import { buildHonoRoute } from '@toad-contracts/hono';
|
|
3
3
|
import * as v from 'valibot';
|
|
4
4
|
import { Hono } from 'hono';
|
|
5
|
-
import {
|
|
5
|
+
import { mountWorkspacePermission } from '../../http/workspaceAccess.js';
|
|
6
6
|
import { param } from '../../http/params.js';
|
|
7
7
|
import { requireCapability } from '../../http/guards.js';
|
|
8
8
|
/** Resolve the environment module, or refuse with a 503 naming what isn't wired. */
|
|
@@ -27,7 +27,11 @@ const notFound = (c) => c.json({ error: { code: 'not_found', message: 'Environme
|
|
|
27
27
|
*/
|
|
28
28
|
export function environmentController() {
|
|
29
29
|
const app = new Hono();
|
|
30
|
-
app
|
|
30
|
+
mountWorkspacePermission(app, 'integrations.manage', [
|
|
31
|
+
'/environments',
|
|
32
|
+
'/environment-tests',
|
|
33
|
+
'/blocks/:blockId/environment-test',
|
|
34
|
+
]);
|
|
31
35
|
// ---- provider connection ------------------------------------------------
|
|
32
36
|
buildHonoRoute(app, getEnvironmentConnectionContract, async (c) => {
|
|
33
37
|
const env = requireEnvironments(c);
|