@fabrika/provider-cloudflare 0.9.0-dev.8 → 0.9.0-dev.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabrika/provider-cloudflare",
3
- "version": "0.9.0-dev.8",
3
+ "version": "0.9.0-dev.9",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,15 +43,15 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "zod": "^3.25.76",
46
- "@fabrika/app": "0.9.0-dev.8",
47
- "@fabrika/auth": "0.9.0-dev.8",
48
- "@fabrika/auth-core": "0.9.0-dev.8",
49
- "@fabrika/check": "0.9.0-dev.8",
50
- "@fabrika/email": "0.9.0-dev.8",
51
- "@fabrika/iam-contract": "0.9.0-dev.8",
52
- "@fabrika/installation-init": "0.9.0-dev.8",
53
- "@fabrika/proxy-core": "0.9.0-dev.8",
54
- "@fabrika/provider-contract": "0.9.0-dev.8",
46
+ "@fabrika/app": "0.9.0-dev.9",
47
+ "@fabrika/auth": "0.9.0-dev.9",
48
+ "@fabrika/auth-core": "0.9.0-dev.9",
49
+ "@fabrika/check": "0.9.0-dev.9",
50
+ "@fabrika/email": "0.9.0-dev.9",
51
+ "@fabrika/iam-contract": "0.9.0-dev.9",
52
+ "@fabrika/installation-init": "0.9.0-dev.9",
53
+ "@fabrika/proxy-core": "0.9.0-dev.9",
54
+ "@fabrika/provider-contract": "0.9.0-dev.9",
55
55
  "ignore": "^5.3.2",
56
56
  "oblaka-iac": "^0.0.18"
57
57
  }
package/src/provider.ts CHANGED
@@ -532,6 +532,15 @@ const stageAssets = async (env: StepEnv, assets: NonNullable<StepEnv['spaAssets'
532
532
  env.run.log(` staged ${staged} SPA files into ${SPA_ASSETS_DIRECTORY}: ${mounts}`)
533
533
  }
534
534
 
535
+ /**
536
+ * The secrets stored for the environment that `fabrika.config.ts` does not name in `pipeline.secrets`, by name. The deploy
537
+ * writes only declared ones, so these never reach the Worker; the run log says so, as an author would otherwise wonder.
538
+ */
539
+ export const undeclaredSecrets = (config: CloudflareAppConfig, run: Pick<CloudflareDeployRun, 'secrets'>): string[] => {
540
+ const declared = new Set(config.pipeline?.secrets ?? [])
541
+ return Object.keys(run.secrets).filter((name) => !declared.has(name)).sort()
542
+ }
543
+
535
544
  const runStep = async (spec: CloudflareStep, env: StepEnv): Promise<void> => {
536
545
  const { config, run, credentials, worker, dir, cf } = env
537
546
  const { signal, dryRun } = run
@@ -587,6 +596,9 @@ const runStep = async (spec: CloudflareStep, env: StepEnv): Promise<void> => {
587
596
  return
588
597
  }
589
598
  case 'deploy-worker': {
599
+ for (const name of undeclaredSecrets(config, run)) {
600
+ run.log(` the secret ${name} is stored for this environment but not named in pipeline.secrets, so the Worker does not get it`)
601
+ }
590
602
  const configs = env.generatedConfigs
591
603
  // The configs oblaka wrote, not the generation checked before the run: a stateful binding can emit differently twice.
592
604
  assertGeneratedConfigs(configs, env.bounds)
@@ -5,6 +5,11 @@ import type { CloudflareAppConfig } from './authoring';
5
5
  import { type CloudflareCollaborators } from './collaborators';
6
6
  import type { RunnerApprovedAccess } from './runner-protocol';
7
7
  import { type AssetMount } from './spa-assets';
8
+ /**
9
+ * The secrets stored for the environment that `fabrika.config.ts` does not name in `pipeline.secrets`, by name. The deploy
10
+ * writes only declared ones, so these never reach the Worker; the run log says so, as an author would otherwise wonder.
11
+ */
12
+ export declare const undeclaredSecrets: (config: CloudflareAppConfig, run: Pick<CloudflareDeployRun, "secrets">) => string[];
8
13
  export interface CloudflareDeployerOptions {
9
14
  readonly accountId: string;
10
15
  readonly apiToken: string;