@voltro/protocol 0.34.0 → 0.36.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/CHANGELOG.md +235 -0
- package/dist/index.d.ts +78 -10
- package/dist/index.js +329 -313
- package/dist/rest.d.ts +28 -8
- package/package.json +3 -3
package/dist/rest.d.ts
CHANGED
|
@@ -121,7 +121,8 @@ export declare const derivePublicPath: (tag: string, spec: PublicApiSpec) => str
|
|
|
121
121
|
* side effect when the method isn't its own — so probing the group in order and
|
|
122
122
|
* taking the FIRST non-405 result yields the route that owns the request's
|
|
123
123
|
* method. This is what lets the standard GET + POST on one resource path
|
|
124
|
-
* coexist: the
|
|
124
|
+
* coexist: the runtime's rpc server (`rpcServer.ts`, started by both boot
|
|
125
|
+
* paths) mounts ONE dispatcher per path (the underlying
|
|
125
126
|
* router rejects two mounts on the same `(method, path)`). A single-route group
|
|
126
127
|
* returns that route's result directly (its own 405 included); when no route in
|
|
127
128
|
* the group owns the method, the last 405 stands.
|
|
@@ -158,13 +159,32 @@ declare interface GuardSpec<Input = unknown> {
|
|
|
158
159
|
* scope); `'any'` = OR (hold at least one). Ignored for a single scope. */
|
|
159
160
|
readonly mode?: 'all' | 'any';
|
|
160
161
|
/**
|
|
161
|
-
* PURE `input → resource id` extractor
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
* for a
|
|
162
|
+
* PURE `input → resource id` extractor. Browser-safe (no DB, no server
|
|
163
|
+
* import) — exactly like `target.identify`. Omit for a plain subject-scope
|
|
164
|
+
* guard.
|
|
165
|
+
*
|
|
166
|
+
* **On a `GuardSpec` this id is ADVISORY.** A scope guard answers "what may
|
|
167
|
+
* this subject do at all", against the subject's global scope set; the id is
|
|
168
|
+
* carried for logging and for a future subject-scope resolver that narrows by
|
|
169
|
+
* resource. It does not, on its own, make the check per-resource.
|
|
170
|
+
*
|
|
171
|
+
* **If your authority is per-resource, you want {@link PolicyGuardSpec}, not
|
|
172
|
+
* this field** — `guards: [{ action, resourceType, resource }]`, backed by
|
|
173
|
+
* `defineResourcePolicy` + a tuple source you register. That is built, wired
|
|
174
|
+
* on both boot paths, fail-closed without a resolver, and documented under
|
|
175
|
+
* *Authentication → Authorization*. An app whose relationships already live
|
|
176
|
+
* in its own tables (a `teamMembers` row, say) registers its own tuple source
|
|
177
|
+
* rather than copying data across; see `policyGuardResolver.ts`.
|
|
178
|
+
*
|
|
179
|
+
* That paragraph is here because its absence cost a consumer their access
|
|
180
|
+
* gate. This comment used to describe the resolver as "a future ReBAC /
|
|
181
|
+
* `accessPolicy()` resolver" — written before the ReBAC path shipped and
|
|
182
|
+
* never updated. They read the type, quoted the sentence, concluded there was
|
|
183
|
+
* "nothing in between" declaring an untruth and turning the gate off, and set
|
|
184
|
+
* `security: { defaultDeny: false }` on an app with 565 undecided procedures.
|
|
185
|
+
* The capability they needed was two fields away. A doc comment that says
|
|
186
|
+
* "future" about something shipped is not a small inaccuracy: it is the only
|
|
187
|
+
* thing a careful reader has, and it argued them out of a feature.
|
|
168
188
|
*/
|
|
169
189
|
readonly resource?: (input: Input) => string | undefined;
|
|
170
190
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voltro/protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "The Voltro wire + plugin contract — defineQuery/Mutation/Action/Stream, definePlugin, sessions / JWT / API-keys, and the RPC protocol.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"voltro",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@effect/sql": "^0.52.0",
|
|
57
|
-
"@voltro/database": "0.
|
|
58
|
-
"@voltro/logger": "0.
|
|
57
|
+
"@voltro/database": "0.36.0",
|
|
58
|
+
"@voltro/logger": "0.36.0",
|
|
59
59
|
"jose": "^6.2.4"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|