@intentius/chant-lexicon-cedar 0.44.14 → 0.45.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.
Files changed (49) hide show
  1. package/README.md +13 -4
  2. package/dist/avp/client.d.ts +18 -0
  3. package/dist/avp/client.d.ts.map +1 -1
  4. package/dist/codegen/docs.d.ts +5 -9
  5. package/dist/codegen/docs.d.ts.map +1 -1
  6. package/dist/codegen/generate.d.ts +35 -8
  7. package/dist/codegen/generate.d.ts.map +1 -1
  8. package/dist/commands.d.ts +14 -0
  9. package/dist/commands.d.ts.map +1 -0
  10. package/dist/config.d.ts +38 -2
  11. package/dist/config.d.ts.map +1 -1
  12. package/dist/index.d.ts +5 -2
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/init-templates.d.ts +1 -1
  15. package/dist/integrity.json +4 -4
  16. package/dist/lint/post-synth/cede010.d.ts +5 -4
  17. package/dist/lint/post-synth/cede010.d.ts.map +1 -1
  18. package/dist/manifest.json +1 -1
  19. package/dist/plugin.d.ts.map +1 -1
  20. package/dist/rules/cede010.ts +5 -4
  21. package/dist/schema-artifact.d.ts +50 -0
  22. package/dist/schema-artifact.d.ts.map +1 -0
  23. package/dist/serializer.d.ts.map +1 -1
  24. package/dist/skills/chant-cedar-authoring.md +9 -3
  25. package/dist/spec/fetch.d.ts.map +1 -1
  26. package/package.json +2 -2
  27. package/src/avp/OWNERSHIP.md +4 -1
  28. package/src/avp/client.test.ts +35 -0
  29. package/src/avp/client.ts +29 -2
  30. package/src/codegen/docs.ts +5 -799
  31. package/src/codegen/generate-cli.ts +8 -6
  32. package/src/codegen/generate.ts +63 -14
  33. package/src/codegen/output-dir.test.ts +137 -0
  34. package/src/commands.test.ts +93 -0
  35. package/src/commands.ts +95 -0
  36. package/src/config.ts +50 -4
  37. package/src/index.ts +10 -2
  38. package/src/init-templates.test.ts +22 -4
  39. package/src/init-templates.ts +16 -16
  40. package/src/lint/post-synth/cede010.ts +5 -4
  41. package/src/plugin.ts +33 -8
  42. package/src/schema-artifact.test.ts +160 -0
  43. package/src/schema-artifact.ts +87 -0
  44. package/src/serializer.ts +17 -1
  45. package/src/skills/chant-cedar-authoring.md +9 -3
  46. package/src/spec/fetch.ts +23 -2
  47. package/dist/codegen/docs-dogwood.d.ts +0 -21
  48. package/dist/codegen/docs-dogwood.d.ts.map +0 -1
  49. package/src/codegen/docs-dogwood.ts +0 -1119
package/README.md CHANGED
@@ -38,10 +38,15 @@ The policy id comes from the export's logical name (`allowAdminRead` →
38
38
 
39
39
  ## Where the types come from
40
40
 
