@highflame/policy 1.1.3

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.
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Context attribute keys for Cedar policy evaluation.
3
+ */
4
+ export declare const ContextKey: {
5
+ /** Name of tool being called */
6
+ readonly ToolName: "tool_name";
7
+ /** Name of resource being accessed */
8
+ readonly ResourceName: "resource_name";
9
+ /** Name of prompt */
10
+ readonly PromptName: "prompt_name";
11
+ /** Raw prompt text */
12
+ readonly PromptText: "prompt_text";
13
+ /** Response size in megabytes */
14
+ readonly ResponseSizeMb: "response_size_mb";
15
+ /** Set of detected YARA threat names */
16
+ readonly YaraThreats: "yara_threats";
17
+ /** Number of threats detected */
18
+ readonly ThreatCount: "threat_count";
19
+ /** Highest severity (0-4) */
20
+ readonly MaxThreatSeverity: "max_threat_severity";
21
+ /** User type: external or internal */
22
+ readonly UserType: "user_type";
23
+ /** Whether monitoring is active */
24
+ readonly MonitoringEnabled: "monitoring_enabled";
25
+ /** File path */
26
+ readonly Path: "path";
27
+ /** HTTP hostname */
28
+ readonly Hostname: "hostname";
29
+ /** IP address */
30
+ readonly IpAddress: "ip_address";
31
+ /** Whether the IP is private/loopback (set by application layer) */
32
+ readonly IsPrivateIp: "is_private_ip";
33
+ /** HTTP scheme */
34
+ readonly Scheme: "scheme";
35
+ /** Port number */
36
+ readonly Port: "port";
37
+ /** Environment: production, development, research */
38
+ readonly Environment: "environment";
39
+ /** Format: pickle, safetensors, gguf, onnx */
40
+ readonly ArtifactFormat: "artifact_format";
41
+ /** Whether artifact has signature */
42
+ readonly ArtifactSigned: "artifact_signed";
43
+ /** Severity: CRITICAL, HIGH, MEDIUM, LOW, INFO */
44
+ readonly Severity: "severity";
45
+ /** Type of security finding */
46
+ readonly FindingType: "finding_type";
47
+ /** Who signed the artifact */
48
+ readonly ProvenanceSigner: "provenance_signer";
49
+ /** RCE path found in pickle */
50
+ readonly PickleExecPathDetected: "pickle_exec_path_detected";
51
+ /** Malicious pattern in metadata */
52
+ readonly MetadataMaliciousPattern: "metadata_malicious_pattern";
53
+ /** Number of added tokens */
54
+ readonly TokenizerAddedTokensCount: "tokenizer_added_tokens_count";
55
+ /** Safetensors integrity failed */
56
+ readonly SafetensorsIntegrityViolation: "safetensors_integrity_violation";
57
+ /** Suspicious GGUF metadata */
58
+ readonly GgufSuspiciousMetadata: "gguf_suspicious_metadata";
59
+ /** LoRA adapter digest mismatch */
60
+ readonly AdapterBaseDigestMismatch: "adapter_base_digest_mismatch";
61
+ /** CoSAI maturity level (0-5) */
62
+ readonly MetadataCosaiLevelNumeric: "metadata_cosai_level_numeric";
63
+ /** IDE source: cursor, claudecode, vscode, geminicli */
64
+ readonly Source: "source";
65
+ /** Hook event type: beforeShellExecution, PreToolUse, etc. */
66
+ readonly Event: "event";
67
+ /** The prompt/request content being evaluated */
68
+ readonly Content: "content";
69
+ /** User's email address (or 'anonymous') */
70
+ readonly UserEmail: "user_email";
71
+ /** Custom principal ID for policy evaluation */
72
+ readonly CedarPrincipal: "cedar_principal";
73
+ /** MCP server name: filesystem, playwright, etc. */
74
+ readonly ServerName: "server_name";
75
+ /** Whether the path is within the workspace */
76
+ readonly IsWithinWorkspace: "is_within_workspace";
77
+ /** Response content from tool execution */
78
+ readonly ResponseContent: "response_content";
79
+ /** Highest severity level: critical, high, medium, low */
80
+ readonly HighestSeverity: "highest_severity";
81
+ /** Array of threat types detected */
82
+ readonly ThreatTypes: "threat_types";
83
+ /** Array of threat categories found */
84
+ readonly ThreatCategories: "threat_categories";
85
+ /** Whether secrets were detected in the content */
86
+ readonly ContainsSecrets: "contains_secrets";
87
+ /** Number of concurrent calls */
88
+ readonly ConcurrentCalls: "concurrent_calls";
89
+ /** Request rate per minute */
90
+ readonly RequestsPerMinute: "requests_per_minute";
91
+ /** User trust level: high, medium, low */
92
+ readonly UserTrustLevel: "user_trust_level";
93
+ /** Whether alerting is enabled for this request */
94
+ readonly AlertEnabled: "alert_enabled";
95
+ /** Type of security scan being performed */
96
+ readonly ScanType: "scan_type";
97
+ };
98
+ export type ContextKey = (typeof ContextKey)[keyof typeof ContextKey];
99
+ //# sourceMappingURL=context.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.gen.d.ts","sourceRoot":"","sources":["../src/context.gen.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,UAAU;IAEnB,gCAAgC;;IAEhC,sCAAsC;;IAEtC,qBAAqB;;IAErB,sBAAsB;;IAEtB,iCAAiC;;IAEjC,wCAAwC;;IAExC,iCAAiC;;IAEjC,6BAA6B;;IAE7B,sCAAsC;;IAEtC,mCAAmC;;IAEnC,gBAAgB;;IAEhB,oBAAoB;;IAEpB,iBAAiB;;IAEjB,oEAAoE;;IAEpE,kBAAkB;;IAElB,kBAAkB;;IAIlB,qDAAqD;;IAErD,8CAA8C;;IAE9C,qCAAqC;;IAErC,kDAAkD;;IAElD,+BAA+B;;IAE/B,8BAA8B;;IAE9B,+BAA+B;;IAE/B,oCAAoC;;IAEpC,6BAA6B;;IAE7B,mCAAmC;;IAEnC,+BAA+B;;IAE/B,mCAAmC;;IAEnC,iCAAiC;;IAIjC,wDAAwD;;IAExD,8DAA8D;;IAE9D,iDAAiD;;IAEjD,4CAA4C;;IAE5C,gDAAgD;;IAEhD,oDAAoD;;IAEpD,+CAA+C;;IAE/C,2CAA2C;;IAE3C,0DAA0D;;IAE1D,qCAAqC;;IAErC,uCAAuC;;IAEvC,mDAAmD;;IAEnD,iCAAiC;;IAEjC,8BAA8B;;IAE9B,0CAA0C;;IAE1C,mDAAmD;;IAEnD,4CAA4C;;CAEtC,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC"}
@@ -0,0 +1,103 @@
1
+ // Code generated by highflame-policy-codegen. DO NOT EDIT.
2
+ // Source: schema/context.yaml
3
+ /**
4
+ * Context attribute keys for Cedar policy evaluation.
5
+ */
6
+ export const ContextKey = {
7
+ // Guardrails/Core context attributes
8
+ /** Name of tool being called */
9
+ ToolName: 'tool_name',
10
+ /** Name of resource being accessed */
11
+ ResourceName: 'resource_name',
12
+ /** Name of prompt */
13
+ PromptName: 'prompt_name',
14
+ /** Raw prompt text */
15
+ PromptText: 'prompt_text',
16
+ /** Response size in megabytes */
17
+ ResponseSizeMb: 'response_size_mb',
18
+ /** Set of detected YARA threat names */
19
+ YaraThreats: 'yara_threats',
20
+ /** Number of threats detected */
21
+ ThreatCount: 'threat_count',
22
+ /** Highest severity (0-4) */
23
+ MaxThreatSeverity: 'max_threat_severity',
24
+ /** User type: external or internal */
25
+ UserType: 'user_type',
26
+ /** Whether monitoring is active */
27
+ MonitoringEnabled: 'monitoring_enabled',
28
+ /** File path */
29
+ Path: 'path',
30
+ /** HTTP hostname */
31
+ Hostname: 'hostname',
32
+ /** IP address */
33
+ IpAddress: 'ip_address',
34
+ /** Whether the IP is private/loopback (set by application layer) */
35
+ IsPrivateIp: 'is_private_ip',
36
+ /** HTTP scheme */
37
+ Scheme: 'scheme',
38
+ /** Port number */
39
+ Port: 'port',
40
+ // Palisade context attributes
41
+ /** Environment: production, development, research */
42
+ Environment: 'environment',
43
+ /** Format: pickle, safetensors, gguf, onnx */
44
+ ArtifactFormat: 'artifact_format',
45
+ /** Whether artifact has signature */
46
+ ArtifactSigned: 'artifact_signed',
47
+ /** Severity: CRITICAL, HIGH, MEDIUM, LOW, INFO */
48
+ Severity: 'severity',
49
+ /** Type of security finding */
50
+ FindingType: 'finding_type',
51
+ /** Who signed the artifact */
52
+ ProvenanceSigner: 'provenance_signer',
53
+ /** RCE path found in pickle */
54
+ PickleExecPathDetected: 'pickle_exec_path_detected',
55
+ /** Malicious pattern in metadata */
56
+ MetadataMaliciousPattern: 'metadata_malicious_pattern',
57
+ /** Number of added tokens */
58
+ TokenizerAddedTokensCount: 'tokenizer_added_tokens_count',
59
+ /** Safetensors integrity failed */
60
+ SafetensorsIntegrityViolation: 'safetensors_integrity_violation',
61
+ /** Suspicious GGUF metadata */
62
+ GgufSuspiciousMetadata: 'gguf_suspicious_metadata',
63
+ /** LoRA adapter digest mismatch */
64
+ AdapterBaseDigestMismatch: 'adapter_base_digest_mismatch',
65
+ /** CoSAI maturity level (0-5) */
66
+ MetadataCosaiLevelNumeric: 'metadata_cosai_level_numeric',
67
+ // Overwatch context attributes
68
+ /** IDE source: cursor, claudecode, vscode, geminicli */
69
+ Source: 'source',
70
+ /** Hook event type: beforeShellExecution, PreToolUse, etc. */
71
+ Event: 'event',
72
+ /** The prompt/request content being evaluated */
73
+ Content: 'content',
74
+ /** User's email address (or 'anonymous') */
75
+ UserEmail: 'user_email',
76
+ /** Custom principal ID for policy evaluation */
77
+ CedarPrincipal: 'cedar_principal',
78
+ /** MCP server name: filesystem, playwright, etc. */
79
+ ServerName: 'server_name',
80
+ /** Whether the path is within the workspace */
81
+ IsWithinWorkspace: 'is_within_workspace',
82
+ /** Response content from tool execution */
83
+ ResponseContent: 'response_content',
84
+ /** Highest severity level: critical, high, medium, low */
85
+ HighestSeverity: 'highest_severity',
86
+ /** Array of threat types detected */
87
+ ThreatTypes: 'threat_types',
88
+ /** Array of threat categories found */
89
+ ThreatCategories: 'threat_categories',
90
+ /** Whether secrets were detected in the content */
91
+ ContainsSecrets: 'contains_secrets',
92
+ /** Number of concurrent calls */
93
+ ConcurrentCalls: 'concurrent_calls',
94
+ /** Request rate per minute */
95
+ RequestsPerMinute: 'requests_per_minute',
96
+ /** User trust level: high, medium, low */
97
+ UserTrustLevel: 'user_trust_level',
98
+ /** Whether alerting is enabled for this request */
99
+ AlertEnabled: 'alert_enabled',
100
+ /** Type of security scan being performed */
101
+ ScanType: 'scan_type',
102
+ };
103
+ //# sourceMappingURL=context.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.gen.js","sourceRoot":"","sources":["../src/context.gen.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,8BA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8B;IACzD,iCAAiC;IACjC,yBAAyB,EAAE,8BAA8B;IAEzD,+BAA+B;IAC/B,wDAAwD;IACxD,MAAM,EAAE,QAAQ;IAChB,8DAA8D;IAC9D,KAAK,EAAE,OAAO;IACd,iDAAiD;IACjD,OAAO,EAAE,SAAS;IAClB,4CAA4C;IAC5C,SAAS,EAAE,YAAY;IACvB,gDAAgD;IAChD,cAAc,EAAE,iBAAiB;IACjC,oDAAoD;IACpD,UAAU,EAAE,aAAa;IACzB,+CAA+C;IAC/C,iBAAiB,EAAE,qBAAqB;IACxC,2CAA2C;IAC3C,eAAe,EAAE,kBAAkB;IACnC,0DAA0D;IAC1D,eAAe,EAAE,kBAAkB;IACnC,qCAAqC;IACrC,WAAW,EAAE,cAAc;IAC3B,uCAAuC;IACvC,gBAAgB,EAAE,mBAAmB;IACrC,mDAAmD;IACnD,eAAe,EAAE,kBAAkB;IACnC,iCAAiC;IACjC,eAAe,EAAE,kBAAkB;IACnC,8BAA8B;IAC9B,iBAAiB,EAAE,qBAAqB;IACxC,0CAA0C;IAC1C,cAAc,EAAE,kBAAkB;IAClC,mDAAmD;IACnD,YAAY,EAAE,eAAe;IAC7B,4CAA4C;IAC5C,QAAQ,EAAE,WAAW;CACf,CAAC"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Highflame Policy Engine - TypeScript Wrapper
3
+ * Wraps @cedar-policy/cedar-wasm with Highflame-specific types
4
+ */
5
+ import { EntityType, EntityUID } from "./entities.gen.js";
6
+ import { ActionType } from "./actions.gen.js";
7
+ export interface Decision {
8
+ effect: "Allow" | "Deny";
9
+ determining_policies: string[];
10
+ reason?: string;
11
+ }
12
+ export interface EvaluateRequest {
13
+ principal: EntityUID;
14
+ action: ActionType;
15
+ resource: EntityUID;
16
+ context?: Record<string, unknown>;
17
+ }
18
+ /**
19
+ * PolicyEngine wraps cedar-wasm with Highflame schema types.
20
+ */
21
+ export declare class PolicyEngine {
22
+ private policies;
23
+ private schema;
24
+ /**
25
+ * Load policies from a Cedar policy string.
26
+ */
27
+ loadPolicies(policies: string): void;
28
+ /**
29
+ * Load schema from a Cedar schema string.
30
+ * If not called, uses the embedded Highflame schema.
31
+ */
32
+ loadSchema(schema: string): void;
33
+ /**
34
+ * Load the embedded Highflame schema.
35
+ */
36
+ loadHighflameSchema(): void;
37
+ /**
38
+ * Evaluate a policy request and return a decision.
39
+ */
40
+ evaluate(req: EvaluateRequest): Decision;
41
+ /**
42
+ * Convenience method for simple evaluations.
43
+ */
44
+ evaluateSimple(principalType: EntityType, principalId: string, action: ActionType, resourceType: EntityType, resourceId: string, context?: Record<string, unknown>): Decision;
45
+ /**
46
+ * Validate policies against the schema.
47
+ * Returns validation errors or empty array if valid.
48
+ */
49
+ validatePolicies(policies: string): string[];
50
+ }
51
+ /**
52
+ * PolicyValidator provides static validation against the Highflame schema.
53
+ * Use this for quick validation without creating an engine instance.
54
+ */
55
+ export declare class PolicyValidator {
56
+ private schema;
57
+ /**
58
+ * Create a validator with the embedded Highflame schema.
59
+ */
60
+ constructor(schema?: string);
61
+ /**
62
+ * Validate Cedar policy text against the schema.
63
+ */
64
+ validate(policies: string): {
65
+ valid: boolean;
66
+ errors: string[];
67
+ };
68
+ /**
69
+ * Check if a policy parses correctly (syntax check only).
70
+ */
71
+ checkSyntax(policies: string): {
72
+ valid: boolean;
73
+ errors: string[];
74
+ };
75
+ }
76
+ /**
77
+ * Validate a Cedar policy against the Highflame schema.
78
+ * Convenience function that doesn't require creating a validator instance.
79
+ */
80
+ export declare function validatePolicy(policy: string): {
81
+ valid: boolean;
82
+ errors: string[];
83
+ };
84
+ /**
85
+ * Get the embedded Highflame Cedar schema.
86
+ */
87
+ export declare function getHighflameSchema(): string;
88
+ export { EntityType, EntityUID, Entity, newEntityUID, newEntity } from "./entities.gen.js";
89
+ export { ActionType, actionUID } from "./actions.gen.js";
90
+ export * from "./context.gen.js";
91
+ export { CEDAR_SCHEMA } from "./schema.gen.js";
92
+ //# sourceMappingURL=engine.d.ts.map
@@ -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EvB;;OAEG;gBACS,MAAM,CAAC,EAAE,MAAM;IAI3B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE;IAwBhE;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE;CAUpE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAGnF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAGD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACzD,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
package/dist/engine.js ADDED
@@ -0,0 +1,203 @@
1
+ /**
2
+ * Highflame Policy Engine - TypeScript Wrapper
3
+ * Wraps @cedar-policy/cedar-wasm with Highflame-specific types
4
+ */
5
+ import * as cedar from "@cedar-policy/cedar-wasm/nodejs";
6
+ import { CEDAR_SCHEMA } from "./schema.gen.js";
7
+ /**
8
+ * Convert a value to Cedar JSON format
9
+ */
10
+ function toCedarValue(value) {
11
+ if (value === null || value === undefined) {
12
+ return null;
13
+ }
14
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
15
+ return value;
16
+ }
17
+ if (Array.isArray(value)) {
18
+ return value.map(toCedarValue);
19
+ }
20
+ if (typeof value === "object") {
21
+ const result = {};
22
+ for (const [k, v] of Object.entries(value)) {
23
+ result[k] = toCedarValue(v);
24
+ }
25
+ return result;
26
+ }
27
+ return String(value);
28
+ }
29
+ /**
30
+ * PolicyEngine wraps cedar-wasm with Highflame schema types.
31
+ */
32
+ export class PolicyEngine {
33
+ policies = "";
34
+ schema;
35
+ /**
36
+ * Load policies from a Cedar policy string.
37
+ */
38
+ loadPolicies(policies) {
39
+ this.policies = policies;
40
+ }
41
+ /**
42
+ * Load schema from a Cedar schema string.
43
+ * If not called, uses the embedded Highflame schema.
44
+ */
45
+ loadSchema(schema) {
46
+ this.schema = schema;
47
+ }
48
+ /**
49
+ * Load the embedded Highflame schema.
50
+ */
51
+ loadHighflameSchema() {
52
+ this.schema = CEDAR_SCHEMA;
53
+ }
54
+ /**
55
+ * Evaluate a policy request and return a decision.
56
+ */
57
+ evaluate(req) {
58
+ // Build EntityUIDs in Cedar JSON format
59
+ const principal = {
60
+ type: req.principal.type,
61
+ id: req.principal.id,
62
+ };
63
+ const action = {
64
+ type: "Action",
65
+ id: req.action,
66
+ };
67
+ const resource = {
68
+ type: req.resource.type,
69
+ id: req.resource.id,
70
+ };
71
+ // Convert context to Cedar format
72
+ const context = {};
73
+ if (req.context) {
74
+ for (const [k, v] of Object.entries(req.context)) {
75
+ context[k] = toCedarValue(v);
76
+ }
77
+ }
78
+ // Build the authorization call
79
+ const call = {
80
+ principal,
81
+ action,
82
+ resource,
83
+ context,
84
+ policies: { staticPolicies: this.policies },
85
+ entities: [],
86
+ };
87
+ // Add schema if available
88
+ if (this.schema) {
89
+ call.schema = this.schema;
90
+ }
91
+ const result = cedar.isAuthorized(call);
92
+ if (result.type === "failure") {
93
+ return {
94
+ effect: "Deny",
95
+ determining_policies: [],
96
+ reason: result.errors.map(e => e.message).join("; "),
97
+ };
98
+ }
99
+ return {
100
+ effect: result.response.decision === "allow" ? "Allow" : "Deny",
101
+ determining_policies: result.response.diagnostics.reason,
102
+ reason: result.response.diagnostics.errors.length > 0
103
+ ? result.response.diagnostics.errors.map(e => e.error.message).join("; ")
104
+ : undefined,
105
+ };
106
+ }
107
+ /**
108
+ * Convenience method for simple evaluations.
109
+ */
110
+ evaluateSimple(principalType, principalId, action, resourceType, resourceId, context) {
111
+ return this.evaluate({
112
+ principal: { type: principalType, id: principalId },
113
+ action,
114
+ resource: { type: resourceType, id: resourceId },
115
+ context,
116
+ });
117
+ }
118
+ /**
119
+ * Validate policies against the schema.
120
+ * Returns validation errors or empty array if valid.
121
+ */
122
+ validatePolicies(policies) {
123
+ const schemaToUse = this.schema ?? CEDAR_SCHEMA;
124
+ const result = cedar.validate({
125
+ validationSettings: { mode: "strict" },
126
+ schema: schemaToUse,
127
+ policies: { staticPolicies: policies },
128
+ });
129
+ if (result.type === "failure") {
130
+ return result.errors.map(e => e.message);
131
+ }
132
+ return result.validationErrors.map(e => e.error.message);
133
+ }
134
+ }
135
+ /**
136
+ * PolicyValidator provides static validation against the Highflame schema.
137
+ * Use this for quick validation without creating an engine instance.
138
+ */
139
+ export class PolicyValidator {
140
+ schema;
141
+ /**
142
+ * Create a validator with the embedded Highflame schema.
143
+ */
144
+ constructor(schema) {
145
+ this.schema = schema ?? CEDAR_SCHEMA;
146
+ }
147
+ /**
148
+ * Validate Cedar policy text against the schema.
149
+ */
150
+ validate(policies) {
151
+ const result = cedar.validate({
152
+ validationSettings: { mode: "strict" },
153
+ schema: this.schema,
154
+ policies: { staticPolicies: policies },
155
+ });
156
+ if (result.type === "failure") {
157
+ return {
158
+ valid: false,
159
+ errors: result.errors.map(e => e.message),
160
+ };
161
+ }
162
+ if (result.validationErrors.length > 0) {
163
+ return {
164
+ valid: false,
165
+ errors: result.validationErrors.map(e => e.error.message),
166
+ };
167
+ }
168
+ return { valid: true, errors: [] };
169
+ }
170
+ /**
171
+ * Check if a policy parses correctly (syntax check only).
172
+ */
173
+ checkSyntax(policies) {
174
+ const result = cedar.checkParsePolicySet({ staticPolicies: policies });
175
+ if (result.type === "failure") {
176
+ return {
177
+ valid: false,
178
+ errors: result.errors.map(e => e.message),
179
+ };
180
+ }
181
+ return { valid: true, errors: [] };
182
+ }
183
+ }
184
+ /**
185
+ * Validate a Cedar policy against the Highflame schema.
186
+ * Convenience function that doesn't require creating a validator instance.
187
+ */
188
+ export function validatePolicy(policy) {
189
+ const validator = new PolicyValidator();
190
+ return validator.validate(policy);
191
+ }
192
+ /**
193
+ * Get the embedded Highflame Cedar schema.
194
+ */
195
+ export function getHighflameSchema() {
196
+ return CEDAR_SCHEMA;
197
+ }
198
+ // Re-export types
199
+ export { EntityType, newEntityUID, newEntity } from "./entities.gen.js";
200
+ export { ActionType, actionUID } from "./actions.gen.js";
201
+ export * from "./context.gen.js";
202
+ export { CEDAR_SCHEMA } from "./schema.gen.js";
203
+ //# sourceMappingURL=engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,iCAAiC,CAAC;AAGzD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAe/C;;GAEG;AACH,SAAS,YAAY,CAAC,KAAc;IAClC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QACzF,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACjC,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAyC,EAAE,CAAC;QACxD,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CA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C;AACtB,CAAC;AAED,kBAAkB;AAClB,OAAO,EAAE,UAAU,EAAqB,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACzD,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Entity types defined in the Highflame Cedar schema.
3
+ */
4
+ export declare const EntityType: {
5
+ readonly Agent: "Agent";
6
+ readonly Artifact: "Artifact";
7
+ readonly FilePath: "FilePath";
8
+ readonly HttpEndpoint: "HttpEndpoint";
9
+ readonly Package: "Package";
10
+ readonly Repository: "Repository";
11
+ readonly Resource: "Resource";
12
+ readonly ResponseData: "ResponseData";
13
+ readonly Scanner: "Scanner";
14
+ readonly Server: "Server";
15
+ readonly Service: "Service";
16
+ readonly Tool: "Tool";
17
+ readonly User: "User";
18
+ };
19
+ export type EntityType = (typeof EntityType)[keyof typeof EntityType];
20
+ /**
21
+ * Cedar entity unique identifier.
22
+ */
23
+ export interface EntityUID {
24
+ type: EntityType | string;
25
+ id: string;
26
+ }
27
+ /**
28
+ * Cedar entity with attributes.
29
+ */
30
+ export interface Entity {
31
+ uid: EntityUID;
32
+ attrs?: Record<string, unknown>;
33
+ parents?: EntityUID[];
34
+ }
35
+ /**
36
+ * Create a new EntityUID.
37
+ * Services should use this with their own identity from config/environment.
38
+ * @example newEntityUID(EntityType.Scanner, process.env.SERVICE_ID)
39
+ */
40
+ export declare function newEntityUID(type: EntityType | string, id: string): EntityUID;
41
+ /**
42
+ * Create a new Entity.
43
+ */
44
+ export declare function newEntity(type: EntityType | string, id: string, attrs?: Record<string, unknown>): Entity;
45
+ //# sourceMappingURL=entities.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entities.gen.d.ts","sourceRoot":"","sources":["../src/entities.gen.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;CAcb,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC;IAC1B,EAAE,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACnB,GAAG,EAAE,SAAS,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,CAE7E;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAMxG"}
@@ -0,0 +1,39 @@
1
+ // Code generated by highflame-policy-codegen. DO NOT EDIT.
2
+ // Source: schema/highflame.cedarschema
3
+ /**
4
+ * Entity types defined in the Highflame Cedar schema.
5
+ */
6
+ export const EntityType = {
7
+ Agent: 'Agent',
8
+ Artifact: 'Artifact',
9
+ FilePath: 'FilePath',
10
+ HttpEndpoint: 'HttpEndpoint',
11
+ Package: 'Package',
12
+ Repository: 'Repository',
13
+ Resource: 'Resource',
14
+ ResponseData: 'ResponseData',
15
+ Scanner: 'Scanner',
16
+ Server: 'Server',
17
+ Service: 'Service',
18
+ Tool: 'Tool',
19
+ User: 'User',
20
+ };
21
+ /**
22
+ * Create a new EntityUID.
23
+ * Services should use this with their own identity from config/environment.
24
+ * @example newEntityUID(EntityType.Scanner, process.env.SERVICE_ID)
25
+ */
26
+ export function newEntityUID(type, id) {
27
+ return { type, id };
28
+ }
29
+ /**
30
+ * Create a new Entity.
31
+ */
32
+ export function newEntity(type, id, attrs) {
33
+ return {
34
+ uid: { type, id },
35
+ attrs: attrs ?? {},
36
+ parents: [],
37
+ };
38
+ }
39
+ //# sourceMappingURL=entities.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entities.gen.js","sourceRoot":"","sources":["../src/entities.gen.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,uCAAuC;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,cAAc;IAC5B,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,cAAc;IAC5B,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;CACN,CAAC;AAqBX;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,IAAyB,EAAE,EAAU;IAC9D,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,IAAyB,EAAE,EAAU,EAAE,KAA+B;IAC5F,OAAO;QACH,GAAG,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACjB,KAAK,EAAE,KAAK,IAAI,EAAE;QAClB,OAAO,EAAE,EAAE;KACd,CAAC;AACN,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from './entities.gen.js';
2
+ export * from './actions.gen.js';
3
+ export * from './context.gen.js';
4
+ export * from './schema.gen.js';
5
+ export * from './engine.js';
6
+ export * from './builder.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,13 @@
1
+ // Code generated by highflame-policy-codegen. DO NOT EDIT.
2
+ // Source: schema/highflame.cedarschema
3
+ //
4
+ // NOTE: This module requires Node.js (uses @cedar-policy/cedar-wasm).
5
+ // For browser usage, import from '@highflame/policy/types' instead.
6
+ export * from './entities.gen.js';
7
+ export * from './actions.gen.js';
8
+ export * from './context.gen.js';
9
+ export * from './schema.gen.js';
10
+ // Non-generated modules (require Node.js)
11
+ export * from './engine.js';
12
+ export * from './builder.js';
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,uCAAuC;AACvC,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AAEpE,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAEhC,0CAA0C;AAC1C,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}