| 1 | /** |
| 2 | * Account-wide Worker destinations for an Access application. Protecting a |
| 3 | * *specific* Worker is configured on the Worker itself (the `access` prop |
| 4 | * on `Cloudflare.Worker`), which enrolls it into an application by adding |
| 5 | * its `worker`/`preview_worker` destinations. |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * Destination covering the **production** traffic of every Worker on the |
| 10 | * account — including Workers created later. Hostname-level policies take |
| 11 | * precedence over Worker-level policies, which take precedence over this |
| 12 | * account-level policy, so an individual Worker can still be opened up with |
| 13 | * its own application. |
| 14 | * |
| 15 | * ```typescript |
| 16 | * yield* Cloudflare.Access.Application("ProtectAllWorkers", { |
| 17 | * type: "self_hosted", |
| 18 | * destinations: [Cloudflare.Access.AllWorkers], |
| 19 | * policies: [allowTeam], |
| 20 | * }); |
| 21 | * ``` |
| 22 | */ |
| 23 | export const AllWorkers: { type: "all_workers" } = { type: "all_workers" }; |
| 24 | |
| 25 | /** |
| 26 | * Destination covering the **version preview URLs** of every Worker on the |
| 27 | * account — including Workers created later. |
| 28 | * |
| 29 | * ```typescript |
| 30 | * yield* Cloudflare.Access.Application("ProtectAllPreviews", { |
| 31 | * type: "self_hosted", |
| 32 | * destinations: [Cloudflare.Access.AllWorkerPreviews], |
| 33 | * policies: [allowTeam], |
| 34 | * }); |
| 35 | * ``` |
| 36 | */ |
| 37 | export const AllWorkerPreviews: { type: "all_preview_workers" } = { |
| 38 | type: "all_preview_workers", |
| 39 | }; |