@intentius/chant-lexicon-cedar 0.124.45 → 0.124.48

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "4b9a7285e37af554faace1eb4f05a17d8115cc09072dbec081f89089362a332b",
4
+ "manifest.json": "f2ab912ed80876a89c3b584f19aefbc30019ea17872bf211e5e635658255a366",
5
5
  "meta.json": "b218779260169a193882aeee76e5ac559588f1682657a001fb0982cffb5843fc",
6
6
  "types/index.d.ts": "9e53a1cb3c9ee38f9de2f3c0db9cc28a0b67c3649be410c341e2451b9b0076cd",
7
7
  "rules/policy-shape.ts": "11377265f05ede594b77c2b6cc3d977a688e5e5712e7a706e7aa6fd6ea05d027",
@@ -30,5 +30,5 @@
30
30
  "skills/chant-cedar-meta-policy.md": "050b310a87196a48c827f1129698e4c6bbcd96dc963782e22bf1a640bbc20a1a",
31
31
  "skills/chant-cedar-dogwood.md": "7e52d3f045c1c34e00fdef76014a05483fb9dd58cc41037621a76bc298776d8f"
32
32
  },
33
- "composite": "34208718d0493b147ff4b3d904f41e9040d28642a50a086f2ff90a759277cc09"
33
+ "composite": "048ff8a8a452ce252b0faed532fd75e2a4e4084568122f94f8b7c3b640e20d17"
34
34
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cedar",
3
- "version": "0.124.45",
3
+ "version": "0.124.48",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "Cedar",
6
6
  "intrinsics": [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-cedar",
3
- "version": "0.124.45",
3
+ "version": "0.124.48",
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,6 +74,6 @@
74
74
  },
75
75
  "peerDependencies": {
76
76
  "zod": "^4.3.6",
77
- "@intentius/chant": "^0.124.45"
77
+ "@intentius/chant": "^0.124.48"
78
78
  }
79
79
  }
@@ -30,9 +30,12 @@ const maintainers = new Policy({
30
30
  action: { eq: PASS_GATE },
31
31
  });
32
32
 
33
+ // `roles` are the ones .chant/trust.json at base gives a proven approver
34
+ // (#4324). Roles an approver claims with `chant approve --role` never reach
35
+ // the request.
33
36
  function ask(kind: "human" | "agent", name: string, context: Record<string, unknown>, roles: string[] = []) {
34
37
  return gatePolicyRequest({
35
- op: "release", gate: "ship", resolvedBy: name, approver: { kind, roles }, planDigest: PLAN, context,
38
+ op: "release", gate: "ship", resolvedBy: name, approver: { kind }, roles, planDigest: PLAN, context,
36
39
  });
37
40
  }
38
41
 
@@ -71,11 +74,18 @@ describe("evaluateGatePolicy (chant#2508)", () => {
71
74
  expect(evaluateGatePolicy(ref, ask("agent", "release-bot", { risk: "high" })).decision).toBe("deny");
72
75
  });
73
76
 
74
- test("reads a claimed role as a parent entity", () => {
77
+ test("reads a proven role as a parent entity (#4324)", () => {
75
78
  expect(evaluateGatePolicy(ref, ask("human", "alex", {}, ["maintainer"])).determining).toEqual(["maintainers"]);
76
79
  expect(evaluateGatePolicy(ref, ask("human", "pat", {}, ["viewer"])).decision).toBe("deny");
77
80
  });
78
81
 
82
+ test("a role the approver only claims is not read (#4324)", () => {
83
+ const request = gatePolicyRequest({
84
+ op: "release", gate: "ship", resolvedBy: "alex", approver: { kind: "human", roles: ["maintainer"] }, planDigest: PLAN, context: {},
85
+ });
86
+ expect(evaluateGatePolicy(ref, request).decision).toBe("deny");
87
+ });
88
+
79
89
  test("a policy that errors on a request does not apply, and the error is reported", () => {
80
90
  // `context.risk` is absent, so the agent rule errors rather than matching.
81
91
  const answer = evaluateGatePolicy(ref, ask("agent", "release-bot", {}));