@emilia-protocol/gate 0.11.0 → 0.14.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 +80 -0
- package/README.md +310 -0
- package/action-control-manifest.js +3 -268
- package/action-escrow-custodian.js +3 -394
- package/action-escrow-evidence.js +3 -858
- package/action-escrow-package.js +3 -1668
- package/action-escrow-postgres.js +3 -337
- package/action-escrow-state.js +3 -396
- package/action-escrow-verifiers.js +3 -331
- package/action-escrow.js +3 -2447
- package/action-packs.js +3 -140
- package/adapters/_kit.js +3 -104
- package/adapters/aws.js +3 -108
- package/adapters/cloudflare.js +3 -54
- package/adapters/gcp.js +3 -70
- package/adapters/github.js +3 -109
- package/adapters/jira.js +3 -55
- package/adapters/k8s.js +3 -70
- package/adapters/linear.js +3 -55
- package/adapters/salesforce.js +3 -55
- package/adapters/stripe.js +3 -81
- package/adapters/supabase.js +3 -121
- package/adapters/terraform.js +3 -59
- package/adapters/vercel.js +3 -84
- package/aec-execution.js +3 -312
- package/breakglass.js +3 -582
- package/capability-receipt.js +4 -0
- package/cf1-conformance.js +3 -106
- package/challenge-store.js +3 -69
- package/control-plane.js +3 -340
- package/coverage.js +3 -721
- package/demo.mjs +1 -1
- package/deployment-attestation.js +3 -247
- package/dist/action-control-manifest.d.ts +82 -0
- package/dist/action-control-manifest.d.ts.map +1 -0
- package/dist/action-control-manifest.js +422 -0
- package/dist/action-control-manifest.js.map +1 -0
- package/dist/action-escrow-custodian.d.ts +74 -0
- package/dist/action-escrow-custodian.d.ts.map +1 -0
- package/dist/action-escrow-custodian.js +363 -0
- package/dist/action-escrow-custodian.js.map +1 -0
- package/dist/action-escrow-evidence.d.ts +130 -0
- package/dist/action-escrow-evidence.d.ts.map +1 -0
- package/dist/action-escrow-evidence.js +1012 -0
- package/dist/action-escrow-evidence.js.map +1 -0
- package/dist/action-escrow-package.d.ts +10 -0
- package/dist/action-escrow-package.d.ts.map +1 -0
- package/dist/action-escrow-package.js +1583 -0
- package/dist/action-escrow-package.js.map +1 -0
- package/dist/action-escrow-postgres.d.ts +62 -0
- package/dist/action-escrow-postgres.d.ts.map +1 -0
- package/dist/action-escrow-postgres.js +339 -0
- package/dist/action-escrow-postgres.js.map +1 -0
- package/dist/action-escrow-state.d.ts +141 -0
- package/dist/action-escrow-state.d.ts.map +1 -0
- package/dist/action-escrow-state.js +413 -0
- package/dist/action-escrow-state.js.map +1 -0
- package/dist/action-escrow-verifiers.d.ts +65 -0
- package/dist/action-escrow-verifiers.d.ts.map +1 -0
- package/dist/action-escrow-verifiers.js +421 -0
- package/dist/action-escrow-verifiers.js.map +1 -0
- package/dist/action-escrow.d.ts +112 -0
- package/dist/action-escrow.d.ts.map +1 -0
- package/dist/action-escrow.js +2661 -0
- package/dist/action-escrow.js.map +1 -0
- package/dist/action-packs.d.ts +54 -0
- package/dist/action-packs.d.ts.map +1 -0
- package/dist/action-packs.js +143 -0
- package/dist/action-packs.js.map +1 -0
- package/dist/adapters/_kit.d.ts +50 -0
- package/dist/adapters/_kit.d.ts.map +1 -0
- package/dist/adapters/_kit.js +98 -0
- package/dist/adapters/_kit.js.map +1 -0
- package/dist/adapters/aws.d.ts +158 -0
- package/dist/adapters/aws.d.ts.map +1 -0
- package/dist/adapters/aws.js +136 -0
- package/dist/adapters/aws.js.map +1 -0
- package/dist/adapters/cloudflare.d.ts +116 -0
- package/dist/adapters/cloudflare.d.ts.map +1 -0
- package/dist/adapters/cloudflare.js +75 -0
- package/dist/adapters/cloudflare.js.map +1 -0
- package/dist/adapters/gcp.d.ts +139 -0
- package/dist/adapters/gcp.d.ts.map +1 -0
- package/dist/adapters/gcp.js +69 -0
- package/dist/adapters/gcp.js.map +1 -0
- package/dist/adapters/github.d.ts +123 -0
- package/dist/adapters/github.d.ts.map +1 -0
- package/dist/adapters/github.js +105 -0
- package/dist/adapters/github.js.map +1 -0
- package/dist/adapters/jira.d.ts +109 -0
- package/dist/adapters/jira.d.ts.map +1 -0
- package/dist/adapters/jira.js +54 -0
- package/dist/adapters/jira.js.map +1 -0
- package/dist/adapters/k8s.d.ts +139 -0
- package/dist/adapters/k8s.d.ts.map +1 -0
- package/dist/adapters/k8s.js +69 -0
- package/dist/adapters/k8s.js.map +1 -0
- package/dist/adapters/linear.d.ts +109 -0
- package/dist/adapters/linear.d.ts.map +1 -0
- package/dist/adapters/linear.js +54 -0
- package/dist/adapters/linear.js.map +1 -0
- package/dist/adapters/salesforce.d.ts +109 -0
- package/dist/adapters/salesforce.d.ts.map +1 -0
- package/dist/adapters/salesforce.js +54 -0
- package/dist/adapters/salesforce.js.map +1 -0
- package/dist/adapters/stripe.d.ts +116 -0
- package/dist/adapters/stripe.d.ts.map +1 -0
- package/dist/adapters/stripe.js +77 -0
- package/dist/adapters/stripe.js.map +1 -0
- package/dist/adapters/supabase.d.ts +127 -0
- package/dist/adapters/supabase.d.ts.map +1 -0
- package/dist/adapters/supabase.js +112 -0
- package/dist/adapters/supabase.js.map +1 -0
- package/dist/adapters/terraform.d.ts +109 -0
- package/dist/adapters/terraform.d.ts.map +1 -0
- package/dist/adapters/terraform.js +58 -0
- package/dist/adapters/terraform.js.map +1 -0
- package/dist/adapters/vercel.d.ts +114 -0
- package/dist/adapters/vercel.d.ts.map +1 -0
- package/dist/adapters/vercel.js +81 -0
- package/dist/adapters/vercel.js.map +1 -0
- package/dist/aec-execution.d.ts +107 -0
- package/dist/aec-execution.d.ts.map +1 -0
- package/dist/aec-execution.js +334 -0
- package/dist/aec-execution.js.map +1 -0
- package/dist/breakglass.d.ts +205 -0
- package/dist/breakglass.d.ts.map +1 -0
- package/dist/breakglass.js +627 -0
- package/dist/breakglass.js.map +1 -0
- package/dist/capability-receipt.d.ts +601 -0
- package/dist/capability-receipt.d.ts.map +1 -0
- package/dist/capability-receipt.js +1177 -0
- package/dist/capability-receipt.js.map +1 -0
- package/dist/cf1-conformance.d.ts +83 -0
- package/dist/cf1-conformance.d.ts.map +1 -0
- package/dist/cf1-conformance.js +94 -0
- package/dist/cf1-conformance.js.map +1 -0
- package/dist/challenge-store.d.ts +20 -0
- package/dist/challenge-store.d.ts.map +1 -0
- package/dist/challenge-store.js +62 -0
- package/dist/challenge-store.js.map +1 -0
- package/dist/control-plane.d.ts +136 -0
- package/dist/control-plane.d.ts.map +1 -0
- package/dist/control-plane.js +349 -0
- package/dist/control-plane.js.map +1 -0
- package/dist/coverage.d.ts +156 -0
- package/dist/coverage.d.ts.map +1 -0
- package/dist/coverage.js +768 -0
- package/dist/coverage.js.map +1 -0
- package/dist/deployment-attestation.d.ts +93 -0
- package/dist/deployment-attestation.d.ts.map +1 -0
- package/dist/deployment-attestation.js +262 -0
- package/dist/deployment-attestation.js.map +1 -0
- package/dist/eg1-conformance.d.ts +286 -0
- package/dist/eg1-conformance.d.ts.map +1 -0
- package/dist/eg1-conformance.js +379 -0
- package/dist/eg1-conformance.js.map +1 -0
- package/dist/enterprise.d.ts +88 -0
- package/dist/enterprise.d.ts.map +1 -0
- package/dist/enterprise.js +194 -0
- package/dist/enterprise.js.map +1 -0
- package/dist/evidence-postgres.d.ts +123 -0
- package/dist/evidence-postgres.d.ts.map +1 -0
- package/dist/evidence-postgres.js +343 -0
- package/dist/evidence-postgres.js.map +1 -0
- package/dist/evidence.d.ts +113 -0
- package/dist/evidence.d.ts.map +1 -0
- package/dist/evidence.js +369 -0
- package/dist/evidence.js.map +1 -0
- package/dist/execution-binding.d.ts +49 -0
- package/dist/execution-binding.d.ts.map +1 -0
- package/dist/execution-binding.js +243 -0
- package/dist/execution-binding.js.map +1 -0
- package/dist/formal-runtime-map.d.ts +42 -0
- package/dist/formal-runtime-map.d.ts.map +1 -0
- package/dist/formal-runtime-map.js +23 -0
- package/dist/formal-runtime-map.js.map +1 -0
- package/dist/index.d.ts +1003 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1737 -0
- package/dist/index.js.map +1 -0
- package/dist/key-registry.d.ts +60 -0
- package/dist/key-registry.d.ts.map +1 -0
- package/dist/key-registry.js +144 -0
- package/dist/key-registry.js.map +1 -0
- package/dist/mcp.d.ts +53 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +112 -0
- package/dist/mcp.js.map +1 -0
- package/dist/metering.d.ts +80 -0
- package/dist/metering.d.ts.map +1 -0
- package/dist/metering.js +227 -0
- package/dist/metering.js.map +1 -0
- package/dist/metrics.d.ts +68 -0
- package/dist/metrics.d.ts.map +1 -0
- package/dist/metrics.js +242 -0
- package/dist/metrics.js.map +1 -0
- package/dist/network-witness.d.ts +167 -0
- package/dist/network-witness.d.ts.map +1 -0
- package/dist/network-witness.js +520 -0
- package/dist/network-witness.js.map +1 -0
- package/dist/proposal-to-effect.d.ts +146 -0
- package/dist/proposal-to-effect.d.ts.map +1 -0
- package/dist/proposal-to-effect.js +427 -0
- package/dist/proposal-to-effect.js.map +1 -0
- package/dist/protocol-state.d.ts +141 -0
- package/dist/protocol-state.d.ts.map +1 -0
- package/dist/protocol-state.js +106 -0
- package/dist/protocol-state.js.map +1 -0
- package/dist/receipt-program.d.ts +59 -0
- package/dist/receipt-program.d.ts.map +1 -0
- package/dist/receipt-program.js +1053 -0
- package/dist/receipt-program.js.map +1 -0
- package/dist/reliance-kernel.d.ts +66 -0
- package/dist/reliance-kernel.d.ts.map +1 -0
- package/dist/reliance-kernel.js +103 -0
- package/dist/reliance-kernel.js.map +1 -0
- package/dist/reliance-packet.d.ts +67 -0
- package/dist/reliance-packet.d.ts.map +1 -0
- package/dist/reliance-packet.js +176 -0
- package/dist/reliance-packet.js.map +1 -0
- package/dist/remedy-program-postgres.d.ts +37 -0
- package/dist/remedy-program-postgres.d.ts.map +1 -0
- package/dist/remedy-program-postgres.js +291 -0
- package/dist/remedy-program-postgres.js.map +1 -0
- package/dist/remedy-program-receipt.d.ts +97 -0
- package/dist/remedy-program-receipt.d.ts.map +1 -0
- package/dist/remedy-program-receipt.js +817 -0
- package/dist/remedy-program-receipt.js.map +1 -0
- package/dist/remedy-program.d.ts +76 -0
- package/dist/remedy-program.d.ts.map +1 -0
- package/dist/remedy-program.js +1346 -0
- package/dist/remedy-program.js.map +1 -0
- package/dist/reports/art14.d.ts +101 -0
- package/dist/reports/art14.d.ts.map +1 -0
- package/dist/reports/art14.js +340 -0
- package/dist/reports/art14.js.map +1 -0
- package/dist/reports/assurance-package.d.ts +197 -0
- package/dist/reports/assurance-package.d.ts.map +1 -0
- package/dist/reports/assurance-package.js +313 -0
- package/dist/reports/assurance-package.js.map +1 -0
- package/dist/reports/auditor-workpaper.d.ts +194 -0
- package/dist/reports/auditor-workpaper.d.ts.map +1 -0
- package/dist/reports/auditor-workpaper.js +545 -0
- package/dist/reports/auditor-workpaper.js.map +1 -0
- package/dist/reports/external-verification.d.ts +76 -0
- package/dist/reports/external-verification.d.ts.map +1 -0
- package/dist/reports/external-verification.js +209 -0
- package/dist/reports/external-verification.js.map +1 -0
- package/dist/reports/reperform.d.ts +122 -0
- package/dist/reports/reperform.d.ts.map +1 -0
- package/dist/reports/reperform.js +432 -0
- package/dist/reports/reperform.js.map +1 -0
- package/dist/reports/underwriter.d.ts +127 -0
- package/dist/reports/underwriter.d.ts.map +1 -0
- package/dist/reports/underwriter.js +348 -0
- package/dist/reports/underwriter.js.map +1 -0
- package/dist/retention.d.ts +88 -0
- package/dist/retention.d.ts.map +1 -0
- package/dist/retention.js +90 -0
- package/dist/retention.js.map +1 -0
- package/dist/roster.d.ts +113 -0
- package/dist/roster.d.ts.map +1 -0
- package/dist/roster.js +261 -0
- package/dist/roster.js.map +1 -0
- package/dist/runtime-monitor.d.ts +132 -0
- package/dist/runtime-monitor.d.ts.map +1 -0
- package/dist/runtime-monitor.js +197 -0
- package/dist/runtime-monitor.js.map +1 -0
- package/dist/settlement.d.ts +68 -0
- package/dist/settlement.d.ts.map +1 -0
- package/dist/settlement.js +306 -0
- package/dist/settlement.js.map +1 -0
- package/dist/siem.d.ts +261 -0
- package/dist/siem.d.ts.map +1 -0
- package/dist/siem.js +247 -0
- package/dist/siem.js.map +1 -0
- package/dist/store-postgres.d.ts +107 -0
- package/dist/store-postgres.d.ts.map +1 -0
- package/dist/store-postgres.js +152 -0
- package/dist/store-postgres.js.map +1 -0
- package/dist/store.d.ts +95 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +202 -0
- package/dist/store.js.map +1 -0
- package/dist/strict-json.d.ts +14 -0
- package/dist/strict-json.d.ts.map +1 -0
- package/dist/strict-json.js +132 -0
- package/dist/strict-json.js.map +1 -0
- package/dist/trust-program-adapters.d.ts +122 -0
- package/dist/trust-program-adapters.d.ts.map +1 -0
- package/dist/trust-program-adapters.js +802 -0
- package/dist/trust-program-adapters.js.map +1 -0
- package/dist/trust-program-postgres.d.ts +41 -0
- package/dist/trust-program-postgres.d.ts.map +1 -0
- package/dist/trust-program-postgres.js +346 -0
- package/dist/trust-program-postgres.js.map +1 -0
- package/dist/trust-program-revocation.d.ts +206 -0
- package/dist/trust-program-revocation.d.ts.map +1 -0
- package/dist/trust-program-revocation.js +600 -0
- package/dist/trust-program-revocation.js.map +1 -0
- package/dist/trust-program.d.ts +197 -0
- package/dist/trust-program.d.ts.map +1 -0
- package/dist/trust-program.js +1351 -0
- package/dist/trust-program.js.map +1 -0
- package/dist/witness-postgres.d.ts +43 -0
- package/dist/witness-postgres.d.ts.map +1 -0
- package/dist/witness-postgres.js +92 -0
- package/dist/witness-postgres.js.map +1 -0
- package/dist/zk-range-proof.d.ts +78 -0
- package/dist/zk-range-proof.d.ts.map +1 -0
- package/dist/zk-range-proof.js +228 -0
- package/dist/zk-range-proof.js.map +1 -0
- package/eg1-conformance.js +3 -404
- package/enterprise.js +3 -180
- package/ep-assure.mjs +1 -0
- package/evidence-postgres.js +3 -356
- package/evidence.js +4 -360
- package/execution-binding.js +3 -212
- package/formal-runtime-map.js +4 -0
- package/index.js +4 -1249
- package/key-registry.js +3 -134
- package/mcp.js +3 -109
- package/metering.js +3 -226
- package/metrics.js +3 -231
- package/network-witness.js +3 -499
- package/package.json +35 -4
- package/proposal-to-effect.js +4 -0
- package/receipt-program.js +4 -0
- package/reliance-kernel.js +3 -112
- package/reliance-packet.js +3 -175
- package/remedy-program-postgres.js +4 -0
- package/remedy-program-receipt.js +4 -0
- package/remedy-program.js +4 -0
- package/reports/art14.js +0 -0
- package/reports/assurance-package.js +2 -312
- package/reports/auditor-workpaper.js +3 -537
- package/reports/external-verification.js +3 -222
- package/reports/reperform.js +3 -424
- package/reports/underwriter.js +3 -339
- package/retention.js +3 -84
- package/roster.js +3 -264
- package/runtime-monitor.js +4 -0
- package/settlement.js +3 -299
- package/siem.js +3 -235
- package/src/action-control-manifest.ts +424 -0
- package/src/action-escrow-custodian.ts +427 -0
- package/src/action-escrow-evidence.ts +1178 -0
- package/src/action-escrow-package.ts +1821 -0
- package/src/action-escrow-postgres.ts +366 -0
- package/src/action-escrow-state.ts +498 -0
- package/src/action-escrow-verifiers.ts +484 -0
- package/src/action-escrow.ts +3039 -0
- package/src/action-packs.ts +170 -0
- package/src/adapters/_kit.ts +117 -0
- package/src/adapters/aws.ts +142 -0
- package/src/adapters/cloudflare.ts +78 -0
- package/src/adapters/gcp.ts +71 -0
- package/src/adapters/github.ts +110 -0
- package/src/adapters/jira.ts +56 -0
- package/src/adapters/k8s.ts +71 -0
- package/src/adapters/linear.ts +56 -0
- package/src/adapters/salesforce.ts +56 -0
- package/src/adapters/stripe.ts +82 -0
- package/src/adapters/supabase.ts +122 -0
- package/src/adapters/terraform.ts +60 -0
- package/src/adapters/vercel.ts +85 -0
- package/src/aec-execution.ts +354 -0
- package/src/breakglass.ts +647 -0
- package/src/capability-receipt.ts +1258 -0
- package/src/cf1-conformance.ts +120 -0
- package/src/challenge-store.ts +70 -0
- package/src/control-plane.ts +374 -0
- package/src/coverage.ts +832 -0
- package/src/deployment-attestation.ts +259 -0
- package/src/eg1-conformance.ts +471 -0
- package/src/enterprise.ts +195 -0
- package/src/evidence-postgres.ts +374 -0
- package/src/evidence.ts +367 -0
- package/src/execution-binding.ts +236 -0
- package/src/formal-runtime-map.ts +24 -0
- package/src/index.ts +2127 -0
- package/src/key-registry.ts +150 -0
- package/src/mcp.ts +120 -0
- package/src/metering.ts +237 -0
- package/src/metrics.ts +232 -0
- package/src/network-witness.ts +585 -0
- package/src/proposal-to-effect.ts +571 -0
- package/src/protocol-state.ts +143 -0
- package/src/protocol-state.typecheck.ts +94 -0
- package/src/receipt-program.ts +1105 -0
- package/src/reliance-kernel.ts +119 -0
- package/src/reliance-packet.ts +206 -0
- package/src/remedy-program-postgres.ts +367 -0
- package/src/remedy-program-receipt.ts +891 -0
- package/src/remedy-program.ts +1388 -0
- package/src/reports/art14.ts +361 -0
- package/src/reports/assurance-package.ts +330 -0
- package/src/reports/auditor-workpaper.ts +558 -0
- package/src/reports/external-verification.ts +232 -0
- package/src/reports/reperform.ts +441 -0
- package/src/reports/underwriter.ts +356 -0
- package/src/retention.ts +100 -0
- package/src/roster.ts +273 -0
- package/src/runtime-monitor.ts +217 -0
- package/src/settlement.ts +313 -0
- package/src/siem.ts +247 -0
- package/src/store-postgres.ts +167 -0
- package/src/store.ts +214 -0
- package/src/strict-json.ts +115 -0
- package/src/trust-program-adapters.ts +847 -0
- package/src/trust-program-postgres.ts +429 -0
- package/src/trust-program-revocation.ts +751 -0
- package/src/trust-program.ts +1460 -0
- package/src/witness-postgres.ts +106 -0
- package/src/zk-range-proof.ts +250 -0
- package/store-postgres.js +3 -161
- package/store.js +4 -198
- package/strict-json.js +3 -102
- package/trust-program-adapters.js +4 -0
- package/trust-program-postgres.js +4 -0
- package/trust-program-revocation.js +4 -0
- package/trust-program.js +4 -0
- package/witness-postgres.js +3 -96
- package/zk-range-proof.js +4 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
export declare const RLS_DEFINITION_BINDING_VERSION = "EP-SUPABASE-RLS-DEFINITION-v1";
|
|
2
|
+
/** Heuristic: is this SQL destructive (DELETE/DROP/TRUNCATE/ALTER, or UPDATE without WHERE)? */
|
|
3
|
+
export declare function isDestructiveSql(sql: any): boolean;
|
|
4
|
+
/** Canonical hash of a SQL statement, whitespace-collapsed and lowercased. */
|
|
5
|
+
export declare function statementHash(sql: any): string;
|
|
6
|
+
/** Digest the exact canonical RLS definition without placing it in evidence. */
|
|
7
|
+
export declare function rlsDefinitionDigest(definition: any): string;
|
|
8
|
+
export declare const SUPABASE_ACTION_PACK: readonly (Readonly<{
|
|
9
|
+
id: "supabase.sql.destructive";
|
|
10
|
+
label: "Destructive SQL";
|
|
11
|
+
action_type: "supabase.sql.destructive";
|
|
12
|
+
risk: "critical";
|
|
13
|
+
receipt_required: true;
|
|
14
|
+
assurance_class: "class_a";
|
|
15
|
+
match: {
|
|
16
|
+
protocol: string;
|
|
17
|
+
tool: string;
|
|
18
|
+
};
|
|
19
|
+
why: "DELETE/DROP/TRUNCATE/ALTER destroys or rewrites system-of-record state. Bind the exact statement.";
|
|
20
|
+
execution_binding: {
|
|
21
|
+
required_fields: string[];
|
|
22
|
+
};
|
|
23
|
+
}> | Readonly<{
|
|
24
|
+
id: "supabase.data.export";
|
|
25
|
+
label: "Bulk data export";
|
|
26
|
+
action_type: "supabase.data.export";
|
|
27
|
+
risk: "high";
|
|
28
|
+
receipt_required: true;
|
|
29
|
+
assurance_class: "class_a";
|
|
30
|
+
match: {
|
|
31
|
+
protocol: string;
|
|
32
|
+
tool: string;
|
|
33
|
+
};
|
|
34
|
+
why: "Moves data out of its system of record. Bind table + recipient to the approval.";
|
|
35
|
+
execution_binding: {
|
|
36
|
+
required_fields: string[];
|
|
37
|
+
};
|
|
38
|
+
}> | Readonly<{
|
|
39
|
+
id: "supabase.rls.change";
|
|
40
|
+
label: "RLS policy change";
|
|
41
|
+
action_type: "supabase.rls.change";
|
|
42
|
+
risk: "critical";
|
|
43
|
+
receipt_required: true;
|
|
44
|
+
assurance_class: "quorum";
|
|
45
|
+
match: {
|
|
46
|
+
protocol: string;
|
|
47
|
+
tool: string;
|
|
48
|
+
};
|
|
49
|
+
why: "Changes who can read/write rows. Row-Level-Security changes deserve the two-person rule.";
|
|
50
|
+
execution_binding: {
|
|
51
|
+
required_fields: string[];
|
|
52
|
+
};
|
|
53
|
+
}>)[];
|
|
54
|
+
export declare const SUPABASE_OPS: readonly string[];
|
|
55
|
+
export declare function createSupabaseManifest(extraActions?: never[]): {
|
|
56
|
+
'@version': string;
|
|
57
|
+
actions: any[];
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Guard a destructive Supabase/Postgres mutation behind the gate.
|
|
61
|
+
* @param {object} gate a gate built with createSupabaseManifest()
|
|
62
|
+
* @param {object} client a client exposing { query(sql), export(table,recipient), alterPolicy(table,policy,def) }
|
|
63
|
+
* @param {object} args { op:'sql.destructive'|'data.export'|'rls.change', params, receipt }
|
|
64
|
+
* @throws Error{code:'EMILIA_RECEIPT_REQUIRED'} if refused — the statement never executes
|
|
65
|
+
*/
|
|
66
|
+
export declare function guardSupabaseMutation(gate: any, client: any, args: any): Promise<{
|
|
67
|
+
result: any;
|
|
68
|
+
reliance: any;
|
|
69
|
+
execution: any;
|
|
70
|
+
}>;
|
|
71
|
+
declare const _default: {
|
|
72
|
+
SUPABASE_ACTION_PACK: readonly (Readonly<{
|
|
73
|
+
id: "supabase.sql.destructive";
|
|
74
|
+
label: "Destructive SQL";
|
|
75
|
+
action_type: "supabase.sql.destructive";
|
|
76
|
+
risk: "critical";
|
|
77
|
+
receipt_required: true;
|
|
78
|
+
assurance_class: "class_a";
|
|
79
|
+
match: {
|
|
80
|
+
protocol: string;
|
|
81
|
+
tool: string;
|
|
82
|
+
};
|
|
83
|
+
why: "DELETE/DROP/TRUNCATE/ALTER destroys or rewrites system-of-record state. Bind the exact statement.";
|
|
84
|
+
execution_binding: {
|
|
85
|
+
required_fields: string[];
|
|
86
|
+
};
|
|
87
|
+
}> | Readonly<{
|
|
88
|
+
id: "supabase.data.export";
|
|
89
|
+
label: "Bulk data export";
|
|
90
|
+
action_type: "supabase.data.export";
|
|
91
|
+
risk: "high";
|
|
92
|
+
receipt_required: true;
|
|
93
|
+
assurance_class: "class_a";
|
|
94
|
+
match: {
|
|
95
|
+
protocol: string;
|
|
96
|
+
tool: string;
|
|
97
|
+
};
|
|
98
|
+
why: "Moves data out of its system of record. Bind table + recipient to the approval.";
|
|
99
|
+
execution_binding: {
|
|
100
|
+
required_fields: string[];
|
|
101
|
+
};
|
|
102
|
+
}> | Readonly<{
|
|
103
|
+
id: "supabase.rls.change";
|
|
104
|
+
label: "RLS policy change";
|
|
105
|
+
action_type: "supabase.rls.change";
|
|
106
|
+
risk: "critical";
|
|
107
|
+
receipt_required: true;
|
|
108
|
+
assurance_class: "quorum";
|
|
109
|
+
match: {
|
|
110
|
+
protocol: string;
|
|
111
|
+
tool: string;
|
|
112
|
+
};
|
|
113
|
+
why: "Changes who can read/write rows. Row-Level-Security changes deserve the two-person rule.";
|
|
114
|
+
execution_binding: {
|
|
115
|
+
required_fields: string[];
|
|
116
|
+
};
|
|
117
|
+
}>)[];
|
|
118
|
+
SUPABASE_OPS: readonly string[];
|
|
119
|
+
createSupabaseManifest: typeof createSupabaseManifest;
|
|
120
|
+
guardSupabaseMutation: typeof guardSupabaseMutation;
|
|
121
|
+
isDestructiveSql: typeof isDestructiveSql;
|
|
122
|
+
statementHash: typeof statementHash;
|
|
123
|
+
rlsDefinitionDigest: typeof rlsDefinitionDigest;
|
|
124
|
+
RLS_DEFINITION_BINDING_VERSION: string;
|
|
125
|
+
};
|
|
126
|
+
export default _default;
|
|
127
|
+
//# sourceMappingURL=supabase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../src/adapters/supabase.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,8BAA8B,kCAAkC,CAAC;AAK9E,gGAAgG;AAChG,wBAAgB,gBAAgB,CAAC,GAAG,KAAA,WAGnC;AAED,8EAA8E;AAC9E,wBAAgB,aAAa,CAAC,GAAG,KAAA,UAEhC;AAED,gFAAgF;AAChF,wBAAgB,mBAAmB,CAAC,UAAU,KAAA,UAK7C;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0B/B,CAAC;AA6BH,eAAO,MAAM,YAAY,mBAAc,CAAC;AAExC,wBAAgB,sBAAsB,CAAC,YAAY,UAAK;;;EAEvD;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,KAAA,EAAE,MAAM,KAAA,EAAE,IAAI,KAAA;;;;GAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED,wBAGE"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* EMILIA Gate — Supabase / Postgres System-of-Record adapter.
|
|
4
|
+
*
|
|
5
|
+
* "Install this before your agent can run destructive SQL." Wraps the dangerous
|
|
6
|
+
* database operations — destructive SQL (DELETE/DROP/TRUNCATE/UPDATE), bulk
|
|
7
|
+
* export, and RLS-policy change — so they never execute without a valid,
|
|
8
|
+
* sufficiently-assured, non-replayed receipt bound to THIS statement/table. The
|
|
9
|
+
* exact statement is bound by hash, so an approval for one DELETE cannot be
|
|
10
|
+
* swapped for a DROP.
|
|
11
|
+
*
|
|
12
|
+
* import { createGate } from '@emilia-protocol/gate';
|
|
13
|
+
* import { createSupabaseManifest, guardSupabaseMutation, isDestructiveSql } from '@emilia-protocol/gate/adapters/supabase';
|
|
14
|
+
*
|
|
15
|
+
* const gate = createGate({ manifest: createSupabaseManifest(), trustedKeys: [ISSUER], store: sharedConsumptionStore });
|
|
16
|
+
* // client: anything with .query(sql) (node-postgres / a Supabase RPC wrapper).
|
|
17
|
+
* await guardSupabaseMutation(gate, client, {
|
|
18
|
+
* op: 'sql.destructive', params: { sql: 'DELETE FROM payments WHERE id=1', table: 'payments' }, receipt,
|
|
19
|
+
* });
|
|
20
|
+
*/
|
|
21
|
+
import { createAdapter, manifestFromPack, hashCanonical } from './_kit.js';
|
|
22
|
+
export const RLS_DEFINITION_BINDING_VERSION = 'EP-SUPABASE-RLS-DEFINITION-v1';
|
|
23
|
+
const DESTRUCTIVE = /\b(delete|drop|truncate|alter\s+table)\b/i;
|
|
24
|
+
const UPDATE_NO_WHERE = /\bupdate\b(?:(?!\bwhere\b).)*$/is;
|
|
25
|
+
/** Heuristic: is this SQL destructive (DELETE/DROP/TRUNCATE/ALTER, or UPDATE without WHERE)? */
|
|
26
|
+
export function isDestructiveSql(sql) {
|
|
27
|
+
const s = String(sql || '');
|
|
28
|
+
return DESTRUCTIVE.test(s) || UPDATE_NO_WHERE.test(s.trim());
|
|
29
|
+
}
|
|
30
|
+
/** Canonical hash of a SQL statement, whitespace-collapsed and lowercased. */
|
|
31
|
+
export function statementHash(sql) {
|
|
32
|
+
return hashCanonical(String(sql || '').replace(/\s+/g, ' ').trim().toLowerCase());
|
|
33
|
+
}
|
|
34
|
+
/** Digest the exact canonical RLS definition without placing it in evidence. */
|
|
35
|
+
export function rlsDefinitionDigest(definition) {
|
|
36
|
+
return hashCanonical({
|
|
37
|
+
version: RLS_DEFINITION_BINDING_VERSION,
|
|
38
|
+
definition,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export const SUPABASE_ACTION_PACK = Object.freeze([
|
|
42
|
+
Object.freeze({
|
|
43
|
+
id: 'supabase.sql.destructive', label: 'Destructive SQL', action_type: 'supabase.sql.destructive',
|
|
44
|
+
risk: 'critical', receipt_required: true, assurance_class: 'class_a',
|
|
45
|
+
match: { protocol: 'supabase', tool: 'execute_sql' },
|
|
46
|
+
why: 'DELETE/DROP/TRUNCATE/ALTER destroys or rewrites system-of-record state. Bind the exact statement.',
|
|
47
|
+
execution_binding: { required_fields: ['action_type', 'statement_hash'] },
|
|
48
|
+
}),
|
|
49
|
+
Object.freeze({
|
|
50
|
+
id: 'supabase.data.export', label: 'Bulk data export', action_type: 'supabase.data.export',
|
|
51
|
+
risk: 'high', receipt_required: true, assurance_class: 'class_a',
|
|
52
|
+
match: { protocol: 'supabase', tool: 'export_table' },
|
|
53
|
+
why: 'Moves data out of its system of record. Bind table + recipient to the approval.',
|
|
54
|
+
execution_binding: { required_fields: ['action_type', 'table', 'recipient'] },
|
|
55
|
+
}),
|
|
56
|
+
Object.freeze({
|
|
57
|
+
id: 'supabase.rls.change', label: 'RLS policy change', action_type: 'supabase.rls.change',
|
|
58
|
+
risk: 'critical', receipt_required: true, assurance_class: 'quorum',
|
|
59
|
+
match: { protocol: 'supabase', tool: 'alter_policy' },
|
|
60
|
+
why: 'Changes who can read/write rows. Row-Level-Security changes deserve the two-person rule.',
|
|
61
|
+
execution_binding: {
|
|
62
|
+
required_fields: [
|
|
63
|
+
'action_type', 'table', 'policy', 'rls_definition_digest', 'rls_definition_version',
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
}),
|
|
67
|
+
]);
|
|
68
|
+
const OPS = {
|
|
69
|
+
'sql.destructive': {
|
|
70
|
+
selector: { protocol: 'supabase', tool: 'execute_sql' },
|
|
71
|
+
observed: (p) => ({ action_type: 'supabase.sql.destructive', statement_hash: statementHash(p.sql) }),
|
|
72
|
+
actuator: (p, observed) => ({ ...observed, sql: p.sql }),
|
|
73
|
+
perform: (client, p) => client.query(p.sql),
|
|
74
|
+
},
|
|
75
|
+
'data.export': {
|
|
76
|
+
selector: { protocol: 'supabase', tool: 'export_table' },
|
|
77
|
+
observed: (p) => ({ action_type: 'supabase.data.export', table: p.table, recipient: p.recipient }),
|
|
78
|
+
perform: (client, p) => client.export(p.table, p.recipient),
|
|
79
|
+
},
|
|
80
|
+
'rls.change': {
|
|
81
|
+
selector: { protocol: 'supabase', tool: 'alter_policy' },
|
|
82
|
+
observed: (p) => ({
|
|
83
|
+
action_type: 'supabase.rls.change',
|
|
84
|
+
table: p.table,
|
|
85
|
+
policy: p.policy,
|
|
86
|
+
rls_definition_digest: rlsDefinitionDigest(p.definition),
|
|
87
|
+
rls_definition_version: RLS_DEFINITION_BINDING_VERSION,
|
|
88
|
+
}),
|
|
89
|
+
actuator: (p, observed) => ({ ...observed, definition: p.definition }),
|
|
90
|
+
perform: (client, p) => client.alterPolicy(p.table, p.policy, p.definition),
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
const adapter = createAdapter({ system: 'supabase', ops: OPS });
|
|
94
|
+
export const SUPABASE_OPS = adapter.OPS;
|
|
95
|
+
export function createSupabaseManifest(extraActions = []) {
|
|
96
|
+
return manifestFromPack(SUPABASE_ACTION_PACK, extraActions);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Guard a destructive Supabase/Postgres mutation behind the gate.
|
|
100
|
+
* @param {object} gate a gate built with createSupabaseManifest()
|
|
101
|
+
* @param {object} client a client exposing { query(sql), export(table,recipient), alterPolicy(table,policy,def) }
|
|
102
|
+
* @param {object} args { op:'sql.destructive'|'data.export'|'rls.change', params, receipt }
|
|
103
|
+
* @throws Error{code:'EMILIA_RECEIPT_REQUIRED'} if refused — the statement never executes
|
|
104
|
+
*/
|
|
105
|
+
export function guardSupabaseMutation(gate, client, args) {
|
|
106
|
+
return adapter.guard(gate, client, args);
|
|
107
|
+
}
|
|
108
|
+
export default {
|
|
109
|
+
SUPABASE_ACTION_PACK, SUPABASE_OPS, createSupabaseManifest, guardSupabaseMutation,
|
|
110
|
+
isDestructiveSql, statementHash, rlsDefinitionDigest, RLS_DEFINITION_BINDING_VERSION,
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=supabase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supabase.js","sourceRoot":"","sources":["../../src/adapters/supabase.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE3E,MAAM,CAAC,MAAM,8BAA8B,GAAG,+BAA+B,CAAC;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AY,GAAG,EAAE;IACtD,OAAO,gBAAgB,CAAC,oBAAoB,EAAE,YAAY,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI;IACtD,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AAC3C,CAAC;AAED,eAAe;IACb,oBAAoB,EAAE,YAAY,EAAE,sBAAsB,EAAE,qBAAqB;IACjF,gBAAgB,EAAE,aAAa,EAAE,mBAAmB,EAAE,8BAA8B;CACrF,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export declare const TERRAFORM_ACTION_PACK: readonly (Readonly<{
|
|
2
|
+
id: "terraform.apply.destroy";
|
|
3
|
+
label: "Terraform destroy";
|
|
4
|
+
action_type: "terraform.apply.destroy";
|
|
5
|
+
risk: "critical";
|
|
6
|
+
receipt_required: true;
|
|
7
|
+
assurance_class: "quorum";
|
|
8
|
+
match: {
|
|
9
|
+
protocol: string;
|
|
10
|
+
tool: string;
|
|
11
|
+
};
|
|
12
|
+
why: "Tears down real infrastructure. Bind the workspace + plan hash; quorum.";
|
|
13
|
+
execution_binding: {
|
|
14
|
+
required_fields: string[];
|
|
15
|
+
};
|
|
16
|
+
}> | Readonly<{
|
|
17
|
+
id: "terraform.state.rm";
|
|
18
|
+
label: "Terraform state rm";
|
|
19
|
+
action_type: "terraform.state.rm";
|
|
20
|
+
risk: "high";
|
|
21
|
+
receipt_required: true;
|
|
22
|
+
assurance_class: "class_a";
|
|
23
|
+
match: {
|
|
24
|
+
protocol: string;
|
|
25
|
+
tool: string;
|
|
26
|
+
};
|
|
27
|
+
why: "Detaches a resource from state (orphans real infra). Bind workspace+address.";
|
|
28
|
+
execution_binding: {
|
|
29
|
+
required_fields: string[];
|
|
30
|
+
};
|
|
31
|
+
}> | Readonly<{
|
|
32
|
+
id: "terraform.workspace.delete";
|
|
33
|
+
label: "Terraform workspace delete";
|
|
34
|
+
action_type: "terraform.workspace.delete";
|
|
35
|
+
risk: "high";
|
|
36
|
+
receipt_required: true;
|
|
37
|
+
assurance_class: "class_a";
|
|
38
|
+
match: {
|
|
39
|
+
protocol: string;
|
|
40
|
+
tool: string;
|
|
41
|
+
};
|
|
42
|
+
why: "Deletes a workspace and its state. Bind the workspace.";
|
|
43
|
+
execution_binding: {
|
|
44
|
+
required_fields: string[];
|
|
45
|
+
};
|
|
46
|
+
}>)[];
|
|
47
|
+
export declare const TERRAFORM_OPS: readonly string[];
|
|
48
|
+
export declare function createTerraformManifest(extraActions?: never[]): {
|
|
49
|
+
'@version': string;
|
|
50
|
+
actions: any[];
|
|
51
|
+
};
|
|
52
|
+
export declare function guardTerraformMutation(gate: any, runner: any, args: any): Promise<{
|
|
53
|
+
result: any;
|
|
54
|
+
reliance: any;
|
|
55
|
+
execution: any;
|
|
56
|
+
}>;
|
|
57
|
+
declare const _default: {
|
|
58
|
+
TERRAFORM_ACTION_PACK: readonly (Readonly<{
|
|
59
|
+
id: "terraform.apply.destroy";
|
|
60
|
+
label: "Terraform destroy";
|
|
61
|
+
action_type: "terraform.apply.destroy";
|
|
62
|
+
risk: "critical";
|
|
63
|
+
receipt_required: true;
|
|
64
|
+
assurance_class: "quorum";
|
|
65
|
+
match: {
|
|
66
|
+
protocol: string;
|
|
67
|
+
tool: string;
|
|
68
|
+
};
|
|
69
|
+
why: "Tears down real infrastructure. Bind the workspace + plan hash; quorum.";
|
|
70
|
+
execution_binding: {
|
|
71
|
+
required_fields: string[];
|
|
72
|
+
};
|
|
73
|
+
}> | Readonly<{
|
|
74
|
+
id: "terraform.state.rm";
|
|
75
|
+
label: "Terraform state rm";
|
|
76
|
+
action_type: "terraform.state.rm";
|
|
77
|
+
risk: "high";
|
|
78
|
+
receipt_required: true;
|
|
79
|
+
assurance_class: "class_a";
|
|
80
|
+
match: {
|
|
81
|
+
protocol: string;
|
|
82
|
+
tool: string;
|
|
83
|
+
};
|
|
84
|
+
why: "Detaches a resource from state (orphans real infra). Bind workspace+address.";
|
|
85
|
+
execution_binding: {
|
|
86
|
+
required_fields: string[];
|
|
87
|
+
};
|
|
88
|
+
}> | Readonly<{
|
|
89
|
+
id: "terraform.workspace.delete";
|
|
90
|
+
label: "Terraform workspace delete";
|
|
91
|
+
action_type: "terraform.workspace.delete";
|
|
92
|
+
risk: "high";
|
|
93
|
+
receipt_required: true;
|
|
94
|
+
assurance_class: "class_a";
|
|
95
|
+
match: {
|
|
96
|
+
protocol: string;
|
|
97
|
+
tool: string;
|
|
98
|
+
};
|
|
99
|
+
why: "Deletes a workspace and its state. Bind the workspace.";
|
|
100
|
+
execution_binding: {
|
|
101
|
+
required_fields: string[];
|
|
102
|
+
};
|
|
103
|
+
}>)[];
|
|
104
|
+
TERRAFORM_OPS: readonly string[];
|
|
105
|
+
createTerraformManifest: typeof createTerraformManifest;
|
|
106
|
+
guardTerraformMutation: typeof guardTerraformMutation;
|
|
107
|
+
};
|
|
108
|
+
export default _default;
|
|
109
|
+
//# sourceMappingURL=terraform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terraform.d.ts","sourceRoot":"","sources":["../../src/adapters/terraform.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsBhC,CAAC;AAqBH,eAAO,MAAM,aAAa,mBAAc,CAAC;AACzC,wBAAgB,uBAAuB,CAAC,YAAY,UAAK;;;EAAmE;AAC5H,wBAAgB,sBAAsB,CAAC,IAAI,KAAA,EAAE,MAAM,KAAA,EAAE,IAAI,KAAA;;;;GAA+C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACxG,wBAAyG"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* EMILIA Gate — Terraform System-of-Record adapter.
|
|
4
|
+
*
|
|
5
|
+
* "Install this before your agent can destroy infrastructure." Guards the
|
|
6
|
+
* irreversible Terraform operations — destroy, state rm, workspace delete — so
|
|
7
|
+
* they never run without a receipt bound to THIS workspace/plan. The destroy
|
|
8
|
+
* plan is bound by hash, so an approved small destroy cannot be swapped for a
|
|
9
|
+
* full teardown. Runner is injected (a `terraform`/`tofu` CLI wrapper or Cloud
|
|
10
|
+
* API client).
|
|
11
|
+
*/
|
|
12
|
+
import { createAdapter, manifestFromPack } from './_kit.js';
|
|
13
|
+
export const TERRAFORM_ACTION_PACK = Object.freeze([
|
|
14
|
+
Object.freeze({
|
|
15
|
+
id: 'terraform.apply.destroy', label: 'Terraform destroy', action_type: 'terraform.apply.destroy',
|
|
16
|
+
risk: 'critical', receipt_required: true, assurance_class: 'quorum',
|
|
17
|
+
match: { protocol: 'terraform', tool: 'destroy' },
|
|
18
|
+
why: 'Tears down real infrastructure. Bind the workspace + plan hash; quorum.',
|
|
19
|
+
execution_binding: { required_fields: ['action_type', 'workspace', 'plan_hash'] },
|
|
20
|
+
}),
|
|
21
|
+
Object.freeze({
|
|
22
|
+
id: 'terraform.state.rm', label: 'Terraform state rm', action_type: 'terraform.state.rm',
|
|
23
|
+
risk: 'high', receipt_required: true, assurance_class: 'class_a',
|
|
24
|
+
match: { protocol: 'terraform', tool: 'state_rm' },
|
|
25
|
+
why: 'Detaches a resource from state (orphans real infra). Bind workspace+address.',
|
|
26
|
+
execution_binding: { required_fields: ['action_type', 'workspace', 'address'] },
|
|
27
|
+
}),
|
|
28
|
+
Object.freeze({
|
|
29
|
+
id: 'terraform.workspace.delete', label: 'Terraform workspace delete', action_type: 'terraform.workspace.delete',
|
|
30
|
+
risk: 'high', receipt_required: true, assurance_class: 'class_a',
|
|
31
|
+
match: { protocol: 'terraform', tool: 'workspace_delete' },
|
|
32
|
+
why: 'Deletes a workspace and its state. Bind the workspace.',
|
|
33
|
+
execution_binding: { required_fields: ['action_type', 'workspace'] },
|
|
34
|
+
}),
|
|
35
|
+
]);
|
|
36
|
+
const OPS = {
|
|
37
|
+
'apply.destroy': {
|
|
38
|
+
selector: { protocol: 'terraform', tool: 'destroy' },
|
|
39
|
+
observed: (p) => ({ action_type: 'terraform.apply.destroy', workspace: p.workspace, plan_hash: p.plan_hash }),
|
|
40
|
+
perform: (r, p) => r.destroy({ workspace: p.workspace, plan_hash: p.plan_hash }),
|
|
41
|
+
},
|
|
42
|
+
'state.rm': {
|
|
43
|
+
selector: { protocol: 'terraform', tool: 'state_rm' },
|
|
44
|
+
observed: (p) => ({ action_type: 'terraform.state.rm', workspace: p.workspace, address: p.address }),
|
|
45
|
+
perform: (r, p) => r.stateRm({ workspace: p.workspace, address: p.address }),
|
|
46
|
+
},
|
|
47
|
+
'workspace.delete': {
|
|
48
|
+
selector: { protocol: 'terraform', tool: 'workspace_delete' },
|
|
49
|
+
observed: (p) => ({ action_type: 'terraform.workspace.delete', workspace: p.workspace }),
|
|
50
|
+
perform: (r, p) => r.workspaceDelete({ workspace: p.workspace }),
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
const adapter = createAdapter({ system: 'terraform', ops: OPS });
|
|
54
|
+
export const TERRAFORM_OPS = adapter.OPS;
|
|
55
|
+
export function createTerraformManifest(extraActions = []) { return manifestFromPack(TERRAFORM_ACTION_PACK, extraActions); }
|
|
56
|
+
export function guardTerraformMutation(gate, runner, args) { return adapter.guard(gate, runner, args); }
|
|
57
|
+
export default { TERRAFORM_ACTION_PACK, TERRAFORM_OPS, createTerraformManifest, guardTerraformMutation };
|
|
58
|
+
//# sourceMappingURL=terraform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terraform.js","sourceRoot":"","sources":["../../src/adapters/terraform.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;GASG;AACH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE5D,MAAM,CA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CAAC;AAEF,MAAM,OAAO,GAAG,aAAa,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC;AACzC,MAAM,UAAU,uBAAuB,CAAC,YAAY,GAAG,EAAE,IAAI,OAAO,gBAAgB,CAAC,qBAAqB,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;AAC5H,MAAM,UAAU,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AACxG,eAAe,EAAE,qBAAqB,EAAE,aAAa,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
export declare const SECRET_VALUE_BINDING_VERSION = "EP-VERCEL-SECRET-VALUE-v1";
|
|
2
|
+
/** Digest an exact secret value for receipt binding; callers must never log it. */
|
|
3
|
+
export declare function secretValueDigest(value: any): string;
|
|
4
|
+
export declare const VERCEL_ACTION_PACK: readonly (Readonly<{
|
|
5
|
+
id: "vercel.deploy.promote";
|
|
6
|
+
label: "Promote to production";
|
|
7
|
+
action_type: "vercel.deploy.promote";
|
|
8
|
+
risk: "critical";
|
|
9
|
+
receipt_required: true;
|
|
10
|
+
assurance_class: "quorum";
|
|
11
|
+
match: {
|
|
12
|
+
protocol: string;
|
|
13
|
+
tool: string;
|
|
14
|
+
};
|
|
15
|
+
why: "Changes live production. Quorum for the prod cutover.";
|
|
16
|
+
execution_binding: {
|
|
17
|
+
required_fields: string[];
|
|
18
|
+
};
|
|
19
|
+
}> | Readonly<{
|
|
20
|
+
id: "vercel.project.delete";
|
|
21
|
+
label: "Delete project";
|
|
22
|
+
action_type: "vercel.project.delete";
|
|
23
|
+
risk: "critical";
|
|
24
|
+
receipt_required: true;
|
|
25
|
+
assurance_class: "class_a";
|
|
26
|
+
match: {
|
|
27
|
+
protocol: string;
|
|
28
|
+
tool: string;
|
|
29
|
+
};
|
|
30
|
+
why: "Destroys a project and its deployments. Bind the project.";
|
|
31
|
+
execution_binding: {
|
|
32
|
+
required_fields: string[];
|
|
33
|
+
};
|
|
34
|
+
}> | Readonly<{
|
|
35
|
+
id: "vercel.env.set";
|
|
36
|
+
label: "Set env / secret";
|
|
37
|
+
action_type: "vercel.env.set";
|
|
38
|
+
risk: "high";
|
|
39
|
+
receipt_required: true;
|
|
40
|
+
assurance_class: "class_a";
|
|
41
|
+
match: {
|
|
42
|
+
protocol: string;
|
|
43
|
+
tool: string;
|
|
44
|
+
};
|
|
45
|
+
why: "Changes production secrets/config. Bind project+key+target.";
|
|
46
|
+
execution_binding: {
|
|
47
|
+
required_fields: string[];
|
|
48
|
+
};
|
|
49
|
+
}>)[];
|
|
50
|
+
export declare const VERCEL_OPS: readonly string[];
|
|
51
|
+
export declare function createVercelManifest(extra?: never[]): {
|
|
52
|
+
'@version': string;
|
|
53
|
+
actions: any[];
|
|
54
|
+
};
|
|
55
|
+
export declare function guardVercelMutation(gate: any, client: any, args: any): Promise<{
|
|
56
|
+
result: any;
|
|
57
|
+
reliance: any;
|
|
58
|
+
execution: any;
|
|
59
|
+
}>;
|
|
60
|
+
declare const _default: {
|
|
61
|
+
VERCEL_ACTION_PACK: readonly (Readonly<{
|
|
62
|
+
id: "vercel.deploy.promote";
|
|
63
|
+
label: "Promote to production";
|
|
64
|
+
action_type: "vercel.deploy.promote";
|
|
65
|
+
risk: "critical";
|
|
66
|
+
receipt_required: true;
|
|
67
|
+
assurance_class: "quorum";
|
|
68
|
+
match: {
|
|
69
|
+
protocol: string;
|
|
70
|
+
tool: string;
|
|
71
|
+
};
|
|
72
|
+
why: "Changes live production. Quorum for the prod cutover.";
|
|
73
|
+
execution_binding: {
|
|
74
|
+
required_fields: string[];
|
|
75
|
+
};
|
|
76
|
+
}> | Readonly<{
|
|
77
|
+
id: "vercel.project.delete";
|
|
78
|
+
label: "Delete project";
|
|
79
|
+
action_type: "vercel.project.delete";
|
|
80
|
+
risk: "critical";
|
|
81
|
+
receipt_required: true;
|
|
82
|
+
assurance_class: "class_a";
|
|
83
|
+
match: {
|
|
84
|
+
protocol: string;
|
|
85
|
+
tool: string;
|
|
86
|
+
};
|
|
87
|
+
why: "Destroys a project and its deployments. Bind the project.";
|
|
88
|
+
execution_binding: {
|
|
89
|
+
required_fields: string[];
|
|
90
|
+
};
|
|
91
|
+
}> | Readonly<{
|
|
92
|
+
id: "vercel.env.set";
|
|
93
|
+
label: "Set env / secret";
|
|
94
|
+
action_type: "vercel.env.set";
|
|
95
|
+
risk: "high";
|
|
96
|
+
receipt_required: true;
|
|
97
|
+
assurance_class: "class_a";
|
|
98
|
+
match: {
|
|
99
|
+
protocol: string;
|
|
100
|
+
tool: string;
|
|
101
|
+
};
|
|
102
|
+
why: "Changes production secrets/config. Bind project+key+target.";
|
|
103
|
+
execution_binding: {
|
|
104
|
+
required_fields: string[];
|
|
105
|
+
};
|
|
106
|
+
}>)[];
|
|
107
|
+
VERCEL_OPS: readonly string[];
|
|
108
|
+
SECRET_VALUE_BINDING_VERSION: string;
|
|
109
|
+
secretValueDigest: typeof secretValueDigest;
|
|
110
|
+
createVercelManifest: typeof createVercelManifest;
|
|
111
|
+
guardVercelMutation: typeof guardVercelMutation;
|
|
112
|
+
};
|
|
113
|
+
export default _default;
|
|
114
|
+
//# sourceMappingURL=vercel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vercel.d.ts","sourceRoot":"","sources":["../../src/adapters/vercel.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,4BAA4B,8BAA8B,CAAC;AAExE,mFAAmF;AACnF,wBAAgB,iBAAiB,CAAC,KAAK,KAAA,UAKtC;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0B7B,CAAC;AA6BH,eAAO,MAAM,UAAU,mBAAc,CAAC;AACtC,wBAAgB,oBAAoB,CAAC,KAAK,UAAK;;;EAAyD;AACxG,wBAAgB,mBAAmB,CAAC,IAAI,KAAA,EAAE,MAAM,KAAA,EAAE,IAAI,KAAA;;;;GAA+C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACrG,wBAOE"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* EMILIA Gate — Vercel System-of-Record adapter.
|
|
4
|
+
* Guards promote-to-production, project delete, and env/secret changes so they
|
|
5
|
+
* never reach Vercel without a receipt bound to THIS project. Client injected
|
|
6
|
+
* (the Vercel REST client or a thin wrapper).
|
|
7
|
+
*/
|
|
8
|
+
import { createAdapter, manifestFromPack, hashCanonical } from './_kit.js';
|
|
9
|
+
export const SECRET_VALUE_BINDING_VERSION = 'EP-VERCEL-SECRET-VALUE-v1';
|
|
10
|
+
/** Digest an exact secret value for receipt binding; callers must never log it. */
|
|
11
|
+
export function secretValueDigest(value) {
|
|
12
|
+
return hashCanonical({
|
|
13
|
+
version: SECRET_VALUE_BINDING_VERSION,
|
|
14
|
+
value,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
export const VERCEL_ACTION_PACK = Object.freeze([
|
|
18
|
+
Object.freeze({
|
|
19
|
+
id: 'vercel.deploy.promote', label: 'Promote to production', action_type: 'vercel.deploy.promote',
|
|
20
|
+
risk: 'critical', receipt_required: true, assurance_class: 'quorum',
|
|
21
|
+
match: { protocol: 'vercel', tool: 'promote_deployment' },
|
|
22
|
+
why: 'Changes live production. Quorum for the prod cutover.',
|
|
23
|
+
execution_binding: { required_fields: ['action_type', 'project', 'deployment_id'] },
|
|
24
|
+
}),
|
|
25
|
+
Object.freeze({
|
|
26
|
+
id: 'vercel.project.delete', label: 'Delete project', action_type: 'vercel.project.delete',
|
|
27
|
+
risk: 'critical', receipt_required: true, assurance_class: 'class_a',
|
|
28
|
+
match: { protocol: 'vercel', tool: 'delete_project' },
|
|
29
|
+
why: 'Destroys a project and its deployments. Bind the project.',
|
|
30
|
+
execution_binding: { required_fields: ['action_type', 'project'] },
|
|
31
|
+
}),
|
|
32
|
+
Object.freeze({
|
|
33
|
+
id: 'vercel.env.set', label: 'Set env / secret', action_type: 'vercel.env.set',
|
|
34
|
+
risk: 'high', receipt_required: true, assurance_class: 'class_a',
|
|
35
|
+
match: { protocol: 'vercel', tool: 'upsert_env' },
|
|
36
|
+
why: 'Changes production secrets/config. Bind project+key+target.',
|
|
37
|
+
execution_binding: {
|
|
38
|
+
required_fields: [
|
|
39
|
+
'action_type', 'project', 'key', 'target', 'secret_value_digest', 'secret_value_version',
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
}),
|
|
43
|
+
]);
|
|
44
|
+
const OPS = {
|
|
45
|
+
'deploy.promote': {
|
|
46
|
+
selector: { protocol: 'vercel', tool: 'promote_deployment' },
|
|
47
|
+
observed: (p) => ({ action_type: 'vercel.deploy.promote', project: p.project, deployment_id: p.deployment_id }),
|
|
48
|
+
perform: (c, p) => c.promoteDeployment({ project: p.project, deploymentId: p.deployment_id }),
|
|
49
|
+
},
|
|
50
|
+
'project.delete': {
|
|
51
|
+
selector: { protocol: 'vercel', tool: 'delete_project' },
|
|
52
|
+
observed: (p) => ({ action_type: 'vercel.project.delete', project: p.project }),
|
|
53
|
+
perform: (c, p) => c.deleteProject({ project: p.project }),
|
|
54
|
+
},
|
|
55
|
+
'env.set': {
|
|
56
|
+
selector: { protocol: 'vercel', tool: 'upsert_env' },
|
|
57
|
+
observed: (p) => ({
|
|
58
|
+
action_type: 'vercel.env.set',
|
|
59
|
+
project: p.project,
|
|
60
|
+
key: p.key,
|
|
61
|
+
target: p.target,
|
|
62
|
+
secret_value_digest: secretValueDigest(p.value),
|
|
63
|
+
secret_value_version: SECRET_VALUE_BINDING_VERSION,
|
|
64
|
+
}),
|
|
65
|
+
actuator: (p, observed) => ({ ...observed, value: p.value }),
|
|
66
|
+
perform: (c, p) => c.upsertEnv({ project: p.project, key: p.key, value: p.value, target: p.target }),
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
const adapter = createAdapter({ system: 'vercel', ops: OPS });
|
|
70
|
+
export const VERCEL_OPS = adapter.OPS;
|
|
71
|
+
export function createVercelManifest(extra = []) { return manifestFromPack(VERCEL_ACTION_PACK, extra); }
|
|
72
|
+
export function guardVercelMutation(gate, client, args) { return adapter.guard(gate, client, args); }
|
|
73
|
+
export default {
|
|
74
|
+
VERCEL_ACTION_PACK,
|
|
75
|
+
VERCEL_OPS,
|
|
76
|
+
SECRET_VALUE_BINDING_VERSION,
|
|
77
|
+
secretValueDigest,
|
|
78
|
+
createVercelManifest,
|
|
79
|
+
guardVercelMutation,
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=vercel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vercel.js","sourceRoot":"","sources":["../../src/adapters/vercel.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;GAKG;AACH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE3E,MAAM,CAAC,MAAM,4BAA4B,GAAG,2BAA2B,CAAC;AAExE,mFAAmF;AACnF,MAAM,UAAU,iBAAiB,CAAC,KAAK;IACrC,OAAO,aAAa,CAAC;QACnB,OAAO,EAAE,4BAA4B;QACrC,KAAK;KACN,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9C,MAAM,CAAC,MAAM,CAAC;QACZ,EAAE,EAAE,uBAAuB,EAAE,KAAK,EAAE,uBAAuB,EAAE,WAAW,EAAE,uBAAuB;QACjG,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,eAAe,EAAE,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