@kya-os/checkpoint-shared 1.5.2 → 1.7.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/CHANGELOG.md +98 -1
- package/dist/beacon-types/index.d.mts +12 -1
- package/dist/beacon-types/index.d.mts.map +1 -1
- package/dist/beacon-types/index.d.ts +12 -1
- package/dist/beacon-types/index.d.ts.map +1 -1
- package/dist/beacon-types/index.js +18 -1
- package/dist/beacon-types/index.mjs +18 -2
- package/dist/beacon-types/index.mjs.map +1 -1
- package/dist/{browser-posture-D4j2a5gi.d.ts → browser-posture-B8YiPa5c.d.ts} +6 -6
- package/dist/{browser-posture-D4j2a5gi.d.ts.map → browser-posture-B8YiPa5c.d.ts.map} +1 -1
- package/dist/{browser-posture-DVoHMHjY.d.mts → browser-posture-BLhw-MON.d.mts} +6 -6
- package/dist/{browser-posture-DVoHMHjY.d.mts.map → browser-posture-BLhw-MON.d.mts.map} +1 -1
- package/dist/browser-posture-cookie.js +1 -1
- package/dist/browser-posture-cookie.mjs +1 -1
- package/dist/browser-posture-cookie.mjs.map +1 -1
- package/dist/browser-posture-proof.d.mts +2 -2
- package/dist/browser-posture-proof.d.mts.map +1 -1
- package/dist/browser-posture-proof.d.ts +2 -2
- package/dist/browser-posture-proof.d.ts.map +1 -1
- package/dist/browser-posture-proof.js +43 -2
- package/dist/browser-posture-proof.mjs +43 -2
- package/dist/browser-posture-proof.mjs.map +1 -1
- package/dist/browser-posture.d.mts +1 -1
- package/dist/browser-posture.d.ts +1 -1
- package/dist/browser-posture.js +3 -3
- package/dist/browser-posture.mjs +3 -3
- package/dist/browser-posture.mjs.map +1 -1
- package/dist/canonical-signer/index.d.mts.map +1 -1
- package/dist/canonical-signer/index.d.ts.map +1 -1
- package/dist/canonical-signer/index.js +86 -51
- package/dist/canonical-signer/index.mjs +86 -51
- package/dist/canonical-signer/index.mjs.map +1 -1
- package/dist/clearance.d.mts +1 -1
- package/dist/clearance.d.ts +1 -1
- package/dist/clearance.js +2 -2
- package/dist/clearance.mjs +2 -2
- package/dist/client-ip-DFamiNoz.d.mts +34 -0
- package/dist/client-ip-DFamiNoz.d.mts.map +1 -0
- package/dist/client-ip-DFamiNoz.d.ts +34 -0
- package/dist/client-ip-DFamiNoz.d.ts.map +1 -0
- package/dist/client-ip.d.mts +2 -0
- package/dist/client-ip.d.ts +2 -0
- package/dist/client-ip.js +7 -0
- package/dist/client-ip.mjs +3 -0
- package/dist/errors/index.d.mts +17 -0
- package/dist/errors/index.d.mts.map +1 -1
- package/dist/errors/index.d.ts +17 -0
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +75 -3
- package/dist/errors/index.mjs +75 -3
- package/dist/errors/index.mjs.map +1 -1
- package/dist/{external-Ct8j_hto.d.ts → external-B7WI9FyQ.d.mts} +2 -2
- package/dist/{external-Ct8j_hto.d.mts.map → external-B7WI9FyQ.d.mts.map} +1 -1
- package/dist/{external-Ct8j_hto.d.mts → external-B7WI9FyQ.d.ts} +2 -2
- package/dist/{external-Ct8j_hto.d.ts.map → external-B7WI9FyQ.d.ts.map} +1 -1
- package/dist/gateway-client-ip.d.mts +1 -1
- package/dist/gateway-client-ip.d.ts +1 -1
- package/dist/gateway-client-ip.js +1 -1
- package/dist/gateway-client-ip.mjs +1 -1
- package/dist/host-adapter/index.d.mts +2 -0
- package/dist/host-adapter/index.d.ts +2 -0
- package/dist/host-adapter/index.js +23 -0
- package/dist/host-adapter/index.mjs +3 -0
- package/dist/host-adapter-C-4IxmqM.mjs +540 -0
- package/dist/host-adapter-C-4IxmqM.mjs.map +1 -0
- package/dist/host-adapter-CwW9YB0U.js +694 -0
- package/dist/index-B7rTovHa.d.mts +707 -0
- package/dist/index-B7rTovHa.d.mts.map +1 -0
- package/dist/index-HaqfPtaL.d.ts +707 -0
- package/dist/index-HaqfPtaL.d.ts.map +1 -0
- package/dist/index.d.mts +742 -937
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +742 -937
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +758 -1193
- package/dist/index.mjs +659 -1148
- package/dist/index.mjs.map +1 -1
- package/dist/kya-http-error-codes-7ewV5RuK.d.mts +29 -0
- package/dist/kya-http-error-codes-7ewV5RuK.d.mts.map +1 -0
- package/dist/kya-http-error-codes-7ewV5RuK.d.ts +29 -0
- package/dist/kya-http-error-codes-7ewV5RuK.d.ts.map +1 -0
- package/dist/kya-http-error-codes-C2JiWPsi.mjs +73 -0
- package/dist/kya-http-error-codes-C2JiWPsi.mjs.map +1 -0
- package/dist/kya-http-error-codes-UYb1zpGM.js +83 -0
- package/dist/kya-http.d.mts +3 -0
- package/dist/kya-http.d.ts +3 -0
- package/dist/kya-http.js +11 -0
- package/dist/kya-http.mjs +4 -0
- package/dist/mcpi/approval-grant/index.d.mts.map +1 -1
- package/dist/mcpi/approval-grant/index.d.ts.map +1 -1
- package/dist/mcpi/approval-grant/index.js +10 -1
- package/dist/mcpi/approval-grant/index.mjs +10 -1
- package/dist/mcpi/approval-grant/index.mjs.map +1 -1
- package/dist/mcpi/dashboard-config/index.d.mts +3 -2
- package/dist/mcpi/dashboard-config/index.d.mts.map +1 -1
- package/dist/mcpi/dashboard-config/index.d.ts +3 -2
- package/dist/mcpi/dashboard-config/index.d.ts.map +1 -1
- package/dist/policy/enforcement.d.mts +2 -0
- package/dist/policy/enforcement.d.ts +2 -0
- package/dist/policy/enforcement.js +15 -0
- package/dist/policy/enforcement.mjs +3 -0
- package/dist/{posture-origins-Dl7i8j93.mjs → posture-origins-Ba83O0cD.mjs} +3 -3
- package/dist/posture-origins-Ba83O0cD.mjs.map +1 -0
- package/dist/{posture-origins-CEm83u4D.js → posture-origins-CdVOdiMT.js} +7 -1
- package/dist/{project-verification-key-CgSVX9_m.mjs → project-verification-key-66N4edKn.mjs} +2 -2
- package/dist/{project-verification-key-CgSVX9_m.mjs.map → project-verification-key-66N4edKn.mjs.map} +1 -1
- package/dist/{project-verification-key-C3L5rd8a.js → project-verification-key-BccT12tQ.js} +1 -1
- package/dist/registered-sid-D3g-gZQF.d.mts +11 -0
- package/dist/registered-sid-D3g-gZQF.d.mts.map +1 -0
- package/dist/registered-sid-D3g-gZQF.d.ts +11 -0
- package/dist/registered-sid-D3g-gZQF.d.ts.map +1 -0
- package/dist/registered-sid-eLCNZvIF.js +170 -0
- package/dist/registered-sid-hUl-bvM5.mjs +142 -0
- package/dist/registered-sid-hUl-bvM5.mjs.map +1 -0
- package/dist/{schemas-DxY-dk9y.mjs → schemas-7qodsG-Z.mjs} +49 -2
- package/dist/schemas-7qodsG-Z.mjs.map +1 -0
- package/dist/{schemas-BmjNLAE7.js → schemas-YhagYDx_.js} +59 -0
- package/dist/step-up-BjP--hG-.d.mts +114 -0
- package/dist/step-up-BjP--hG-.d.mts.map +1 -0
- package/dist/step-up-BjP--hG-.d.ts +114 -0
- package/dist/step-up-BjP--hG-.d.ts.map +1 -0
- package/dist/step-up-C2d8C20x.js +1697 -0
- package/dist/step-up-COlmWJN8.mjs +1513 -0
- package/dist/step-up-COlmWJN8.mjs.map +1 -0
- package/fixtures/cli-registration.v2.json +115 -0
- package/fixtures/detection/reason-codes.json +1 -1
- package/fixtures/kya-http/README.md +34 -26
- package/fixtures/kya-http/protected-resource-metadata.full.json +14 -5
- package/fixtures/kya-http/protected-resource-metadata.invalid-issuer.json +51 -0
- package/fixtures/kya-http/protected-resource-metadata.no-issuer.json +32 -0
- package/fixtures/reviewer-grant-revocation.v1.json +285 -0
- package/package.json +26 -4
- package/dist/posture-origins-Dl7i8j93.mjs.map +0 -1
- package/dist/schemas-DxY-dk9y.mjs.map +0 -1
- package/fixtures/kya-http/protected-resource-metadata.global.json +0 -28
|
@@ -924,6 +924,7 @@ const string$1 = (params) => {
|
|
|
924
924
|
const integer = /^-?\d+$/;
|
|
925
925
|
const number$1 = /^-?\d+(?:\.\d+)?$/;
|
|
926
926
|
const boolean$1 = /^(?:true|false)$/i;
|
|
927
|
+
const _null$2 = /^null$/i;
|
|
927
928
|
const lowercase = /^[^A-Z]*$/;
|
|
928
929
|
const uppercase = /^[^a-z]*$/;
|
|
929
930
|
|
|
@@ -1796,6 +1797,22 @@ const $ZodBoolean = /*@__PURE__*/ $constructor("$ZodBoolean", (inst, def) => {
|
|
|
1796
1797
|
return payload;
|
|
1797
1798
|
};
|
|
1798
1799
|
});
|
|
1800
|
+
const $ZodNull = /*@__PURE__*/ $constructor("$ZodNull", (inst, def) => {
|
|
1801
|
+
$ZodType.init(inst, def);
|
|
1802
|
+
inst._zod.pattern = _null$2;
|
|
1803
|
+
inst._zod.values = /* @__PURE__ */ new Set([null]);
|
|
1804
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
1805
|
+
const input = payload.value;
|
|
1806
|
+
if (input === null) return payload;
|
|
1807
|
+
payload.issues.push({
|
|
1808
|
+
expected: "null",
|
|
1809
|
+
code: "invalid_type",
|
|
1810
|
+
input,
|
|
1811
|
+
inst
|
|
1812
|
+
});
|
|
1813
|
+
return payload;
|
|
1814
|
+
};
|
|
1815
|
+
});
|
|
1799
1816
|
const $ZodAny = /*@__PURE__*/ $constructor("$ZodAny", (inst, def) => {
|
|
1800
1817
|
$ZodType.init(inst, def);
|
|
1801
1818
|
inst._zod.parse = (payload) => payload;
|
|
@@ -3434,6 +3451,13 @@ function _coercedBoolean(Class, params) {
|
|
|
3434
3451
|
});
|
|
3435
3452
|
}
|
|
3436
3453
|
// @__NO_SIDE_EFFECTS__
|
|
3454
|
+
function _null$1(Class, params) {
|
|
3455
|
+
return new Class({
|
|
3456
|
+
type: "null",
|
|
3457
|
+
...normalizeParams(params)
|
|
3458
|
+
});
|
|
3459
|
+
}
|
|
3460
|
+
// @__NO_SIDE_EFFECTS__
|
|
3437
3461
|
function _any(Class) {
|
|
3438
3462
|
return new Class({ type: "any" });
|
|
3439
3463
|
}
|
|
@@ -4174,6 +4198,13 @@ const numberProcessor = (schema, ctx, _json, params) => {
|
|
|
4174
4198
|
const booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
4175
4199
|
json.type = "boolean";
|
|
4176
4200
|
};
|
|
4201
|
+
const nullProcessor = (_schema, ctx, json, _params) => {
|
|
4202
|
+
if (ctx.target === "openapi-3.0") {
|
|
4203
|
+
json.type = "string";
|
|
4204
|
+
json.nullable = true;
|
|
4205
|
+
json.enum = [null];
|
|
4206
|
+
} else json.type = "null";
|
|
4207
|
+
};
|
|
4177
4208
|
const neverProcessor = (_schema, _ctx, json, _params) => {
|
|
4178
4209
|
json.not = {};
|
|
4179
4210
|
};
|
|
@@ -5059,6 +5090,14 @@ const ZodBoolean = /*@__PURE__*/ $constructor("ZodBoolean", (inst, def) => {
|
|
|
5059
5090
|
function boolean(params) {
|
|
5060
5091
|
return _boolean(ZodBoolean, params);
|
|
5061
5092
|
}
|
|
5093
|
+
const ZodNull = /*@__PURE__*/ $constructor("ZodNull", (inst, def) => {
|
|
5094
|
+
$ZodNull.init(inst, def);
|
|
5095
|
+
ZodType.init(inst, def);
|
|
5096
|
+
inst._zod.processJSONSchema = (ctx, json, params) => nullProcessor(inst, ctx, json, params);
|
|
5097
|
+
});
|
|
5098
|
+
function _null(params) {
|
|
5099
|
+
return _null$1(ZodNull, params);
|
|
5100
|
+
}
|
|
5062
5101
|
const ZodAny = /*@__PURE__*/ $constructor("ZodAny", (inst, def) => {
|
|
5063
5102
|
$ZodAny.init(inst, def);
|
|
5064
5103
|
ZodType.init(inst, def);
|
|
@@ -5195,6 +5234,14 @@ function object(shape, params) {
|
|
|
5195
5234
|
};
|
|
5196
5235
|
return new ZodObject(def);
|
|
5197
5236
|
}
|
|
5237
|
+
function strictObject(shape, params) {
|
|
5238
|
+
return new ZodObject({
|
|
5239
|
+
type: "object",
|
|
5240
|
+
shape,
|
|
5241
|
+
catchall: never(),
|
|
5242
|
+
...normalizeParams(params)
|
|
5243
|
+
});
|
|
5244
|
+
}
|
|
5198
5245
|
const ZodUnion = /*@__PURE__*/ $constructor("ZodUnion", (inst, def) => {
|
|
5199
5246
|
$ZodUnion.init(inst, def);
|
|
5200
5247
|
ZodType.init(inst, def);
|
|
@@ -5567,6 +5614,12 @@ Object.defineProperty(exports, '_instanceof', {
|
|
|
5567
5614
|
return _instanceof;
|
|
5568
5615
|
}
|
|
5569
5616
|
});
|
|
5617
|
+
Object.defineProperty(exports, '_null', {
|
|
5618
|
+
enumerable: true,
|
|
5619
|
+
get: function () {
|
|
5620
|
+
return _null;
|
|
5621
|
+
}
|
|
5622
|
+
});
|
|
5570
5623
|
Object.defineProperty(exports, 'any', {
|
|
5571
5624
|
enumerable: true,
|
|
5572
5625
|
get: function () {
|
|
@@ -5657,6 +5710,12 @@ Object.defineProperty(exports, 'record', {
|
|
|
5657
5710
|
return record;
|
|
5658
5711
|
}
|
|
5659
5712
|
});
|
|
5713
|
+
Object.defineProperty(exports, 'strictObject', {
|
|
5714
|
+
enumerable: true,
|
|
5715
|
+
get: function () {
|
|
5716
|
+
return strictObject;
|
|
5717
|
+
}
|
|
5718
|
+
});
|
|
5660
5719
|
Object.defineProperty(exports, 'string', {
|
|
5661
5720
|
enumerable: true,
|
|
5662
5721
|
get: function () {
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
//#region src/policy/engine-enforcing.d.ts
|
|
2
|
+
declare function isEngineEnforcing(flags: {
|
|
3
|
+
engineEnforcementEnabled?: boolean | null;
|
|
4
|
+
enabled?: boolean | null;
|
|
5
|
+
}): boolean;
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/policy/fail-closed-response.d.ts
|
|
8
|
+
declare const FAIL_CLOSED_STATUS = 503;
|
|
9
|
+
declare const FAIL_CLOSED_BODY: {
|
|
10
|
+
readonly error: "Service temporarily unavailable";
|
|
11
|
+
readonly source: "checkpoint-middleware";
|
|
12
|
+
};
|
|
13
|
+
declare const FAIL_CLOSED_HEADERS: Readonly<Record<string, string>>;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/policy/legacy-carve-out.d.ts
|
|
16
|
+
declare const NO_EVIDENCE_CATEGORY = "no_evidence";
|
|
17
|
+
declare const NO_EVIDENCE_EXCLUSION_TERM = "principal.category != \"no_evidence\"";
|
|
18
|
+
declare const NO_EVIDENCE_EQUALITY_TERM = "principal.category == \"no_evidence\"";
|
|
19
|
+
declare function withNoEvidenceExclusion(cedar: string): string;
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/policy/cedar-principal-scope.d.ts
|
|
22
|
+
type ProbeClass = 'human' | typeof NO_EVIDENCE_CATEGORY;
|
|
23
|
+
interface CedarCondition {
|
|
24
|
+
kind: 'when' | 'unless';
|
|
25
|
+
body: string;
|
|
26
|
+
}
|
|
27
|
+
interface CedarStatement {
|
|
28
|
+
effect: 'forbid' | 'permit';
|
|
29
|
+
blockStart: number;
|
|
30
|
+
start: number;
|
|
31
|
+
end: number;
|
|
32
|
+
text: string;
|
|
33
|
+
scope: string;
|
|
34
|
+
conditions: CedarCondition[];
|
|
35
|
+
annotations: string;
|
|
36
|
+
}
|
|
37
|
+
interface Facts {
|
|
38
|
+
category: string;
|
|
39
|
+
path?: string;
|
|
40
|
+
discountNaming?: boolean;
|
|
41
|
+
}
|
|
42
|
+
declare function parseCedarStatements(cedar: string): CedarStatement[];
|
|
43
|
+
declare function statementApplies(statement: CedarStatement, facts: Facts): boolean;
|
|
44
|
+
declare function statementId(statement: CedarStatement): string | undefined;
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/policy/cedar-rule-match.d.ts
|
|
47
|
+
interface RequestFacts {
|
|
48
|
+
path?: string;
|
|
49
|
+
name?: string;
|
|
50
|
+
category?: string;
|
|
51
|
+
}
|
|
52
|
+
declare function pathLiteralsInBlock(block: string): string[];
|
|
53
|
+
declare function splitCedarBlocks(cedar: string): string[];
|
|
54
|
+
declare function blockEqualityLiterals(block: string, attr: string): string[];
|
|
55
|
+
declare function isForbidBlock(block: string): boolean;
|
|
56
|
+
declare function isUnnarrowedDenyBlock(block: string): boolean;
|
|
57
|
+
interface PolicyHazardAnalysis {
|
|
58
|
+
unnarrowedDenyFor(path: string, probe: ProbeClass): boolean;
|
|
59
|
+
explicitDenyFor(path: string, probe: ProbeClass): boolean;
|
|
60
|
+
humanHazard(path: string): boolean;
|
|
61
|
+
noEvidenceHazard(path: string): boolean;
|
|
62
|
+
noEvidenceNamed(path: string): boolean;
|
|
63
|
+
}
|
|
64
|
+
declare function analyzePolicySource(cedar: string): PolicyHazardAnalysis;
|
|
65
|
+
declare function pathHasUnnarrowedDenyRuleFor(cedar: string, path: string, probe: ProbeClass): boolean;
|
|
66
|
+
declare function pathHasExplicitDenyRuleFor(cedar: string, path: string, probe: ProbeClass): boolean;
|
|
67
|
+
declare function pathHasUnnarrowedDenyRule(cedar: string, path: string): boolean;
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/policy/required-scopes.d.ts
|
|
70
|
+
declare function requiredScopesForRequest(policySource: string | null | undefined, request?: RequestFacts): string[];
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region src/policy/decision-policy-id.d.ts
|
|
73
|
+
interface DecisionLike {
|
|
74
|
+
kind: string;
|
|
75
|
+
policyId?: string;
|
|
76
|
+
reason?: {
|
|
77
|
+
kind: string;
|
|
78
|
+
policyId?: string;
|
|
79
|
+
};
|
|
80
|
+
params?: {
|
|
81
|
+
policyId?: string;
|
|
82
|
+
};
|
|
83
|
+
target?: {
|
|
84
|
+
policyId?: string;
|
|
85
|
+
};
|
|
86
|
+
payload?: {
|
|
87
|
+
policyId?: string;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
declare function decisionPolicyId(decision: DecisionLike): string | undefined;
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/policy/approval-quorum.d.ts
|
|
93
|
+
interface ApprovalQuorum {
|
|
94
|
+
n: number;
|
|
95
|
+
approvers: string[];
|
|
96
|
+
}
|
|
97
|
+
declare function approvalQuorumForRequest(policySource: string | null | undefined, request?: RequestFacts): ApprovalQuorum | null;
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/policy/step-up.d.ts
|
|
100
|
+
interface StepUpQuorumLike {
|
|
101
|
+
n: number;
|
|
102
|
+
approvers: string[];
|
|
103
|
+
}
|
|
104
|
+
type InvalidStepUpReason = 'invalid_step_up_quorum' | 'step_up_no_approvers';
|
|
105
|
+
type StepUpQuorumCheck = {
|
|
106
|
+
ok: true;
|
|
107
|
+
} | {
|
|
108
|
+
ok: false;
|
|
109
|
+
reason: InvalidStepUpReason;
|
|
110
|
+
};
|
|
111
|
+
declare function validateStepUpQuorum(quorum: StepUpQuorumLike): StepUpQuorumCheck;
|
|
112
|
+
//#endregion
|
|
113
|
+
export { FAIL_CLOSED_HEADERS as A, statementApplies as C, NO_EVIDENCE_EXCLUSION_TERM as D, NO_EVIDENCE_EQUALITY_TERM as E, isEngineEnforcing as M, withNoEvidenceExclusion as O, parseCedarStatements as S, NO_EVIDENCE_CATEGORY as T, pathHasUnnarrowedDenyRule as _, ApprovalQuorum as a, splitCedarBlocks as b, decisionPolicyId as c, RequestFacts as d, analyzePolicySource as f, pathHasExplicitDenyRuleFor as g, isUnnarrowedDenyBlock as h, validateStepUpQuorum as i, FAIL_CLOSED_STATUS as j, FAIL_CLOSED_BODY as k, requiredScopesForRequest as l, isForbidBlock as m, StepUpQuorumCheck as n, approvalQuorumForRequest as o, blockEqualityLiterals as p, StepUpQuorumLike as r, DecisionLike as s, InvalidStepUpReason as t, PolicyHazardAnalysis as u, pathHasUnnarrowedDenyRuleFor as v, statementId as w, ProbeClass as x, pathLiteralsInBlock as y };
|
|
114
|
+
//# sourceMappingURL=step-up-BjP--hG-.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-up-BjP--hG-.d.mts","names":[],"sources":["../src/policy/engine-enforcing.ts","../src/policy/fail-closed-response.ts","../src/policy/legacy-carve-out.ts","../src/policy/cedar-principal-scope.ts","../src/policy/cedar-rule-match.ts","../src/policy/required-scopes.ts","../src/policy/decision-policy-id.ts","../src/policy/approval-quorum.ts","../src/policy/step-up.ts"],"mappings":";iBAOgB,kBAAkB;EAChC;EACA;;;;cCTW;cAIA;WAAA;WAAA;;cAKA,qBAAqB,SAAS;;;cCL9B;cACA;cACA;iBAiPG,wBAAwB;;;KCvO5B,8BAA8B;UAIzB;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA,YAAY;EACZ;;UAGQ;EACR;EACA;EACA;;iBA6Cc,qBAAqB,gBAAgB;iBA0HrC,iBAAiB,WAAW,gBAAgB,OAAO;iBA+BnD,YAAY,WAAW;;;UC/MtB;EACf;EAEA;EAEA;;iBAgDc,oBAAoB;iBAiEpB,iBAAiB;iBAWjB,sBAAsB,eAAe;iBA+CrC,cAAc;iBAKd,sBAAsB;UAIrB;EACf,kBAAkB,cAAc,OAAO;EACvC,gBAAgB,cAAc,OAAO;EACrC,YAAY;EACZ,iBAAiB;EACjB,gBAAgB;;iBAGF,oBAAoB,gBAAgB;iBAcpC,6BACd,eACA,cACA,OAAO;iBAKO,2BACd,eACA,cACA,OAAO;iBAKO,0BAA0B,eAAe;;;iBC/NzC,yBACd,yCACA,UAAU;;;UCXK;EACf;EACA;EACA;IAAW;IAAc;;EACzB;IAAW;;EACX;IAAW;;EACX;IAAY;;;iBAGE,iBAAiB,UAAU;;;UCQ1B;EAEf;EAEA;;iBAGc,yBACd,yCACA,UAAU,eACT;;;UCZc;EACf;EACA;;KAOU;KAGA;EAAsB;;EAAe;EAAW,QAAQ;;iBAWpD,qBAAqB,QAAQ,mBAAmB"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
//#region src/policy/engine-enforcing.d.ts
|
|
2
|
+
declare function isEngineEnforcing(flags: {
|
|
3
|
+
engineEnforcementEnabled?: boolean | null;
|
|
4
|
+
enabled?: boolean | null;
|
|
5
|
+
}): boolean;
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/policy/fail-closed-response.d.ts
|
|
8
|
+
declare const FAIL_CLOSED_STATUS = 503;
|
|
9
|
+
declare const FAIL_CLOSED_BODY: {
|
|
10
|
+
readonly error: "Service temporarily unavailable";
|
|
11
|
+
readonly source: "checkpoint-middleware";
|
|
12
|
+
};
|
|
13
|
+
declare const FAIL_CLOSED_HEADERS: Readonly<Record<string, string>>;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/policy/legacy-carve-out.d.ts
|
|
16
|
+
declare const NO_EVIDENCE_CATEGORY = "no_evidence";
|
|
17
|
+
declare const NO_EVIDENCE_EXCLUSION_TERM = "principal.category != \"no_evidence\"";
|
|
18
|
+
declare const NO_EVIDENCE_EQUALITY_TERM = "principal.category == \"no_evidence\"";
|
|
19
|
+
declare function withNoEvidenceExclusion(cedar: string): string;
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/policy/cedar-principal-scope.d.ts
|
|
22
|
+
type ProbeClass = 'human' | typeof NO_EVIDENCE_CATEGORY;
|
|
23
|
+
interface CedarCondition {
|
|
24
|
+
kind: 'when' | 'unless';
|
|
25
|
+
body: string;
|
|
26
|
+
}
|
|
27
|
+
interface CedarStatement {
|
|
28
|
+
effect: 'forbid' | 'permit';
|
|
29
|
+
blockStart: number;
|
|
30
|
+
start: number;
|
|
31
|
+
end: number;
|
|
32
|
+
text: string;
|
|
33
|
+
scope: string;
|
|
34
|
+
conditions: CedarCondition[];
|
|
35
|
+
annotations: string;
|
|
36
|
+
}
|
|
37
|
+
interface Facts {
|
|
38
|
+
category: string;
|
|
39
|
+
path?: string;
|
|
40
|
+
discountNaming?: boolean;
|
|
41
|
+
}
|
|
42
|
+
declare function parseCedarStatements(cedar: string): CedarStatement[];
|
|
43
|
+
declare function statementApplies(statement: CedarStatement, facts: Facts): boolean;
|
|
44
|
+
declare function statementId(statement: CedarStatement): string | undefined;
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/policy/cedar-rule-match.d.ts
|
|
47
|
+
interface RequestFacts {
|
|
48
|
+
path?: string;
|
|
49
|
+
name?: string;
|
|
50
|
+
category?: string;
|
|
51
|
+
}
|
|
52
|
+
declare function pathLiteralsInBlock(block: string): string[];
|
|
53
|
+
declare function splitCedarBlocks(cedar: string): string[];
|
|
54
|
+
declare function blockEqualityLiterals(block: string, attr: string): string[];
|
|
55
|
+
declare function isForbidBlock(block: string): boolean;
|
|
56
|
+
declare function isUnnarrowedDenyBlock(block: string): boolean;
|
|
57
|
+
interface PolicyHazardAnalysis {
|
|
58
|
+
unnarrowedDenyFor(path: string, probe: ProbeClass): boolean;
|
|
59
|
+
explicitDenyFor(path: string, probe: ProbeClass): boolean;
|
|
60
|
+
humanHazard(path: string): boolean;
|
|
61
|
+
noEvidenceHazard(path: string): boolean;
|
|
62
|
+
noEvidenceNamed(path: string): boolean;
|
|
63
|
+
}
|
|
64
|
+
declare function analyzePolicySource(cedar: string): PolicyHazardAnalysis;
|
|
65
|
+
declare function pathHasUnnarrowedDenyRuleFor(cedar: string, path: string, probe: ProbeClass): boolean;
|
|
66
|
+
declare function pathHasExplicitDenyRuleFor(cedar: string, path: string, probe: ProbeClass): boolean;
|
|
67
|
+
declare function pathHasUnnarrowedDenyRule(cedar: string, path: string): boolean;
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/policy/required-scopes.d.ts
|
|
70
|
+
declare function requiredScopesForRequest(policySource: string | null | undefined, request?: RequestFacts): string[];
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region src/policy/decision-policy-id.d.ts
|
|
73
|
+
interface DecisionLike {
|
|
74
|
+
kind: string;
|
|
75
|
+
policyId?: string;
|
|
76
|
+
reason?: {
|
|
77
|
+
kind: string;
|
|
78
|
+
policyId?: string;
|
|
79
|
+
};
|
|
80
|
+
params?: {
|
|
81
|
+
policyId?: string;
|
|
82
|
+
};
|
|
83
|
+
target?: {
|
|
84
|
+
policyId?: string;
|
|
85
|
+
};
|
|
86
|
+
payload?: {
|
|
87
|
+
policyId?: string;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
declare function decisionPolicyId(decision: DecisionLike): string | undefined;
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/policy/approval-quorum.d.ts
|
|
93
|
+
interface ApprovalQuorum {
|
|
94
|
+
n: number;
|
|
95
|
+
approvers: string[];
|
|
96
|
+
}
|
|
97
|
+
declare function approvalQuorumForRequest(policySource: string | null | undefined, request?: RequestFacts): ApprovalQuorum | null;
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/policy/step-up.d.ts
|
|
100
|
+
interface StepUpQuorumLike {
|
|
101
|
+
n: number;
|
|
102
|
+
approvers: string[];
|
|
103
|
+
}
|
|
104
|
+
type InvalidStepUpReason = 'invalid_step_up_quorum' | 'step_up_no_approvers';
|
|
105
|
+
type StepUpQuorumCheck = {
|
|
106
|
+
ok: true;
|
|
107
|
+
} | {
|
|
108
|
+
ok: false;
|
|
109
|
+
reason: InvalidStepUpReason;
|
|
110
|
+
};
|
|
111
|
+
declare function validateStepUpQuorum(quorum: StepUpQuorumLike): StepUpQuorumCheck;
|
|
112
|
+
//#endregion
|
|
113
|
+
export { FAIL_CLOSED_HEADERS as A, statementApplies as C, NO_EVIDENCE_EXCLUSION_TERM as D, NO_EVIDENCE_EQUALITY_TERM as E, isEngineEnforcing as M, withNoEvidenceExclusion as O, parseCedarStatements as S, NO_EVIDENCE_CATEGORY as T, pathHasUnnarrowedDenyRule as _, ApprovalQuorum as a, splitCedarBlocks as b, decisionPolicyId as c, RequestFacts as d, analyzePolicySource as f, pathHasExplicitDenyRuleFor as g, isUnnarrowedDenyBlock as h, validateStepUpQuorum as i, FAIL_CLOSED_STATUS as j, FAIL_CLOSED_BODY as k, requiredScopesForRequest as l, isForbidBlock as m, StepUpQuorumCheck as n, approvalQuorumForRequest as o, blockEqualityLiterals as p, StepUpQuorumLike as r, DecisionLike as s, InvalidStepUpReason as t, PolicyHazardAnalysis as u, pathHasUnnarrowedDenyRuleFor as v, statementId as w, ProbeClass as x, pathLiteralsInBlock as y };
|
|
114
|
+
//# sourceMappingURL=step-up-BjP--hG-.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-up-BjP--hG-.d.ts","names":[],"sources":["../src/policy/engine-enforcing.ts","../src/policy/fail-closed-response.ts","../src/policy/legacy-carve-out.ts","../src/policy/cedar-principal-scope.ts","../src/policy/cedar-rule-match.ts","../src/policy/required-scopes.ts","../src/policy/decision-policy-id.ts","../src/policy/approval-quorum.ts","../src/policy/step-up.ts"],"mappings":";iBAOgB,kBAAkB;EAChC;EACA;;;;cCTW;cAIA;WAAA;WAAA;;cAKA,qBAAqB,SAAS;;;cCL9B;cACA;cACA;iBAiPG,wBAAwB;;;KCvO5B,8BAA8B;UAIzB;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA,YAAY;EACZ;;UAGQ;EACR;EACA;EACA;;iBA6Cc,qBAAqB,gBAAgB;iBA0HrC,iBAAiB,WAAW,gBAAgB,OAAO;iBA+BnD,YAAY,WAAW;;;UC/MtB;EACf;EAEA;EAEA;;iBAgDc,oBAAoB;iBAiEpB,iBAAiB;iBAWjB,sBAAsB,eAAe;iBA+CrC,cAAc;iBAKd,sBAAsB;UAIrB;EACf,kBAAkB,cAAc,OAAO;EACvC,gBAAgB,cAAc,OAAO;EACrC,YAAY;EACZ,iBAAiB;EACjB,gBAAgB;;iBAGF,oBAAoB,gBAAgB;iBAcpC,6BACd,eACA,cACA,OAAO;iBAKO,2BACd,eACA,cACA,OAAO;iBAKO,0BAA0B,eAAe;;;iBC/NzC,yBACd,yCACA,UAAU;;;UCXK;EACf;EACA;EACA;IAAW;IAAc;;EACzB;IAAW;;EACX;IAAW;;EACX;IAAY;;;iBAGE,iBAAiB,UAAU;;;UCQ1B;EAEf;EAEA;;iBAGc,yBACd,yCACA,UAAU,eACT;;;UCZc;EACf;EACA;;KAOU;KAGA;EAAsB;;EAAe;EAAW,QAAQ;;iBAWpD,qBAAqB,QAAQ,mBAAmB"}
|