41
- `chant generate` reads a `.cedarschema` and emits a class per entity type, a
42
- constant per action, and a UID type per entity — so `action: { eq: ReadAction }`
43
- is checked at compile time and a renamed entity type is a compiler-guided
44
- refactor.
41
+ `chant cedar generate` reads a `.cedarschema` and emits a class per entity
42
+ type, a constant per action, and a UID type per entity — so `action: { eq:
43
+ ReadAction }` is checked at compile time and a renamed entity type is a
44
+ compiler-guided refactor.
45
+
46
+ The output goes into the project, at `src/generated/cedar/` or wherever
47
+ `cedar.outDir` points, and policies import from there. It is never written
48
+ under `node_modules` (#1696). In this package's own checkout the project is the
49
+ package, so `npm run generate` writes `src/generated/` as before.
45
50
 
46
51
  Point it at your schema in `chant.config.ts`:
47
52
 
@@ -62,6 +67,10 @@ the small application-authorization schema bundled at
62
67
  surface. Set `cedar.validation.requireProjectSchema` to turn that fallback off
63
68
  once your project has its own schema.
64
69
 
70
+ A project schema is also emitted by `chant build` as `dist/<name>.cedarschema`
71
+ beside the policies (#1697), so CEDE010 validates the set against it and a
72
+ dogwood bundle can carry it. The bundled default is never emitted.
73
+
65
74
  ## Pins
66
75
 
67
76
  Two, for two different things:
@@ -45,6 +45,15 @@
45
45
  * signing against one would make every local lane need credentials to read
46
46
  * what it just deployed. `signEndpointOverride` opts back in for an
47
47
  * override that *is* real AWS — a VPC endpoint, a signing proxy.
48
+ *
49
+ * What counts as an override is {@link resolveEndpointOverride}: the
50
+ * `endpoint` option, else `AWS_ENDPOINT_URL_VERIFIEDPERMISSIONS`, else
51
+ * `AWS_ENDPOINT_URL` — the AWS SDK's own precedence, and the same rule the aws
52
+ * lexicon's `api/read-client.ts` applies to every transport it owns (#1694).
53
+ * It is restated here rather than imported for the reason above: cedar does
54
+ * not depend on the aws lexicon, and a lexicon build compiles against the
55
+ * published core, so a helper hoisted into core would reach neither lexicon
56
+ * until the next core release.
48
57
  */
49
58
  /** Injectable HTTP, mirroring `AwsReadHttp` in the aws lexicon so tests avoid the network. */
50
59
  export type AvpHttp = (url: string, init: {
@@ -129,6 +138,15 @@ export interface AvpClientOptions {
129
138
  export declare function resolveAvpCredentials(source?: AvpCredentialSource, env?: Record<string, string | undefined>): AvpCredentials | undefined;
130
139
  /** Service host for AVP, honouring an endpoint override. */
131
140
  export declare function avpUrl(endpoint?: string, region?: string): string;
141
+ /**
142
+ * The one rule for what an endpoint override is (#1694): the `endpoint`
143
+ * option when given, else `AWS_ENDPOINT_URL_VERIFIEDPERMISSIONS`, else the
144
+ * ambient `AWS_ENDPOINT_URL`. The result is both the target and, through
145
+ * {@link requestHeaders}, the fact that decides whether the request is signed.
146
+ * Returns `undefined` for real AWS. Mirrors the aws lexicon's
147
+ * `resolveEndpointOverride` for this one service.
148
+ */
149
+ export declare function resolveEndpointOverride(endpoint: string | undefined, env?: Record<string, string | undefined>): string | undefined;
132
150
  /**
133
151
  * Whether this process has anything to authenticate with.
134
152
  *
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/avp/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAMH,8FAA8F;AAC9F,MAAM,MAAM,OAAO,GAAG,CACpB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACvD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;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,2EAA2E;AAC3E,wBAAsB,cAAc,CAClC,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,cAAc,CAAC,CASzB;AAED,6EAA6E;AAC7E,wBAAsB,aAAa,CACjC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAQjC;AAID,iEAAiE;AACjE,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAGvD;AAKD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG;IAAE,MAAM,EAAE,gBAAgB,GAAG,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAQ7G;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAEnG;AAED,wDAAwD;AACxD,wBAAgB,YAAY,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3E"}
@@ -1,15 +1,11 @@
1
1
  /**
2
2
  * The cedar lexicon's Starlight site.
3
3
  *
4
- * Pages are declared as `extraPages` rather than left as hand-written files in
5
- * docs/. The pipeline rebuilds the sidebar from the pages it knows about on
6
- * every run, and Starlight does not auto-discover, so a page the config has
7
- * never heard of exists on disk and is reachable only by typing its URL
8
- * (chant #1312).
9
- *
10
- * Two more pages come out of the pipeline itself: the generated rules table
11
- * (`rules`) and the serialization reference. Both are linked from the sidebar
12
- * automatically.
4
+ * Prose pages are authored under `docs/pages/*.mdx`, each tagged with a
5
+ * Diátaxis quadrant (chant #1731/#1733); the pipeline builds the sidebar from
6
+ * that tag. Two more pages come out of the pipeline itself: the generated
7
+ * rules table (`rules`) and the serialization reference. Both are linked from
8
+ * the sidebar automatically.
13
9
  *
14
10
  * Cross-namespace links are written as full `/chant/...` paths. This site's
15
11
  * base is `/chant/lexicons/cedar/`, so a bare `/guide/...` would be rewritten
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/codegen/docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAqxBH;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA+HjF"}
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/codegen/docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAoGH;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BjF"}
@@ -15,23 +15,50 @@
15
15
  import type { GenerateOptions, GenerateResult } from "@intentius/chant/codegen/generate";
16
16
  /** Filename of the generated registry. */
17
17
  export declare const LEXICON_JSON_FILENAME = "lexicon-cedar.json";
18
+ /** The slice of the `cedar` config namespace generation reads. */
19
+ export interface CedarGenerateConfig {
20
+ schema?: string;
21
+ outDir?: string;
22
+ validation?: {
23
+ requireProjectSchema?: boolean;
24
+ };
25
+ }
18
26
  export interface CedarGenerateOptions extends GenerateOptions {
19
27
  /** Project root the `cedar.schema` path is resolved against. Defaults to `process.cwd()`. */
20
28
  projectRoot?: string;
21
29
  /** The `cedar` config namespace, when the caller has already loaded it. */
22
- config?: {
23
- schema?: string;
24
- validation?: {
25
- requireProjectSchema?: boolean;
26
- };
27
- };
30
+ config?: CedarGenerateConfig;
28
31
  }
32
+ /** This package's root. `<pkg>/src/codegen/generate.ts` is three levels down. */
33
+ export declare function packageDir(): string;
34
+ /**
35
+ * Where generated artifacts go (#1696).
36
+ *
37
+ * Three cases, in order:
38
+ *
39
+ * 1. `cedar.outDir` is set: that directory, resolved against the project root.
40
+ * 2. The project root *is* this package (the monorepo checkout, `npm run
41
+ * generate`, `chant dev check-lexicon`): `<pkg>/src/generated`, which
42
+ * `src/index.ts` re-exports so the package's own surface stays whole.
43
+ * 3. Anything else is a consumer: `<project>/src/generated/cedar`.
44
+ *
45
+ * Case 2 is what the old code assumed everywhere. A consumer's project root
46
+ * and the installed package are different directories, and writing into the
47
+ * second means the output is gone after `npm ci`.
48
+ */
49
+ export declare function resolveGeneratedDir(options?: {
50
+ projectRoot?: string;
51
+ config?: CedarGenerateConfig;
52
+ }): string;
29
53
  /**
30
54
  * Run the code generation pipeline.
31
55
  */
32
56
  export declare function generate(options?: CedarGenerateOptions): Promise<GenerateResult>;
57
+ /** The files one generate run produces, keyed by filename. */
58
+ export declare function generatedFiles(result: GenerateResult): Record<string, string>;
33
59
  /**
34
- * Write generated files to the package directory.
60
+ * Write generated files into `outDir`. With no directory given, writes where
61
+ * {@link resolveGeneratedDir} says for the current working directory.
35
62
  */
36
- export declare function writeGeneratedFiles(result: GenerateResult, pkgDir?: string): void;
63
+ export declare function writeGeneratedFiles(result: GenerateResult, outDir?: string): void;
37
64
  //# sourceMappingURL=generate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/codegen/generate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAiBzF,0CAA0C;AAC1C,eAAO,MAAM,qBAAqB,uBAAuB,CAAC;AAE1D,MAAM,WAAW,oBAAqB,SAAQ,eAAe;IAC3D,6FAA6F;IAC7F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB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AO,CAAC,cAAc,CAAC,CA0D1F;AAED,8DAA8D;AAC9D,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAO7E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAMjF"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * `chant cedar <verb>` — the consumer-facing surface over this lexicon's
3
+ * codegen (#1696), mounted through the command-group seam (#1078).
4
+ *
5
+ * `chant dev generate` exists, but it is lexicon development: it runs every
6
+ * configured lexicon's generate, validate and coverage in turn, and for a
7
+ * project that also lists `aws` that means fetching the CloudFormation spec.
8
+ * A consumer regenerating its own Cedar classes after a schema edit wants one
9
+ * lexicon, one step, and an output path it can see.
10
+ */
11
+ import type { CommandGroup } from "@intentius/chant/cli/command-group";
12
+ /** The `chant cedar` verb group. */
13
+ export declare function cedarCommandGroup(): CommandGroup;
14
+ //# sourceMappingURL=commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAuB,MAAM,oCAAoC,CAAC;AAiE5F,oCAAoC;AACpC,wBAAgB,iBAAiB,IAAI,YAAY,CAiBhD"}
package/dist/config.d.ts CHANGED
@@ -29,6 +29,16 @@ import type { ChantConfig } from "@intentius/chant/config";
29
29
  * Relative to the project root (the directory holding `chant.config.ts`).
30
30
  */
31
31
  export declare const CEDAR_DEFAULT_SCHEMA_PATH = "schema.cedarschema";
32
+ /**
33
+ * Where `generate()` writes when `cedar.outDir` is unset and the project is a
34
+ * consumer of the published package (#1696).
35
+ *
36
+ * Relative to the project root. Inside this lexicon's own checkout the
37
+ * package directory *is* the project root, and the output stays at
38
+ * `src/generated/` so `src/index.ts` can re-export it; see
39
+ * `resolveGeneratedDir` in `codegen/generate.ts`.
40
+ */
41
+ export declare const CEDAR_DEFAULT_OUT_DIR = "src/generated/cedar";
32
42
  /**
33
43
  * `strictObject`, not `object`. Core applies `.strict()` to the top level of a
34
44
  * declared namespace itself; `validation` is nested, and is the lexicon's own
@@ -43,6 +53,18 @@ export declare const cedarConfigSchema: z.ZodObject<{
43
53
  * checkout still produces artifacts.
44
54
  */
45
55
  schema: z.ZodOptional<z.ZodString>;
56
+ /**
57
+ * Directory `generate()` writes the typed classes into, relative to the
58
+ * project root. Defaults to {@link CEDAR_DEFAULT_OUT_DIR}.
59
+ *
60
+ * The output used to land in the installed package's own `src/generated/`,
61
+ * which `npm ci` wipes (#1696). It is the project's artifact — the classes
62
+ * describe the project's schema, not the package's — so it lives in the
63
+ * project tree, and `src/policies.ts` imports from it rather than from
64
+ * `@intentius/chant-lexicon-cedar`. Commit it or regenerate it in CI; either
65
+ * way it is never under `node_modules`.
66
+ */
67
+ outDir: z.ZodOptional<z.ZodString>;
46
68
  /**
47
69
  * Knobs for the `cedar-wasm` validator. `mode` is a single-variant enum on
48
70
  * purpose: `ValidationMode` in cedar-wasm 4.12.0 accepts `"strict"` and
@@ -57,8 +79,8 @@ export declare const cedarConfigSchema: z.ZodObject<{
57
79
  */
58
80
  warnings: z.ZodOptional<z.ZodEnum<{
59
81
  error: "error";
60
- ignore: "ignore";
61
82
  warn: "warn";
83
+ ignore: "ignore";
62
84
  }>>;
63
85
  /**
64
86
  * Refuse to build when no project schema is found rather than falling
@@ -113,7 +135,7 @@ export type CedarConfigNamespace = NonNullable<ChantConfig["cedar"]>;
113
135
  /**
114
136
  * Read the `cedar` namespace out of the project's config.
115
137
  *
116
- * Searches upward from `startDir`, so `chant generate` finds the config from a
138
+ * Searches upward from `startDir`, so `chant cedar generate` finds the config from a
117
139
  * subdirectory the same way `chant build` does. A project with no config, or
118
140
  * one with no `cedar` key, gets `{}` — the schema resolution order in
119
141
  * `spec/fetch.ts` handles that case without needing to know why.
@@ -124,4 +146,18 @@ export type CedarConfigNamespace = NonNullable<ChantConfig["cedar"]>;
124
146
  * never loaded.
125
147
  */
126
148
  export declare function loadCedarConfig(startDir: string): Promise<CedarConfig>;
149
+ /** A project as cedar's commands see it: the root paths resolve against, and the namespace. */
150
+ export interface CedarProject {
151
+ /** The directory holding `chant.config.*`, or `startDir` when there is none. */
152
+ projectRoot: string;
153
+ config: CedarConfig;
154
+ }
155
+ /**
156
+ * {@link loadCedarConfig}, plus the directory the config was found in.
157
+ *
158
+ * `cedar.schema` and `cedar.outDir` are relative to the config file, not to
159
+ * wherever the command was run (#1696) — `chant cedar generate` from a subdirectory
160
+ * has to write to the same place as the same command from the root.
161
+ */
162
+ export declare function loadCedarProject(startDir: string): Promise<CedarProject>;
127
163
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,uBAAuB,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;IAC5B;;;;;;OAMG;;IAGH;;;;OAIG;;QAGC,0EAA0E;;QAE1E;;;WAGG;;;;;;QAEH;;;;;;WAMG;;;IAKP;;;;;;OAMG;;QAGC;;;;;;;;;;;;;;WAcG;;;kBAIP,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,OAAO,QAAQ,yBAAyB,CAAC;IACvC,UAAU,WAAW;QACnB,KAAK,CAAC,EAAE,WAAW,CAAC;KACrB;CACF;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC,WAAW,CAAC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C,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAgB9E"}
package/dist/index.d.ts CHANGED
@@ -33,8 +33,11 @@ export type { DogwoodReplayReportStepOpts, DogwoodReplayStepOpts, PolicyReplayOp
33
33
  export { rules as cedarLintRules } from "./lint/rules/index.js";
34
34
  export { packageLexicon } from "./codegen/package.js";
35
35
  export type { PackageOptions, PackageResult } from "./codegen/package.js";
36
- export { cedarConfigSchema, loadCedarConfig, CEDAR_DEFAULT_SCHEMA_PATH } from "./config.js";
37
- export type { CedarConfig } from "./config.js";
36
+ export { cedarConfigSchema, loadCedarConfig, loadCedarProject, CEDAR_DEFAULT_SCHEMA_PATH, CEDAR_DEFAULT_OUT_DIR } from "./config.js";
37
+ export type { CedarConfig, CedarProject } from "./config.js";
38
+ export { resolveGeneratedDir } from "./codegen/generate.js";
39
+ export { Schema, CEDAR_SCHEMA_TYPE, CEDAR_SCHEMA_FILENAME } from "./schema-artifact.js";
40
+ export type { SchemaProps } from "./schema-artifact.js";
38
41
  export { CEDAR_WASM_VERSION, CEDAR_LANG_VERSION } from "./spec/pin.js";
39
42
  export { computeCedarCoverage, formatCedarCoverage, analyzeCedarCoverage } from "./coverage.js";
40
43
  export type { CedarCoverageReport, CedarCoverageItem } from "./coverage.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvC,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC7G,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACtE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAIjG,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,iBAA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AAM,oBAAoB,CAAC;AAIzD,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AACrF,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAIpE,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC7F,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAIzE,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACpF,YAAY,EACV,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAG/B,cAAc,oBAAoB,CAAC;AAGnC,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAG5E,cAAc,mBAAmB,CAAC"}
@@ -17,7 +17,7 @@
17
17
  *
18
18
  * The policy files use `entityType`-string scopes (`{ is: "App::Document" }`)
19
19
  * and generated action constants, so a scaffolded project compiles the moment
20
- * `chant generate` has run against its own schema.
20
+ * `chant cedar generate` has run against its own schema (#1696).
21
21
  */
22
22
  import type { InitTemplateSet } from "@intentius/chant/lexicon";
23
23
  /**
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "0a757e80b60657560dad1ec74976755944e1309a6165bf40643513f04c0e6e15",
4
+ "manifest.json": "fe3e59e9ab89d64fca5f56bc462bc061a88316b67558b696379a356a126a6f55",
5
5
  "meta.json": "b218779260169a193882aeee76e5ac559588f1682657a001fb0982cffb5843fc",
6
6
  "types/index.d.ts": "9e53a1cb3c9ee38f9de2f3c0db9cc28a0b67c3649be410c341e2451b9b0076cd",
7
7
  "rules/policy-shape.ts": "1654730d188b7163dbad3051c75a562198a96eda6d36ce35701f2b729bf45194",
@@ -11,7 +11,7 @@
11
11
  "rules/cedc012.ts": "0b69e938c9d7a5f4605e9985e9c7dace35718d9280c1bce63edfec87a8e77c21",
12
12
  "rules/cedc013.ts": "cc91a3036aefb467827d35c61119d6d48377169a2ca08e4dd6decd088371a294",
13
13
  "rules/cedc014.ts": "6d35587d13e3c686c8447bf3b069a60b2ee1700a8d48a3de75e36e49701c115f",
14
- "rules/cede010.ts": "17311a6bcb44187d57f7c3363d1b3a9a055378b8d7963d785b7b713f7ef9a078",
14
+ "rules/cede010.ts": "05b9fb4645ccd04c8213a81184dd312d29c139dbc6884f226f32667bc5648e04",
15
15
  "rules/cede011.ts": "4ada79ed88ce09a66ff08abd5bc236691014a2d5954afdb6e0f19364e8ed3931",
16
16
  "rules/ceds010.ts": "215e14de2b84d935ad9551d37c3c06374e5452a5b3f1d7408dc59cd8c2ef1b33",
17
17
  "rules/ceds011.ts": "07984e364b431203a34b42de481fad4fc16d2b838f3fa358726759f4a3ebbfe5",
@@ -25,10 +25,10 @@
25
25
  "rules/dwde011.ts": "5e7f7dbcd9c581bba614fd5c17dcf1282a0b59caef931997c954cea46522251c",
26
26
  "rules/dwds010.ts": "4939f7eb012998d7e27238db777ed7fec2721c2e25df0daec457ff2c62bfa648",
27
27
  "rules/wasm-helpers.ts": "c4c3def1669a1818d19ff1864e78bdcbf956da31ca1a6adde7751830765dad6a",
28
- "skills/chant-cedar-authoring.md": "1b036a72ef13342d402d0de1a68bec0a6f32365ab8485b95f63a971277fd249f",
28
+ "skills/chant-cedar-authoring.md": "2eaefdc6f0fb1ba1fed980759d693886dbb7f0197f3eab3330fe518937045831",
29
29
  "skills/chant-cedar-avp-embedding.md": "1096cc318374dc0683fae289040b089ffc0c7fa029c6b07d4acc19ebcd118b54",
30
30
  "skills/chant-cedar-meta-policy.md": "050b310a87196a48c827f1129698e4c6bbcd96dc963782e22bf1a640bbc20a1a",
31
31
  "skills/chant-cedar-dogwood.md": "fc8c9a2ea9cd7bf87037c156b0b419397d46fbf5cd201c09be721249ac91b8da"
32
32
  },
33
- "composite": "6b519f99d43df0788686d348139b605896f9d9b3e436b6d3aaa97567d567dbbf"
33
+ "composite": "29b82fe2b0b570781eeb64668f3b8ec56b0371f53d26f132f84715ad07275374"
34
34
  }
@@ -24,10 +24,11 @@
24
24
  * When the build emits no schema there is nothing to validate against, and
25
25
  * `validate()` cannot be called at all — it has no optional-schema mode, and an
26
26
  * empty schema is legal Cedar that reports every policy as inapplicable, which
27
- * would be worse than useless. Schema-driven codegen is #1650; until a schema
28
- * is emitted beside the policies, this check says so once, as an advisory,
29
- * rather than passing silently and claiming a guarantee it did not check.
30
- * CEDC010's parse gate still applies in that state.
27
+ * would be worse than useless. A project schema is emitted beside the policies
28
+ * by the plugin's `buildRoots` hook (#1697, `src/schema-artifact.ts`), so the
29
+ * no-schema state is now the project with no schema of its own; there this
30
+ * check says so once, as an advisory, rather than passing silently and
31
+ * claiming a guarantee it did not check. CEDC010's parse gate still applies.
31
32
  */
32
33
  import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
33
34
  export declare const cede010: PostSynthCheck;
@@ -1 +1 @@
1
- {"version":3,"file":"cede010.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/cede010.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAI9G,eAAO,MAAM,OAAO,EAAE,cAqDrB,CAAC"}
1
+ {"version":3,"file":"cede010.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/cede010.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAI9G,eAAO,MAAM,OAAO,EAAE,cAqDrB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cedar",
3
- "version": "0.44.14",
3
+ "version": "0.45.0",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "Cedar",
6
6
  "intrinsics": [],
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAkD,MAAM,0BAA0B,CAAC;AAuB9G;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,aAyTzB,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAkD,MAAM,0BAA0B,CAAC;AAwB9G;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,aAiVzB,CAAC"}
@@ -24,10 +24,11 @@
24
24
  * When the build emits no schema there is nothing to validate against, and
25
25
  * `validate()` cannot be called at all — it has no optional-schema mode, and an
26
26
  * empty schema is legal Cedar that reports every policy as inapplicable, which
27
- * would be worse than useless. Schema-driven codegen is #1650; until a schema
28
- * is emitted beside the policies, this check says so once, as an advisory,
29
- * rather than passing silently and claiming a guarantee it did not check.
30
- * CEDC010's parse gate still applies in that state.
27
+ * would be worse than useless. A project schema is emitted beside the policies
28
+ * by the plugin's `buildRoots` hook (#1697, `src/schema-artifact.ts`), so the
29
+ * no-schema state is now the project with no schema of its own; there this
30
+ * check says so once, as an advisory, rather than passing silently and
31
+ * claiming a guarantee it did not check. CEDC010's parse gate still applies.
31
32
  */
32
33
  import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
33
34
  import { parsedPolicySets } from "./cedar-helpers";
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The project schema as a build artifact (#1697).
3
+ *
4
+ * CEDE010 can only validate a policy set against a schema the build emitted
5
+ * beside it, and until now nothing emitted one: the `.cedarschema` drove
6
+ * codegen and then stayed in the source tree, so every consumer build got the
7
+ * parse-only advisory. This module closes that gap from two directions.
8
+ *
9
+ * `Schema` is a declarable a project can author by hand when it wants a
10
+ * particular filename or a schema that is not the one in `chant.config.ts`.
11
+ * `schemaBuildRoot` is the automatic path: the plugin's `buildRoots` hook
12
+ * contributes one `Schema` entity per build, holding the resolved project
13
+ * schema, so a project with a `cedar.schema` gets `dist/schema.cedarschema`
14
+ * and full validation without declaring anything.
15
+ *
16
+ * The bundled default schema is never emitted. A project without its own
17
+ * schema has policies the default may well reject, and CEDE010 failing a
18
+ * build against a schema the project never wrote would be a worse surprise
19
+ * than the advisory it replaces.
20
+ */
21
+ import type { Declarable } from "@intentius/chant/declarable";
22
+ import type { BuildRootContext, BuildRootContribution } from "@intentius/chant/lexicon";
23
+ /** The entity type of a {@link Schema}. */
24
+ export declare const CEDAR_SCHEMA_TYPE = "Cedar::Schema";
25
+ /** The logical name the build-root contribution uses. */
26
+ export declare const CEDAR_SCHEMA_ENTITY_NAME = "cedarSchema";
27
+ /** Filename the schema is emitted under when `filename` is unset. */
28
+ export declare const CEDAR_SCHEMA_FILENAME = "schema.cedarschema";
29
+ export interface SchemaProps {
30
+ /** Human-readable Cedar schema text, emitted verbatim. */
31
+ text: string;
32
+ /** Defaults to {@link CEDAR_SCHEMA_FILENAME}. Must end in `.cedarschema`. */
33
+ filename?: string;
34
+ }
35
+ /** A `.cedarschema` emitted with the policy set, so post-synth validation has something to validate against. */
36
+ export declare const Schema: new (props: SchemaProps) => Declarable;
37
+ /** One schema file the serializer should write. */
38
+ export interface SchemaFile {
39
+ name: string;
40
+ filename: string;
41
+ text: string;
42
+ }
43
+ /** Every `Cedar::Schema` in the entity map, with its props read. */
44
+ export declare function schemaEntities(entities: Map<string, Declarable>): SchemaFile[];
45
+ /**
46
+ * The `buildRoots` contribution: the project's resolved schema as one
47
+ * {@link Schema} entity, or nothing when only the bundled default applies.
48
+ */
49
+ export declare function schemaBuildRoot(ctx: BuildRootContext): Promise<BuildRootContribution>;
50
+ //# sourceMappingURL=schema-artifact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-artifact.d.ts","sourceRoot":"","sources":["../src/schema-artifact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAQxF,2CAA2C;AAC3C,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AAEjD,yDAAyD;AACzD,eAAO,MAAM,wBAAwB,gBAAgB,CAAC;AAEtD,qEAAqE;AACrE,eAAO,MAAM,qBAAqB,uBAAuB,CAAC;AAE1D,MAAM,WAAW,WAAW;IAC1B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,gHAAgH;AAChH,eAAO,MAAM,MAAM,EAAgE,KAAK,KAAK,EAAE,WAAW,KAAK,UAAU,CAAC;AAE1H,mDAAmD;AACnD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,oEAAoE;AACpE,wBAAgB,cAAc,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,UAAU,EAAE,CAc9E;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAQ3F"}
@@ -1 +1 @@
1
- {"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,KAAK,EAAE,UAAU,EAAoB,MAAM,6BAA6B,CAA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ChB,MAAM,eAAe,CAAC;AAwBvB;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAWnF;AAID,wEAAwE;AACxE,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC3C,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACtC,aAAa,EAAE,OAAO,EAAE,CAAC;CAC1B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,GAAG,CAAC,EAAE,kBAAkB,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CA4BxF;AAID,yFAAyF;AACzF,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,EAAE,EAAE,MAAM,CAAC;IACX,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,iBAAiB,EAAE,CAiBzF;AAID,eAAO,MAAM,eAAe,EAAE,UAoE7B,CAAC"}
@@ -51,9 +51,15 @@ between "your entity types" and "somebody else's" is invisible.
51
51
  ### 2. Run generate
52
52
 
53
53
  ```bash
54
- npx chant generate --lexicon cedar
54
+ npx chant cedar generate
55
55
  ```
56
56
 
57
+ The output is written into the project, at `src/generated/cedar/` (or
58
+ `cedar.outDir`), never into `node_modules`. Commit it or regenerate it in CI;
59
+ re-run it whenever the schema changes. Policies import from that directory,
60
+ not from `@intentius/chant-lexicon-cedar`, whose own `Policy` and classes
61
+ describe the package's bundled sample schema.
62
+
57
63
  That produces, per declaration in the schema:
58
64
 
59
65
  | Schema declaration | Generated |
@@ -68,7 +74,7 @@ compile error, not a validation error hours later.
68
74
  ### 3. Write policies
69
75
 
70
76
  ```typescript
71
- import { Policy, ReadAction, WriteAction, type UserUid } from "@intentius/chant-lexicon-cedar";
77
+ import { Policy, ReadAction, WriteAction, type UserUid } from "./generated/cedar";
72
78
 
73
79
  const archivist: UserUid = 'App::User::"archivist"';
74
80
 
@@ -159,7 +165,7 @@ wider grant.
159
165
 
160
166
  ```bash
161
167
  npx chant build # emits both artifacts, runs the CED rules
162
- npx chant coverage --lexicon cedar # is every schema declaration generated?
168
+ npx chant cedar coverage # is every schema declaration generated?
163
169
  ```
164
170
 
165
171
  The MCP tool `cedar:coverage` answers the other question: which schema entity
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/spec/fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAOH,wDAAwD;AACxD,eAAO,MAAM,uBAAuB,+BAA+B,CAAC;AAEpE,sFAAsF;AACtF,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AAItD,6DAA6D;AAC7D,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,MAAM,WAAW,YAAY;IAC3B,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,8FAA8F;IAC9F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,MAAM,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE;YAAE,oBAAoB,CAAC,EAAE,OAAO,CAAA;SAAE,CAAA;KAAE,CAAC;CAC/E;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,o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C,SAAS,EAAE,OAAO,CAAA;CAAE,CAoB1G;AAED,gCAAgC;AAChC,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,oBAAyB,GAAG,YAAY,CAGjF;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,OAAO,CAAC,EAAE;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC;CACzC,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAK/B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-cedar",
3
- "version": "0.44.14",
3
+ "version": "0.45.0",
4
4
  "description": "Cedar lexicon for chant — typed authoring for Cedar authorization policies",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -74,7 +74,7 @@
74
74
  },
75
75
  "peerDependencies": {
76
76
  "zod": "^4.3.6",
77
- "@intentius/chant": "^0.44.14",
77
+ "@intentius/chant": "^0.45.0",
78
78
  "typescript": "^5.9.3"
79
79
  }
80
80
  }
@@ -127,7 +127,10 @@ trade the decoupling buys, and it is why the two files name each other in prose.
127
127
  Unsigned stays the default, and three cases stay unsigned regardless: no signer wired
128
128
  in, no credentials resolved, and an endpoint override without `signEndpointOverride`
129
129
  (an emulator does not verify signatures, and signing against one would make every local
130
- lane need credentials to read what it just deployed). `credentialsAvailable` therefore
130
+ lane need credentials to read what it just deployed). An override is the `endpoint`
131
+ option, else `AWS_ENDPOINT_URL_VERIFIEDPERMISSIONS`, else `AWS_ENDPOINT_URL` — the SDK's
132
+ precedence, and the rule the aws lexicon's read client applies (#1694); it is restated
133
+ in `resolveEndpointOverride` for the same reason the signer shapes are. `credentialsAvailable` therefore
131
134
  still gates the readers exactly as before — a caller that wires nothing in gets every
132
135
  entity NOT-OBSERVED with `no-credentials` rather than a request that was never going to
133
136
  work.
@@ -11,6 +11,7 @@ import { createHmac } from "node:crypto";
11
11
  import { describe, expect, test } from "vitest";
12
12
  import {
13
13
  avpCall,
14
+ resolveEndpointOverride,
14
15
  resolveAvpCredentials,
15
16
  type AvpClientOptions,
16
17
  type AvpHttp,
@@ -225,6 +226,40 @@ describe("endpoint overrides", () => {
225
226
  expect(signed).toHaveLength(0);
226
227
  });
227
228
 
229
+ test("AWS_ENDPOINT_URL_VERIFIEDPERMISSIONS wins over AWS_ENDPOINT_URL, and the option over both (#1694)", async () => {
230
+ const { http, calls } = recording();
231
+ const { signer, signed } = stubSigner();
232
+ const env = { AWS_ENDPOINT_URL: "http://all:1", AWS_ENDPOINT_URL_VERIFIEDPERMISSIONS: "http://avp:2" };
233
+ await avpCall("ListPolicies", { policyStoreId: "PS-abc" }, { region: "us-west-2", credentials, signer, http, env });
234
+ await avpCall("ListPolicies", { policyStoreId: "PS-abc" }, {
235
+ endpoint: "http://opt:3",
236
+ region: "us-west-2",
237
+ credentials,
238
+ signer,
239
+ http,
240
+ env,
241
+ });
242
+ expect(calls.map((c) => c.url)).toEqual(["http://avp:2/", "http://opt:3/"]);
243
+ expect(signed).toHaveLength(0);
244
+ expect(resolveEndpointOverride(undefined, {})).toBeUndefined();
245
+ });
246
+
247
+ test("signEndpointOverride signs against an override the environment named", async () => {
248
+ const { http, calls } = recording();
249
+ const { signer, signed } = stubSigner();
250
+ await avpCall("ListPolicies", { policyStoreId: "PS-abc" }, {
251
+ region: "us-west-2",
252
+ credentials,
253
+ signer,
254
+ signEndpointOverride: true,
255
+ now,
256
+ http,
257
+ env: { AWS_ENDPOINT_URL: "https://vpce-1234.verifiedpermissions.us-west-2.vpce.amazonaws.com" },
258
+ });
259
+ expect(calls[0]!.headers.authorization).toMatch(/Signature=[0-9a-f]{64}$/);
260
+ expect(signed[0]!.url).toBe("https://vpce-1234.verifiedpermissions.us-west-2.vpce.amazonaws.com/");
261
+ });
262
+
228
263
  test("signEndpointOverride signs one anyway — for an override that is real AWS", async () => {
229
264
  const { http, calls } = recording();
230
265
  const { signer, signed } = stubSigner();