@atlasauth/pca-policy-bridge 0.1.0 → 0.2.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 (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +55 -0
  3. package/package.json +29 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Atlas Authorization
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # @atlasauth/pca-policy-bridge
2
+
3
+ Import existing authorization policy into Proof-Carrying Authority (PCA). Each translator compiles a policy source into PCA predicates (the shapes `@atlasauth/pca` evaluates, droppable into an envelope's `predicates`) plus a report of what was and was not translated. Anything unmodeled fails closed: it never widens an allow.
4
+
5
+ Supported sources:
6
+
7
+ - **Cedar**: `permit` and `forbid` policies (`cedarToPca`)
8
+ - **OPA / Rego**: a subset covering `allow` rules written as conjunctions of `input` comparisons (`regoToPca`)
9
+ - **OpenFGA / Zanzibar**: ReBAC model plus relationship tuples (`openfgaToPca`)
10
+
11
+ ## Install
12
+
13
+ ```sh
14
+ npm i @atlasauth/pca-policy-bridge
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ```ts
20
+ import { cedarToPca, decide } from '@atlasauth/pca-policy-bridge';
21
+
22
+ const result = cedarToPca(`
23
+ permit (principal == User::"alice", action == Action::"view", resource == Photo::"p1");
24
+ forbid (principal, action == Action::"delete", resource);
25
+ `);
26
+
27
+ result.report.errors; // non-empty => incomplete translation, treat as deny
28
+ result.report.skipped; // constructs that were not modeled (each fails closed)
29
+ result.predicates; // permits: plug into Envelope.predicates
30
+ result.denies; // forbids: applied with deny-overrides-permit via decide()
31
+
32
+ // Evaluate one action under the translation (deny overrides permit).
33
+ decide(result, {
34
+ subject: { id: 'User::alice' },
35
+ action: { verb: 'view', resource: 'Photo::p1' },
36
+ });
37
+ ```
38
+
39
+ `regoToPca(moduleText)` and `openfgaToPca(model, tuples)` return the same `BridgeResult` shape. For Cedar group membership (`principal in Group::"g"`), supply the entity parent map to the evaluator at `env.entity_parents`.
40
+
41
+ ## Boundaries
42
+
43
+ Each translator documents the subset it models. Not modeled (reported in `report.skipped` / `report.errors`, and failing closed): Cedar arithmetic, set operations and extension functions; Rego iteration, comprehensions, `:=` assignment and general builtins (the whole containing rule is dropped); OpenFGA userset-valued tuples such as `group:eng#member`.
44
+
45
+ ## API
46
+
47
+ `cedarToPca`, `regoToPca`, `openfgaToPca`, `decide`, and types `BridgeResult`, `TranslationReport`, `PolicySource`.
48
+
49
+ ## Status
50
+
51
+ Part of [Proof-Carrying Authority](https://github.com/Atlas-Authorization/pca). Policy translation is a static compile step; review the report before granting on its output. PCA's cryptography has not been independently audited.
52
+
53
+ ## License
54
+
55
+ MIT - see LICENSE
package/package.json CHANGED
@@ -1,7 +1,29 @@
1
1
  {
2
2
  "name": "@atlasauth/pca-policy-bridge",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Import external authz policy into PCA: compile Cedar and OPA/Rego policies and OpenFGA/Zanzibar ReBAC models+tuples into PCA predicates/caveats, so existing enterprise policy engines drive proof-carrying authority.",
5
+ "keywords": [
6
+ "cedar",
7
+ "opa",
8
+ "rego",
9
+ "openfga",
10
+ "zanzibar",
11
+ "policy import",
12
+ "agent authorization",
13
+ "proof-carrying authority",
14
+ "pca",
15
+ "ai agents"
16
+ ],
17
+ "license": "MIT",
18
+ "homepage": "https://github.com/Atlas-Authorization/pca#readme",
19
+ "bugs": {
20
+ "url": "https://github.com/Atlas-Authorization/pca/issues"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/Atlas-Authorization/pca.git",
25
+ "directory": "packages/pca-policy-bridge"
26
+ },
5
27
  "main": "./dist/index.js",
6
28
  "types": "./dist/index.d.ts",
7
29
  "exports": {
@@ -12,7 +34,7 @@
12
34
  "./package.json": "./package.json"
13
35
  },
14
36
  "dependencies": {
15
- "@atlasauth/pca": "0.1.0"
37
+ "@atlasauth/pca": "0.2.0"
16
38
  },
17
39
  "devDependencies": {
18
40
  "typescript": "^5.6.3",
@@ -20,8 +42,12 @@
20
42
  },
21
43
  "files": [
22
44
  "dist",
23
- "README.md"
45
+ "README.md",
46
+ "LICENSE"
24
47
  ],
48
+ "engines": {
49
+ "node": ">=20"
50
+ },
25
51
  "publishConfig": {
26
52
  "access": "public"
27
53
  },