You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Name the declared permissions in the device refusal and align the guides with the flow
The startup refusal for a module device provider that declares permissions now names the Data Uses it declared, which the pluggable-providers spec already said it did. The permission-model guide and the permissions module doc no longer say a device or geo declaration is recorded rather than enforced, because a module device declaration is refused at startup and a geo declaration is not consulted. The guide now says request filters receive the state on the Fastly adapter, the only adapter that runs the filter step, that the head script needs a head to inject into, that a bot-classified visitor receives the state resolved for the request rather than an empty one, and that the client-fixed demo script declares and checks its required Data Use. The integration guide gains a section on what a module sees of the permission state, because it said nothing about it.
Copy file name to clipboardExpand all lines: docs/guide/integration-guide.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -317,6 +317,28 @@ The three delivery choices are exclusive and the last call wins, so a builder ch
317
317
318
318
A module may declare a geo, identity or device provider that no selector chooses, which is a configuration a deployment can hold while it switches providers, so the registry logs a warning naming the unselected capability rather than refusing to start.
319
319
320
+
### What a Module Sees of the Permission State
321
+
322
+
Trusted Server resolves the permission state for a request once, at the start
323
+
of the request cycle, and hands it to a module in two places rather than having
324
+
the module derive its own.
325
+
326
+
- A request filter receives `permissions: Option<&PermissionState>` on its
327
+
`RequestFilterInput`, next to the geo result. The filter step runs on the
328
+
Fastly adapter today, and there the state is built before any filter runs.
329
+
- A page module reads `window.tsjs.permissions`, an object `{"set": [...]}` of
330
+
the Data Use names set for the request, and waits on `tsjs.whenPermissions()`
331
+
because the value arrives at `<head>` open under inline assembly and at the
332
+
`</body>` seam under a shared template. A module declares the permissions it
333
+
requires in its own source, the same names its server-side provider declares,
334
+
and does nothing with identity and contacts no vendor until the promise
335
+
resolves with those names in the set. The client-fixed demo script under
336
+
`integrations/ec_client_fixed` is the worked example.
337
+
338
+
A device provider a module supplies must require no permission, because no
339
+
per-request device gate exists yet; a module that declares one is refused at
340
+
startup. See the permission model guide for the model itself.
341
+
320
342
### How an Adapter Composes It In
321
343
322
344
The Axum, Cloudflare and Spin adapters take the builders as arguments, so no adapter names a vendor.
0 commit comments