@atlasauth/pca-authzen 0.0.0-stage → 0.1.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.
- package/dist/index.d.ts +230 -0
- package/dist/index.js +393 -0
- package/dist/index.js.map +1 -0
- package/package.json +31 -3
- package/README.md +0 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @atlasauth/pca-authzen — PCA behind the OpenID AuthZEN Authorization API.
|
|
3
|
+
*
|
|
4
|
+
* The OpenID AuthZEN Authorization API 1.0 (final, Jan 2026) standardises the PEP↔PDP wire: a Policy
|
|
5
|
+
* Enforcement Point (an API gateway, a service mesh sidecar, an MCP host) asks a Policy Decision Point
|
|
6
|
+
* `can this subject do this action on this resource in this context?` and gets back a boolean decision.
|
|
7
|
+
* This package makes Proof-Carrying Authority (PCA) answer that call, so ANY AuthZEN-speaking PEP can
|
|
8
|
+
* use the PCA verifier + Policy-VM as its decision point without knowing anything about PCActns,
|
|
9
|
+
* capability chains, trust budgets or FROST — instant distribution across the AuthZEN ecosystem.
|
|
10
|
+
*
|
|
11
|
+
* It maps the AuthZEN quad onto PCA two ways:
|
|
12
|
+
* • when the `context` carries a signed PCActn, the PDP VERIFIES it (`verifyPCActnCore`) and then runs
|
|
13
|
+
* the deterministic Policy-VM decision (`decide`) — proof-carrying, runtime authority;
|
|
14
|
+
* • otherwise it evaluates the declared policy STATICALLY (`@atlasauth/pca-analyzer` exact admission) —
|
|
15
|
+
* "is this action admissible at all under the authority?".
|
|
16
|
+
* Everything FAILS CLOSED: an unresolved policy, a malformed/foreign PCActn, a verifier rejection, a
|
|
17
|
+
* policy denial, or any thrown error all yield `decision: false`.
|
|
18
|
+
*
|
|
19
|
+
* Three AuthZEN surfaces are exposed:
|
|
20
|
+
* • Access Evaluation (`evaluate`) — the single `{subject,action,resource,context}` call;
|
|
21
|
+
* • Access Evaluations (`evaluations`) — the boxcar / batch endpoint with default-inheritance;
|
|
22
|
+
* • the COAZ profile (`evaluateTool`) — MCP-tool authorization (tool → required capability → decision);
|
|
23
|
+
* • the AARP profile (step-up) — when the Policy-VM needs a human/guardian co-sign, the
|
|
24
|
+
* decision carries an "approval required" reference that maps
|
|
25
|
+
* onto PCA's FROST/CIBA step-up.
|
|
26
|
+
* A framework-agnostic `authzenHandler` turns all of this into the status + JSON a PEP expects.
|
|
27
|
+
*/
|
|
28
|
+
import { type Capability, type CapabilityChain, type EnforcementGates, type PlanNode, type RequiredThreshold, type RiskInputs, type TrustBudget } from '@atlasauth/pca';
|
|
29
|
+
import { type AnalyzerAction, type PolicyInput } from '@atlasauth/pca-analyzer';
|
|
30
|
+
/** AuthZEN Subject: the entity requesting access (a typed, identified principal + free-form properties). */
|
|
31
|
+
export interface AuthzenSubject {
|
|
32
|
+
type: string;
|
|
33
|
+
id: string;
|
|
34
|
+
properties?: Record<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
/** AuthZEN Action: the operation the subject wants to take. `name` is the verb. */
|
|
37
|
+
export interface AuthzenAction {
|
|
38
|
+
name: string;
|
|
39
|
+
properties?: Record<string, unknown>;
|
|
40
|
+
}
|
|
41
|
+
/** AuthZEN Resource: the target the action is taken on (typed + identified + free-form properties). */
|
|
42
|
+
export interface AuthzenResource {
|
|
43
|
+
type: string;
|
|
44
|
+
id: string;
|
|
45
|
+
properties?: Record<string, unknown>;
|
|
46
|
+
}
|
|
47
|
+
/** AuthZEN Context: environmental / request attributes. Carries the PCActn and/or PCA hints here. */
|
|
48
|
+
export type AuthzenContext = Record<string, unknown>;
|
|
49
|
+
/** The AuthZEN Access Evaluation request (the PDP's single-decision input). */
|
|
50
|
+
export interface AccessEvaluationRequest {
|
|
51
|
+
subject: AuthzenSubject;
|
|
52
|
+
action: AuthzenAction;
|
|
53
|
+
resource: AuthzenResource;
|
|
54
|
+
context?: AuthzenContext;
|
|
55
|
+
}
|
|
56
|
+
/** AuthZEN decision context: the OPTIONAL additional information a PDP returns with a decision. */
|
|
57
|
+
export interface DecisionContext {
|
|
58
|
+
id?: string;
|
|
59
|
+
/** Machine-readable rationale for operators / audit. */
|
|
60
|
+
reason_admin?: Record<string, unknown>;
|
|
61
|
+
/** Human-facing rationale a PEP may surface to the end user. */
|
|
62
|
+
reason_user?: Record<string, unknown>;
|
|
63
|
+
[k: string]: unknown;
|
|
64
|
+
}
|
|
65
|
+
/** The AuthZEN Access Evaluation response. `decision` is the boolean a PEP enforces. */
|
|
66
|
+
export interface AccessEvaluationResponse {
|
|
67
|
+
decision: boolean;
|
|
68
|
+
context?: DecisionContext;
|
|
69
|
+
}
|
|
70
|
+
/** How the PDP processes a boxcar: run everything, or short-circuit on the first deny / permit. */
|
|
71
|
+
export type EvaluationsSemantic = 'execute_all' | 'deny_on_first_deny' | 'permit_on_first_permit';
|
|
72
|
+
/**
|
|
73
|
+
* The AuthZEN Access Evaluations (boxcar) request. Top-level `subject`/`action`/`resource`/`context` are
|
|
74
|
+
* DEFAULTS each item inherits; a per-item field overrides the default for that item only.
|
|
75
|
+
*/
|
|
76
|
+
export interface AccessEvaluationsRequest {
|
|
77
|
+
subject?: AuthzenSubject;
|
|
78
|
+
action?: AuthzenAction;
|
|
79
|
+
resource?: AuthzenResource;
|
|
80
|
+
context?: AuthzenContext;
|
|
81
|
+
evaluations: Array<Partial<AccessEvaluationRequest>>;
|
|
82
|
+
options?: {
|
|
83
|
+
evaluations_semantic?: EvaluationsSemantic;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/** The AuthZEN Access Evaluations (boxcar) response: decisions in request order. */
|
|
87
|
+
export interface AccessEvaluationsResponse {
|
|
88
|
+
evaluations: AccessEvaluationResponse[];
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* COAZ (MCP-tool authorization) request: an MCP host asking whether `subject` may invoke `tool` with the
|
|
92
|
+
* given arguments. The PDP maps the tool to the PCA capability it requires and decides.
|
|
93
|
+
*/
|
|
94
|
+
export interface CoazToolAuthorizationRequest {
|
|
95
|
+
subject: AuthzenSubject;
|
|
96
|
+
tool: {
|
|
97
|
+
name: string;
|
|
98
|
+
arguments?: Record<string, unknown>;
|
|
99
|
+
};
|
|
100
|
+
context?: AuthzenContext;
|
|
101
|
+
}
|
|
102
|
+
/** COAZ response: the decision plus which capability the tool required (tool → required capability → decision). */
|
|
103
|
+
export interface CoazToolAuthorizationResponse {
|
|
104
|
+
decision: boolean;
|
|
105
|
+
/** Echoed tool name. */
|
|
106
|
+
tool: string;
|
|
107
|
+
/** The PCA capability (verb) the tool was authorized against. */
|
|
108
|
+
required_capability: string;
|
|
109
|
+
context?: DecisionContext;
|
|
110
|
+
}
|
|
111
|
+
/** Well-known AuthZEN decision-context key under which the AARP pending-approval reference is carried. */
|
|
112
|
+
export declare const PCA_APPROVAL_KEY: "pca_approval";
|
|
113
|
+
/** Well-known AuthZEN context key under which a PEP forwards the signed PCActn (compact wire string). */
|
|
114
|
+
export declare const PCA_ACTION_KEY: "pca_action";
|
|
115
|
+
/**
|
|
116
|
+
* AARP pending-approval reference. Produced when the Policy-VM decision needs a tier-2 (guardian) or
|
|
117
|
+
* tier-3 (human) co-sign. It maps onto PCA's FROST / CIBA step-up: `tier` is the threshold `t`, and
|
|
118
|
+
* `auth_req_id` is the CIBA-style handle a PEP polls / an approval inbox resolves. `goal_commit` carries
|
|
119
|
+
* the grant's signed goal lineage so the approver sees which goal this action traces back to.
|
|
120
|
+
*/
|
|
121
|
+
export interface AarpPending {
|
|
122
|
+
approval_required: true;
|
|
123
|
+
/** CIBA-style reference the PEP uses to poll / resolve the pending approval. */
|
|
124
|
+
auth_req_id: string;
|
|
125
|
+
/** The threshold tier a guardian/human must satisfy (2 guardian, 3 human). */
|
|
126
|
+
tier: 2 | 3;
|
|
127
|
+
/** The full Policy-VM required threshold (t / proof / optimistic). */
|
|
128
|
+
required_threshold: RequiredThreshold;
|
|
129
|
+
/** Signed goal commitment from the grant this action is under (approval lineage). */
|
|
130
|
+
goal_commit: string;
|
|
131
|
+
/** The risk value the action carries. */
|
|
132
|
+
risk: number;
|
|
133
|
+
reason: string;
|
|
134
|
+
requested_at: number;
|
|
135
|
+
}
|
|
136
|
+
/** True iff this decision is a step-up (deny now, approval pending) carrying an AARP reference. */
|
|
137
|
+
export declare function isApprovalRequired(resp: AccessEvaluationResponse): boolean;
|
|
138
|
+
/** Extract the AARP pending-approval reference from a decision, or null if none. */
|
|
139
|
+
export declare function approvalOf(resp: AccessEvaluationResponse): AarpPending | null;
|
|
140
|
+
/**
|
|
141
|
+
* The PCA authority + evaluation inputs a resolved AuthZEN request decides against. The host supplies
|
|
142
|
+
* this (keyed off the request's subject/resource/etc.) so the PDP stays stateless about where grants and
|
|
143
|
+
* budgets live.
|
|
144
|
+
*/
|
|
145
|
+
export interface PdpDecisionContext {
|
|
146
|
+
/** The signed Root Intent Grant (the capability-chain root the PCActn must chain from). */
|
|
147
|
+
grant: Capability;
|
|
148
|
+
/** The full capability chain (root first). Defaults to the PCActn's own `cap_chain`. */
|
|
149
|
+
chain?: CapabilityChain;
|
|
150
|
+
/** The policy to evaluate STATICALLY when no PCActn is present (the grant's compiled policy, usually). */
|
|
151
|
+
policy: PolicyInput;
|
|
152
|
+
/** Plan nodes for semantic-distance risk (optional). */
|
|
153
|
+
plan?: PlanNode[];
|
|
154
|
+
/**
|
|
155
|
+
* Server-authoritative risk inputs for the Policy-VM. Omitted / missing fields fail safe to WORST
|
|
156
|
+
* (which raises the required threshold), so a PDP that cannot score risk defaults to demanding step-up.
|
|
157
|
+
*/
|
|
158
|
+
risk?: Partial<RiskInputs>;
|
|
159
|
+
/** Trust budget to meter against. Defaults to a fresh budget at the grant's `bMax`. */
|
|
160
|
+
budget?: TrustBudget;
|
|
161
|
+
/** Optional opt-in verifier enforcement gates (M1 taint / M3 freshness / M5 attestation). */
|
|
162
|
+
enforce?: EnforcementGates;
|
|
163
|
+
/** Override the default AuthZEN→PCA action mapping for this request. */
|
|
164
|
+
toAction?: (req: AccessEvaluationRequest) => AnalyzerAction;
|
|
165
|
+
}
|
|
166
|
+
export interface AuthzenPdpConfig {
|
|
167
|
+
/**
|
|
168
|
+
* Resolve the PCA authority for an AuthZEN request. Return `null`/`undefined` to DENY (fail closed:
|
|
169
|
+
* no policy context => no authority => no access). May throw; a throw is caught and fails closed.
|
|
170
|
+
*/
|
|
171
|
+
resolve: (req: AccessEvaluationRequest) => PdpDecisionContext | null | undefined;
|
|
172
|
+
/**
|
|
173
|
+
* This PDP's own audience id, compared to a PCActn's signed `aud` (cross-instance binding):
|
|
174
|
+
* - a string => must equal the PCActn `aud`;
|
|
175
|
+
* - `null` => accept any audience;
|
|
176
|
+
* - omitted => FAIL CLOSED when a PCActn carries an `aud` (forwarded to `verifyPCActnCore`).
|
|
177
|
+
*/
|
|
178
|
+
audience?: string | null;
|
|
179
|
+
/** Clock (epoch ms). Defaults to `Date.now`. */
|
|
180
|
+
now?: () => number;
|
|
181
|
+
/** Map an MCP tool name to the PCA capability (verb) it requires. Default: identity (verb === tool). */
|
|
182
|
+
toolCapability?: (toolName: string) => string;
|
|
183
|
+
}
|
|
184
|
+
export interface AuthzenPdp {
|
|
185
|
+
/** AuthZEN Access Evaluation: one `{subject,action,resource,context}` → one decision. */
|
|
186
|
+
evaluate(req: AccessEvaluationRequest): Promise<AccessEvaluationResponse>;
|
|
187
|
+
/** AuthZEN Access Evaluations: the boxcar / batch endpoint with default-inheritance + semantics. */
|
|
188
|
+
evaluations(req: AccessEvaluationsRequest): Promise<AccessEvaluationsResponse>;
|
|
189
|
+
/** COAZ profile: authorize an MCP tool invocation (tool → required capability → decision). */
|
|
190
|
+
evaluateTool(req: CoazToolAuthorizationRequest): Promise<CoazToolAuthorizationResponse>;
|
|
191
|
+
}
|
|
192
|
+
export declare function isAuthzenSubject(x: unknown): x is AuthzenSubject;
|
|
193
|
+
export declare function isAuthzenAction(x: unknown): x is AuthzenAction;
|
|
194
|
+
export declare function isAuthzenResource(x: unknown): x is AuthzenResource;
|
|
195
|
+
export declare function isAccessEvaluationRequest(x: unknown): x is AccessEvaluationRequest;
|
|
196
|
+
export declare function isAccessEvaluationsRequest(x: unknown): x is AccessEvaluationsRequest;
|
|
197
|
+
export declare function isCoazToolAuthorizationRequest(x: unknown): x is CoazToolAuthorizationRequest;
|
|
198
|
+
/**
|
|
199
|
+
* Default AuthZEN→PCA action mapping:
|
|
200
|
+
* verb = action.name
|
|
201
|
+
* resource = `${resource.type}:${resource.id}` (or just the type when id is empty)
|
|
202
|
+
* params = { ...resource.properties, ...action.properties } (action wins on key collision)
|
|
203
|
+
* subject = subject.properties (witness for `subject.*` conditions)
|
|
204
|
+
* env = context (minus PCA keys) (witness for `env.*` conditions)
|
|
205
|
+
*/
|
|
206
|
+
export declare function defaultToAction(req: AccessEvaluationRequest): AnalyzerAction;
|
|
207
|
+
export declare function authzenPdp(config: AuthzenPdpConfig): AuthzenPdp;
|
|
208
|
+
/** The AuthZEN 1.0 standard Access Evaluation path. */
|
|
209
|
+
export declare const EVALUATION_PATH: "/access/v1/evaluation";
|
|
210
|
+
/** The AuthZEN 1.0 standard Access Evaluations (boxcar) path. */
|
|
211
|
+
export declare const EVALUATIONS_PATH: "/access/v1/evaluations";
|
|
212
|
+
/** The COAZ (MCP-tool authorization) profile path. */
|
|
213
|
+
export declare const COAZ_TOOL_PATH: "/access/v1/mcp/tool/evaluation";
|
|
214
|
+
export interface HandlerRequest {
|
|
215
|
+
path: string;
|
|
216
|
+
body: unknown;
|
|
217
|
+
}
|
|
218
|
+
export interface HandlerResponse {
|
|
219
|
+
status: number;
|
|
220
|
+
body: AccessEvaluationResponse | AccessEvaluationsResponse | CoazToolAuthorizationResponse | {
|
|
221
|
+
error: string;
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* A tiny, framework-agnostic handler: give it `{ path, body }` (body = the parsed JSON a PEP POSTed) and
|
|
226
|
+
* it returns `{ status, body }` to serialize back. A malformed body is a 400 (which a PEP enforces as a
|
|
227
|
+
* deny — fail closed); a decision endpoint always returns 200 with the AuthZEN decision JSON. Drop it
|
|
228
|
+
* behind Express, Fastify, a Lambda, a service-mesh filter — anything that can hand it a path + JSON.
|
|
229
|
+
*/
|
|
230
|
+
export declare function authzenHandler(pdp: AuthzenPdp): (req: HandlerRequest) => Promise<HandlerResponse>;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @atlasauth/pca-authzen — PCA behind the OpenID AuthZEN Authorization API.
|
|
4
|
+
*
|
|
5
|
+
* The OpenID AuthZEN Authorization API 1.0 (final, Jan 2026) standardises the PEP↔PDP wire: a Policy
|
|
6
|
+
* Enforcement Point (an API gateway, a service mesh sidecar, an MCP host) asks a Policy Decision Point
|
|
7
|
+
* `can this subject do this action on this resource in this context?` and gets back a boolean decision.
|
|
8
|
+
* This package makes Proof-Carrying Authority (PCA) answer that call, so ANY AuthZEN-speaking PEP can
|
|
9
|
+
* use the PCA verifier + Policy-VM as its decision point without knowing anything about PCActns,
|
|
10
|
+
* capability chains, trust budgets or FROST — instant distribution across the AuthZEN ecosystem.
|
|
11
|
+
*
|
|
12
|
+
* It maps the AuthZEN quad onto PCA two ways:
|
|
13
|
+
* • when the `context` carries a signed PCActn, the PDP VERIFIES it (`verifyPCActnCore`) and then runs
|
|
14
|
+
* the deterministic Policy-VM decision (`decide`) — proof-carrying, runtime authority;
|
|
15
|
+
* • otherwise it evaluates the declared policy STATICALLY (`@atlasauth/pca-analyzer` exact admission) —
|
|
16
|
+
* "is this action admissible at all under the authority?".
|
|
17
|
+
* Everything FAILS CLOSED: an unresolved policy, a malformed/foreign PCActn, a verifier rejection, a
|
|
18
|
+
* policy denial, or any thrown error all yield `decision: false`.
|
|
19
|
+
*
|
|
20
|
+
* Three AuthZEN surfaces are exposed:
|
|
21
|
+
* • Access Evaluation (`evaluate`) — the single `{subject,action,resource,context}` call;
|
|
22
|
+
* • Access Evaluations (`evaluations`) — the boxcar / batch endpoint with default-inheritance;
|
|
23
|
+
* • the COAZ profile (`evaluateTool`) — MCP-tool authorization (tool → required capability → decision);
|
|
24
|
+
* • the AARP profile (step-up) — when the Policy-VM needs a human/guardian co-sign, the
|
|
25
|
+
* decision carries an "approval required" reference that maps
|
|
26
|
+
* onto PCA's FROST/CIBA step-up.
|
|
27
|
+
* A framework-agnostic `authzenHandler` turns all of this into the status + JSON a PEP expects.
|
|
28
|
+
*/
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.COAZ_TOOL_PATH = exports.EVALUATIONS_PATH = exports.EVALUATION_PATH = exports.PCA_ACTION_KEY = exports.PCA_APPROVAL_KEY = void 0;
|
|
31
|
+
exports.isApprovalRequired = isApprovalRequired;
|
|
32
|
+
exports.approvalOf = approvalOf;
|
|
33
|
+
exports.isAuthzenSubject = isAuthzenSubject;
|
|
34
|
+
exports.isAuthzenAction = isAuthzenAction;
|
|
35
|
+
exports.isAuthzenResource = isAuthzenResource;
|
|
36
|
+
exports.isAccessEvaluationRequest = isAccessEvaluationRequest;
|
|
37
|
+
exports.isAccessEvaluationsRequest = isAccessEvaluationsRequest;
|
|
38
|
+
exports.isCoazToolAuthorizationRequest = isCoazToolAuthorizationRequest;
|
|
39
|
+
exports.defaultToAction = defaultToAction;
|
|
40
|
+
exports.authzenPdp = authzenPdp;
|
|
41
|
+
exports.authzenHandler = authzenHandler;
|
|
42
|
+
const pca_1 = require("@atlasauth/pca");
|
|
43
|
+
const pca_analyzer_1 = require("@atlasauth/pca-analyzer");
|
|
44
|
+
// ---- AARP profile: approval-required (step-up) ----------------------------------------------------
|
|
45
|
+
/** Well-known AuthZEN decision-context key under which the AARP pending-approval reference is carried. */
|
|
46
|
+
exports.PCA_APPROVAL_KEY = 'pca_approval';
|
|
47
|
+
/** Well-known AuthZEN context key under which a PEP forwards the signed PCActn (compact wire string). */
|
|
48
|
+
exports.PCA_ACTION_KEY = 'pca_action';
|
|
49
|
+
/** True iff this decision is a step-up (deny now, approval pending) carrying an AARP reference. */
|
|
50
|
+
function isApprovalRequired(resp) {
|
|
51
|
+
return approvalOf(resp) !== null;
|
|
52
|
+
}
|
|
53
|
+
/** Extract the AARP pending-approval reference from a decision, or null if none. */
|
|
54
|
+
function approvalOf(resp) {
|
|
55
|
+
const ctx = resp.context;
|
|
56
|
+
if (ctx === undefined)
|
|
57
|
+
return null;
|
|
58
|
+
const p = ctx[exports.PCA_APPROVAL_KEY];
|
|
59
|
+
if (isRecord(p) && p.approval_required === true && typeof p.auth_req_id === 'string') {
|
|
60
|
+
// Structurally the pending reference the PDP itself wrote.
|
|
61
|
+
const tier = p.tier === 3 ? 3 : 2;
|
|
62
|
+
const rt = p.required_threshold;
|
|
63
|
+
return {
|
|
64
|
+
approval_required: true,
|
|
65
|
+
auth_req_id: p.auth_req_id,
|
|
66
|
+
tier,
|
|
67
|
+
required_threshold: isRequiredThreshold(rt) ? rt : { t: tier, proof: tier === 3 ? 'strong' : 'standard', optimisticAllowed: false },
|
|
68
|
+
goal_commit: typeof p.goal_commit === 'string' ? p.goal_commit : '',
|
|
69
|
+
risk: typeof p.risk === 'number' ? p.risk : 1,
|
|
70
|
+
reason: typeof p.reason === 'string' ? p.reason : 'approval required',
|
|
71
|
+
requested_at: typeof p.requested_at === 'number' ? p.requested_at : 0,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
// ===================================================================================================
|
|
77
|
+
// small, cast-free guards & helpers
|
|
78
|
+
// ===================================================================================================
|
|
79
|
+
function isRecord(x) {
|
|
80
|
+
return typeof x === 'object' && x !== null && !Array.isArray(x);
|
|
81
|
+
}
|
|
82
|
+
function isRequiredThreshold(x) {
|
|
83
|
+
return isRecord(x) && (x.t === 1 || x.t === 2 || x.t === 3) && typeof x.proof === 'string' && typeof x.optimisticAllowed === 'boolean';
|
|
84
|
+
}
|
|
85
|
+
function isAuthzenSubject(x) {
|
|
86
|
+
return isRecord(x) && typeof x.type === 'string' && typeof x.id === 'string';
|
|
87
|
+
}
|
|
88
|
+
function isAuthzenAction(x) {
|
|
89
|
+
return isRecord(x) && typeof x.name === 'string';
|
|
90
|
+
}
|
|
91
|
+
function isAuthzenResource(x) {
|
|
92
|
+
return isRecord(x) && typeof x.type === 'string' && typeof x.id === 'string';
|
|
93
|
+
}
|
|
94
|
+
function isAccessEvaluationRequest(x) {
|
|
95
|
+
return (isRecord(x) &&
|
|
96
|
+
isAuthzenSubject(x.subject) &&
|
|
97
|
+
isAuthzenAction(x.action) &&
|
|
98
|
+
isAuthzenResource(x.resource) &&
|
|
99
|
+
(x.context === undefined || isRecord(x.context)));
|
|
100
|
+
}
|
|
101
|
+
function isAccessEvaluationsRequest(x) {
|
|
102
|
+
return isRecord(x) && Array.isArray(x.evaluations);
|
|
103
|
+
}
|
|
104
|
+
function isCoazToolAuthorizationRequest(x) {
|
|
105
|
+
return isRecord(x) && isAuthzenSubject(x.subject) && isRecord(x.tool) && typeof x.tool.name === 'string';
|
|
106
|
+
}
|
|
107
|
+
/** A denial response with machine + human rationale. */
|
|
108
|
+
function deny(reason, id) {
|
|
109
|
+
const context = { reason_admin: { denied: true, reason }, reason_user: { message: reason } };
|
|
110
|
+
if (id !== undefined)
|
|
111
|
+
context.id = id;
|
|
112
|
+
return { decision: false, context };
|
|
113
|
+
}
|
|
114
|
+
/** A permit response with optional rationale. */
|
|
115
|
+
function permit(reason) {
|
|
116
|
+
return { decision: true, context: { reason_admin: { reason } } };
|
|
117
|
+
}
|
|
118
|
+
/** Pull a string reversibility hint out of the request (action.properties / context), for static mapping. */
|
|
119
|
+
function pickReversibility(req) {
|
|
120
|
+
const fromAction = req.action.properties;
|
|
121
|
+
if (isRecord(fromAction) && typeof fromAction.reversibility_class === 'string')
|
|
122
|
+
return fromAction.reversibility_class;
|
|
123
|
+
const fromCtx = req.context;
|
|
124
|
+
if (isRecord(fromCtx) && typeof fromCtx.reversibility_class === 'string')
|
|
125
|
+
return fromCtx.reversibility_class;
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
/** The env witness a predicate's `env.*` conditions see: the context minus PCA-private keys. */
|
|
129
|
+
function envFromContext(context) {
|
|
130
|
+
if (!isRecord(context))
|
|
131
|
+
return undefined;
|
|
132
|
+
const out = {};
|
|
133
|
+
for (const [k, v] of Object.entries(context)) {
|
|
134
|
+
if (k === exports.PCA_ACTION_KEY || k === exports.PCA_APPROVAL_KEY)
|
|
135
|
+
continue;
|
|
136
|
+
out[k] = v;
|
|
137
|
+
}
|
|
138
|
+
return Object.keys(out).length > 0 ? out : undefined;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Default AuthZEN→PCA action mapping:
|
|
142
|
+
* verb = action.name
|
|
143
|
+
* resource = `${resource.type}:${resource.id}` (or just the type when id is empty)
|
|
144
|
+
* params = { ...resource.properties, ...action.properties } (action wins on key collision)
|
|
145
|
+
* subject = subject.properties (witness for `subject.*` conditions)
|
|
146
|
+
* env = context (minus PCA keys) (witness for `env.*` conditions)
|
|
147
|
+
*/
|
|
148
|
+
function defaultToAction(req) {
|
|
149
|
+
const resource = req.resource.id.length > 0 ? `${req.resource.type}:${req.resource.id}` : req.resource.type;
|
|
150
|
+
const params = {
|
|
151
|
+
...(isRecord(req.resource.properties) ? req.resource.properties : {}),
|
|
152
|
+
...(isRecord(req.action.properties) ? req.action.properties : {}),
|
|
153
|
+
};
|
|
154
|
+
const out = { verb: req.action.name, resource, params };
|
|
155
|
+
const rc = pickReversibility(req);
|
|
156
|
+
if (rc !== undefined)
|
|
157
|
+
out.reversibilityClass = rc;
|
|
158
|
+
if (isRecord(req.subject.properties))
|
|
159
|
+
out.subject = req.subject.properties;
|
|
160
|
+
const env = envFromContext(req.context);
|
|
161
|
+
if (env !== undefined)
|
|
162
|
+
out.env = env;
|
|
163
|
+
return out;
|
|
164
|
+
}
|
|
165
|
+
/** Extract the forwarded PCActn (compact wire string) from the AuthZEN context, if any. */
|
|
166
|
+
function pcactnFromContext(context) {
|
|
167
|
+
if (!isRecord(context))
|
|
168
|
+
return null;
|
|
169
|
+
const raw = context[exports.PCA_ACTION_KEY];
|
|
170
|
+
if (raw === undefined || raw === null)
|
|
171
|
+
return null;
|
|
172
|
+
if (typeof raw !== 'string')
|
|
173
|
+
return 'malformed';
|
|
174
|
+
try {
|
|
175
|
+
return (0, pca_1.decodePCActn)(raw);
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
return 'malformed';
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
// ===================================================================================================
|
|
182
|
+
// the PDP
|
|
183
|
+
// ===================================================================================================
|
|
184
|
+
function authzenPdp(config) {
|
|
185
|
+
const clock = config.now ?? (() => Date.now());
|
|
186
|
+
const toolCapability = config.toolCapability ?? ((name) => name);
|
|
187
|
+
async function evaluate(req) {
|
|
188
|
+
const now = clock();
|
|
189
|
+
try {
|
|
190
|
+
const ctx = config.resolve(req);
|
|
191
|
+
if (ctx === null || ctx === undefined)
|
|
192
|
+
return deny('no PCA authority resolved for this request');
|
|
193
|
+
const mapped = (ctx.toAction ?? defaultToAction)(req);
|
|
194
|
+
const carried = pcactnFromContext(req.context);
|
|
195
|
+
if (carried === 'malformed')
|
|
196
|
+
return deny('context carries a malformed PCActn');
|
|
197
|
+
// ---- static path: no PCActn → "is this admissible under the declared authority at all?" ----
|
|
198
|
+
if (carried === null) {
|
|
199
|
+
const admissible = (0, pca_analyzer_1.admitsConcrete)(ctx.policy, mapped);
|
|
200
|
+
return admissible
|
|
201
|
+
? permit('statically admissible under the declared authority')
|
|
202
|
+
: deny('action is not admissible under the declared authority');
|
|
203
|
+
}
|
|
204
|
+
// ---- proof-carrying path: verify the PCActn, then run the Policy-VM decision ----
|
|
205
|
+
const p = carried;
|
|
206
|
+
// The proof must be FOR the action the PEP is asking about (bind the signed action to the request):
|
|
207
|
+
// verb + resource, and the request's attributes must hash to the PCActn's signed `params_digest`
|
|
208
|
+
// (so a valid proof for one set of args cannot be replayed against different ones).
|
|
209
|
+
if (p.action.verb !== mapped.verb || p.action.resource !== mapped.resource) {
|
|
210
|
+
return deny(`the PCActn authorizes ${p.action.verb} on ${p.action.resource}, not the requested ${mapped.verb} on ${mapped.resource}`);
|
|
211
|
+
}
|
|
212
|
+
const reqParams = paramsOf(mapped);
|
|
213
|
+
if ((0, pca_1.paramsDigest)(reqParams) !== p.action.params_digest) {
|
|
214
|
+
return deny("the request attributes do not match the PCActn's signed params_digest");
|
|
215
|
+
}
|
|
216
|
+
const verify = await (0, pca_1.verifyPCActnCore)(p, {
|
|
217
|
+
grant: ctx.grant,
|
|
218
|
+
nowEpoch: now,
|
|
219
|
+
audience: config.audience,
|
|
220
|
+
...(ctx.enforce !== undefined ? { enforce: ctx.enforce } : {}),
|
|
221
|
+
});
|
|
222
|
+
if (!verify.allow) {
|
|
223
|
+
return {
|
|
224
|
+
decision: false,
|
|
225
|
+
context: {
|
|
226
|
+
reason_admin: { denied: true, stage: 'verify', checks: verify.checks, reason: verify.reason ?? 'PCActn verification failed' },
|
|
227
|
+
reason_user: { message: 'the proof-carrying action did not verify' },
|
|
228
|
+
},
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
const budget = ctx.budget ?? freshBudget(ctx.grant, now);
|
|
232
|
+
const decision = (0, pca_1.decide)((0, pca_1.deriveDecideInput)(p, {
|
|
233
|
+
grant: ctx.grant,
|
|
234
|
+
chain: ctx.chain ?? p.cap_chain,
|
|
235
|
+
...(ctx.plan !== undefined ? { plan: ctx.plan } : {}),
|
|
236
|
+
params: reqParams,
|
|
237
|
+
risk: ctx.risk ?? {},
|
|
238
|
+
budget,
|
|
239
|
+
now,
|
|
240
|
+
...(mapped.subject !== undefined ? { subject: mapped.subject } : {}),
|
|
241
|
+
...(mapped.env !== undefined ? { env: mapped.env } : {}),
|
|
242
|
+
}));
|
|
243
|
+
if (!decision.releaseGuardianShare) {
|
|
244
|
+
return {
|
|
245
|
+
decision: false,
|
|
246
|
+
context: {
|
|
247
|
+
reason_admin: { denied: true, stage: 'policy', reasons: decision.reasons, risk: decision.r },
|
|
248
|
+
reason_user: { message: 'the policy does not permit this action' },
|
|
249
|
+
},
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
if (decision.admit) {
|
|
253
|
+
return {
|
|
254
|
+
decision: true,
|
|
255
|
+
context: { reason_admin: { stage: 'policy', risk: decision.r, threshold: decision.requiredThreshold } },
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
// Admissible but needs a guardian/human co-sign → AARP approval-required (step-up).
|
|
259
|
+
return approvalRequired(p, decision, ctx.grant, now);
|
|
260
|
+
}
|
|
261
|
+
catch (err) {
|
|
262
|
+
return deny(`evaluation error (fail closed): ${err instanceof Error ? err.message : 'unknown'}`);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
async function evaluations(req) {
|
|
266
|
+
if (!Array.isArray(req.evaluations))
|
|
267
|
+
return { evaluations: [] };
|
|
268
|
+
const semantic = req.options?.evaluations_semantic ?? 'execute_all';
|
|
269
|
+
const merged = req.evaluations.map((item) => mergeEvaluation(req, item));
|
|
270
|
+
if (semantic === 'execute_all') {
|
|
271
|
+
const out = await Promise.all(merged.map((m) => (m === null ? Promise.resolve(deny('incomplete evaluation (missing subject/action/resource)')) : evaluate(m))));
|
|
272
|
+
return { evaluations: out };
|
|
273
|
+
}
|
|
274
|
+
// Short-circuit modes: evaluate sequentially, stop at the first matching decision.
|
|
275
|
+
const out = [];
|
|
276
|
+
for (const m of merged) {
|
|
277
|
+
const r = m === null ? deny('incomplete evaluation (missing subject/action/resource)') : await evaluate(m);
|
|
278
|
+
out.push(r);
|
|
279
|
+
if (semantic === 'deny_on_first_deny' && r.decision === false)
|
|
280
|
+
break;
|
|
281
|
+
if (semantic === 'permit_on_first_permit' && r.decision === true)
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
return { evaluations: out };
|
|
285
|
+
}
|
|
286
|
+
async function evaluateTool(req) {
|
|
287
|
+
const capability = toolCapability(req.tool.name);
|
|
288
|
+
const mappedReq = {
|
|
289
|
+
subject: req.subject,
|
|
290
|
+
action: { name: capability, ...(req.tool.arguments !== undefined ? { properties: req.tool.arguments } : {}) },
|
|
291
|
+
resource: { type: 'mcp_tool', id: req.tool.name },
|
|
292
|
+
...(req.context !== undefined ? { context: req.context } : {}),
|
|
293
|
+
};
|
|
294
|
+
const resp = await evaluate(mappedReq);
|
|
295
|
+
return {
|
|
296
|
+
decision: resp.decision,
|
|
297
|
+
tool: req.tool.name,
|
|
298
|
+
required_capability: capability,
|
|
299
|
+
...(resp.context !== undefined ? { context: resp.context } : {}),
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
return { evaluate, evaluations, evaluateTool };
|
|
303
|
+
}
|
|
304
|
+
// ---- internals ------------------------------------------------------------------------------------
|
|
305
|
+
function paramsOf(action) {
|
|
306
|
+
return isRecord(action.params) ? action.params : {};
|
|
307
|
+
}
|
|
308
|
+
function freshBudget(grant, now) {
|
|
309
|
+
const env = (0, pca_1.readEnvelope)(grant);
|
|
310
|
+
const bMax = env?.risk_policy.bMax;
|
|
311
|
+
return { B: typeof bMax === 'number' && Number.isFinite(bMax) ? bMax : 0, tau: now, asOf: now };
|
|
312
|
+
}
|
|
313
|
+
/** Build the AARP approval-required decision from a step-up Policy-VM result. */
|
|
314
|
+
function approvalRequired(p, decision, grant, now) {
|
|
315
|
+
const tier = decision.requiredThreshold.t >= 3 ? 3 : 2;
|
|
316
|
+
const reason = decision.reasons[0] ?? `requires tier-${tier} co-sign`;
|
|
317
|
+
const auth_req_id = (0, pca_1.hashCanonical)({
|
|
318
|
+
d: 'atlas-pca/authzen/aarp/v1',
|
|
319
|
+
verb: p.action.verb,
|
|
320
|
+
resource: p.action.resource,
|
|
321
|
+
params_digest: p.action.params_digest,
|
|
322
|
+
counter: p.counter,
|
|
323
|
+
at: now,
|
|
324
|
+
});
|
|
325
|
+
const pending = {
|
|
326
|
+
approval_required: true,
|
|
327
|
+
auth_req_id,
|
|
328
|
+
tier,
|
|
329
|
+
required_threshold: decision.requiredThreshold,
|
|
330
|
+
goal_commit: (0, pca_1.readEnvelope)(grant)?.goal_commit ?? '',
|
|
331
|
+
risk: decision.r,
|
|
332
|
+
reason,
|
|
333
|
+
requested_at: now,
|
|
334
|
+
};
|
|
335
|
+
return {
|
|
336
|
+
decision: false,
|
|
337
|
+
context: {
|
|
338
|
+
id: auth_req_id,
|
|
339
|
+
reason_admin: { stage: 'step_up', risk: decision.r, threshold: decision.requiredThreshold, reasons: decision.reasons },
|
|
340
|
+
reason_user: { message: 'approval required before this action can proceed' },
|
|
341
|
+
[exports.PCA_APPROVAL_KEY]: pending,
|
|
342
|
+
},
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
/** Merge boxcar defaults with one item; null when a required piece is still missing (→ fail closed). */
|
|
346
|
+
function mergeEvaluation(defaults, item) {
|
|
347
|
+
const subject = item.subject ?? defaults.subject;
|
|
348
|
+
const action = item.action ?? defaults.action;
|
|
349
|
+
const resource = item.resource ?? defaults.resource;
|
|
350
|
+
const context = item.context ?? defaults.context;
|
|
351
|
+
if (!isAuthzenSubject(subject) || !isAuthzenAction(action) || !isAuthzenResource(resource))
|
|
352
|
+
return null;
|
|
353
|
+
return { subject, action, resource, ...(context !== undefined ? { context } : {}) };
|
|
354
|
+
}
|
|
355
|
+
// ===================================================================================================
|
|
356
|
+
// framework-agnostic HTTP handler
|
|
357
|
+
// ===================================================================================================
|
|
358
|
+
/** The AuthZEN 1.0 standard Access Evaluation path. */
|
|
359
|
+
exports.EVALUATION_PATH = '/access/v1/evaluation';
|
|
360
|
+
/** The AuthZEN 1.0 standard Access Evaluations (boxcar) path. */
|
|
361
|
+
exports.EVALUATIONS_PATH = '/access/v1/evaluations';
|
|
362
|
+
/** The COAZ (MCP-tool authorization) profile path. */
|
|
363
|
+
exports.COAZ_TOOL_PATH = '/access/v1/mcp/tool/evaluation';
|
|
364
|
+
/**
|
|
365
|
+
* A tiny, framework-agnostic handler: give it `{ path, body }` (body = the parsed JSON a PEP POSTed) and
|
|
366
|
+
* it returns `{ status, body }` to serialize back. A malformed body is a 400 (which a PEP enforces as a
|
|
367
|
+
* deny — fail closed); a decision endpoint always returns 200 with the AuthZEN decision JSON. Drop it
|
|
368
|
+
* behind Express, Fastify, a Lambda, a service-mesh filter — anything that can hand it a path + JSON.
|
|
369
|
+
*/
|
|
370
|
+
function authzenHandler(pdp) {
|
|
371
|
+
return async (req) => {
|
|
372
|
+
switch (req.path) {
|
|
373
|
+
case exports.EVALUATION_PATH: {
|
|
374
|
+
if (!isAccessEvaluationRequest(req.body))
|
|
375
|
+
return { status: 400, body: { error: 'invalid AuthZEN Access Evaluation request' } };
|
|
376
|
+
return { status: 200, body: await pdp.evaluate(req.body) };
|
|
377
|
+
}
|
|
378
|
+
case exports.EVALUATIONS_PATH: {
|
|
379
|
+
if (!isAccessEvaluationsRequest(req.body))
|
|
380
|
+
return { status: 400, body: { error: 'invalid AuthZEN Access Evaluations request' } };
|
|
381
|
+
return { status: 200, body: await pdp.evaluations(req.body) };
|
|
382
|
+
}
|
|
383
|
+
case exports.COAZ_TOOL_PATH: {
|
|
384
|
+
if (!isCoazToolAuthorizationRequest(req.body))
|
|
385
|
+
return { status: 400, body: { error: 'invalid COAZ MCP-tool authorization request' } };
|
|
386
|
+
return { status: 200, body: await pdp.evaluateTool(req.body) };
|
|
387
|
+
}
|
|
388
|
+
default:
|
|
389
|
+
return { status: 404, body: { error: `unknown AuthZEN path: ${req.path}` } };
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;AAqJH,gDAEC;AAGD,gCAoBC;AAyED,4CAEC;AACD,0CAEC;AACD,8CAEC;AACD,8DAQC;AACD,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BAAgB,CAAC,CAAC,CAAC;gBACtB,IAAI,CAAC,0BAA0B,CAAC,GAAG,CAAC,IAAI,CAAC;oBAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,4CAA4C,EAAE,EAAE,CAAC;gBACjI,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAChE,CAAC;YACD,KAAK,sBAAc,CAAC,CAAC,CAAC;gBACpB,IAAI,CAAC,8BAA8B,CAAC,GAAG,CAAC,IAAI,CAAC;oBAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,6CAA6C,EAAE,EAAE,CAAC;gBACtI,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACjE,CAAC;YACD;gBACE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,yBAAyB,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC;QACjF,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasauth/pca-authzen",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "AuthZEN PDP for PCA: expose the PCA verifier/policy engine behind the OpenID AuthZEN Authorization API (subject/action/resource/context) with the COAZ MCP-tool and AARP approval profiles, so any AuthZEN PEP can use PCA as its decision point.",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"default": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./package.json": "./package.json"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@atlasauth/pca": "0.1.0",
|
|
16
|
+
"@atlasauth/pca-analyzer": "0.1.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"typescript": "^5.6.3",
|
|
20
|
+
"vitest": "^2.1.4"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"README.md"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsc -p tsconfig.build.json",
|
|
31
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
32
|
+
"test": "vitest run"
|
|
33
|
+
}
|
|
6
34
|
}
|
package/README.md
DELETED