@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,69 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* EMILIA Gate — Google Cloud System-of-Record adapter.
|
|
4
|
+
*
|
|
5
|
+
* "Install this before your agent can change cloud permissions or delete a
|
|
6
|
+
* project." Guards the high-blast-radius GCP operations — IAM policy set,
|
|
7
|
+
* service-account key create, project delete, storage bucket delete — so they
|
|
8
|
+
* never reach GCP without a receipt bound to THIS resource/member/role. Client
|
|
9
|
+
* is injected (the @google-cloud SDKs or a thin wrapper).
|
|
10
|
+
*/
|
|
11
|
+
import { createAdapter, manifestFromPack } from './_kit.js';
|
|
12
|
+
export const GCP_ACTION_PACK = Object.freeze([
|
|
13
|
+
Object.freeze({
|
|
14
|
+
id: 'gcp.iam.set_policy', label: 'GCP IAM set policy', action_type: 'gcp.iam.set_policy',
|
|
15
|
+
risk: 'critical', receipt_required: true, assurance_class: 'quorum',
|
|
16
|
+
match: { protocol: 'gcp', tool: 'set_iam_policy' },
|
|
17
|
+
why: 'Grants cloud permissions. Bind resource+member+role; quorum.',
|
|
18
|
+
execution_binding: { required_fields: ['action_type', 'resource', 'member', 'role'] },
|
|
19
|
+
}),
|
|
20
|
+
Object.freeze({
|
|
21
|
+
id: 'gcp.sa_key.create', label: 'GCP service-account key create', action_type: 'gcp.sa_key.create',
|
|
22
|
+
risk: 'critical', receipt_required: true, assurance_class: 'class_a',
|
|
23
|
+
match: { protocol: 'gcp', tool: 'create_service_account_key' },
|
|
24
|
+
why: 'Mints long-lived cloud credentials. Bind the service account.',
|
|
25
|
+
execution_binding: { required_fields: ['action_type', 'service_account'] },
|
|
26
|
+
}),
|
|
27
|
+
Object.freeze({
|
|
28
|
+
id: 'gcp.project.delete', label: 'GCP project delete', action_type: 'gcp.project.delete',
|
|
29
|
+
risk: 'critical', receipt_required: true, assurance_class: 'quorum',
|
|
30
|
+
match: { protocol: 'gcp', tool: 'delete_project' },
|
|
31
|
+
why: 'Deletes an entire project. Quorum.',
|
|
32
|
+
execution_binding: { required_fields: ['action_type', 'project'] },
|
|
33
|
+
}),
|
|
34
|
+
Object.freeze({
|
|
35
|
+
id: 'gcp.storage.bucket_delete', label: 'GCP bucket delete', action_type: 'gcp.storage.bucket_delete',
|
|
36
|
+
risk: 'high', receipt_required: true, assurance_class: 'class_a',
|
|
37
|
+
match: { protocol: 'gcp', tool: 'delete_bucket' },
|
|
38
|
+
why: 'Destroys a storage bucket and its objects. Bind the bucket.',
|
|
39
|
+
execution_binding: { required_fields: ['action_type', 'bucket'] },
|
|
40
|
+
}),
|
|
41
|
+
]);
|
|
42
|
+
const OPS = {
|
|
43
|
+
'iam.set_policy': {
|
|
44
|
+
selector: { protocol: 'gcp', tool: 'set_iam_policy' },
|
|
45
|
+
observed: (p) => ({ action_type: 'gcp.iam.set_policy', resource: p.resource, member: p.member, role: p.role }),
|
|
46
|
+
perform: (c, p) => c.setIamPolicy({ resource: p.resource, member: p.member, role: p.role }),
|
|
47
|
+
},
|
|
48
|
+
'sa_key.create': {
|
|
49
|
+
selector: { protocol: 'gcp', tool: 'create_service_account_key' },
|
|
50
|
+
observed: (p) => ({ action_type: 'gcp.sa_key.create', service_account: p.service_account }),
|
|
51
|
+
perform: (c, p) => c.createServiceAccountKey({ service_account: p.service_account }),
|
|
52
|
+
},
|
|
53
|
+
'project.delete': {
|
|
54
|
+
selector: { protocol: 'gcp', tool: 'delete_project' },
|
|
55
|
+
observed: (p) => ({ action_type: 'gcp.project.delete', project: p.project }),
|
|
56
|
+
perform: (c, p) => c.deleteProject({ project: p.project }),
|
|
57
|
+
},
|
|
58
|
+
'storage.bucket_delete': {
|
|
59
|
+
selector: { protocol: 'gcp', tool: 'delete_bucket' },
|
|
60
|
+
observed: (p) => ({ action_type: 'gcp.storage.bucket_delete', bucket: p.bucket }),
|
|
61
|
+
perform: (c, p) => c.deleteBucket({ bucket: p.bucket }),
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
const adapter = createAdapter({ system: 'gcp', ops: OPS });
|
|
65
|
+
export const GCP_OPS = adapter.OPS;
|
|
66
|
+
export function createGcpManifest(extraActions = []) { return manifestFromPack(GCP_ACTION_PACK, extraActions); }
|
|
67
|
+
export function guardGcpMutation(gate, client, args) { return adapter.guard(gate, client, args); }
|
|
68
|
+
export default { GCP_ACTION_PAC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AAiB,CAAC,YAAY,GAAG,EAAE,IAAI,OAAO,gBAAgB,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;AAChH,MAAM,UAAU,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AAClG,eAAe,EAAE,eAAe,EAAE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
export declare const GITHUB_ACTION_PACK: readonly (Readonly<{
|
|
2
|
+
id: "github.repo.delete";
|
|
3
|
+
label: "GitHub repo delete";
|
|
4
|
+
action_type: "github.repo.delete";
|
|
5
|
+
risk: "critical";
|
|
6
|
+
receipt_required: true;
|
|
7
|
+
assurance_class: "class_a";
|
|
8
|
+
match: {
|
|
9
|
+
protocol: string;
|
|
10
|
+
tool: string;
|
|
11
|
+
};
|
|
12
|
+
why: "Destroys a repository and its history. Bind owner/repo to a named human approval.";
|
|
13
|
+
execution_binding: {
|
|
14
|
+
required_fields: string[];
|
|
15
|
+
};
|
|
16
|
+
}> | Readonly<{
|
|
17
|
+
id: "github.permission.change";
|
|
18
|
+
label: "GitHub permission change";
|
|
19
|
+
action_type: "github.permission.change";
|
|
20
|
+
risk: "critical";
|
|
21
|
+
receipt_required: true;
|
|
22
|
+
assurance_class: "quorum";
|
|
23
|
+
match: {
|
|
24
|
+
protocol: string;
|
|
25
|
+
tool: string;
|
|
26
|
+
};
|
|
27
|
+
why: "Changes who can act on the repo. Privilege change deserves the two-person rule.";
|
|
28
|
+
execution_binding: {
|
|
29
|
+
required_fields: string[];
|
|
30
|
+
};
|
|
31
|
+
}> | Readonly<{
|
|
32
|
+
id: "github.branch_protection.remove";
|
|
33
|
+
label: "GitHub branch-protection removal";
|
|
34
|
+
action_type: "github.branch_protection.remove";
|
|
35
|
+
risk: "critical";
|
|
36
|
+
receipt_required: true;
|
|
37
|
+
assurance_class: "class_a";
|
|
38
|
+
match: {
|
|
39
|
+
protocol: string;
|
|
40
|
+
tool: string;
|
|
41
|
+
};
|
|
42
|
+
why: "Removes the guard rails on a protected branch.";
|
|
43
|
+
execution_binding: {
|
|
44
|
+
required_fields: string[];
|
|
45
|
+
};
|
|
46
|
+
}>)[];
|
|
47
|
+
export declare const GITHUB_OPS: readonly string[];
|
|
48
|
+
/** Build an action-risk manifest for the GitHub destructive ops (plus any extras). */
|
|
49
|
+
export declare function createGithubManifest(extraActions?: never[]): {
|
|
50
|
+
'@version': string;
|
|
51
|
+
actions: any[];
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Guard a destructive GitHub mutation behind the gate. The call never reaches
|
|
55
|
+
* GitHub unless a valid, sufficiently-assured, non-replayed receipt bound to
|
|
56
|
+
* THIS repo is present.
|
|
57
|
+
* @param {object} gate a gate built with createGithubManifest()
|
|
58
|
+
* @param {object} octokit an Octokit-like client (@octokit/rest or compatible)
|
|
59
|
+
* @param {object} o
|
|
60
|
+
* @param {string} o.op 'repo.delete' | 'permission.change' | 'branch_protection.remove'
|
|
61
|
+
* @param {object} o.params { owner, repo, [username], [permission], [branch] }
|
|
62
|
+
* @param {object} o.receipt the EMILIA receipt authorizing THIS exact op
|
|
63
|
+
* @returns {Promise<{ result:any, reliance:object, execution:object }>}
|
|
64
|
+
* @throws Error{code:'EMILIA_RECEIPT_REQUIRED'} if refused — the call never reaches GitHub
|
|
65
|
+
*/
|
|
66
|
+
export declare function guardGithubMutation(gate: any, octokit: any, args: any): Promise<{
|
|
67
|
+
result: any;
|
|
68
|
+
reliance: any;
|
|
69
|
+
execution: any;
|
|
70
|
+
}>;
|
|
71
|
+
declare const _default: {
|
|
72
|
+
GITHUB_ACTION_PACK: readonly (Readonly<{
|
|
73
|
+
id: "github.repo.delete";
|
|
74
|
+
label: "GitHub repo delete";
|
|
75
|
+
action_type: "github.repo.delete";
|
|
76
|
+
risk: "critical";
|
|
77
|
+
receipt_required: true;
|
|
78
|
+
assurance_class: "class_a";
|
|
79
|
+
match: {
|
|
80
|
+
protocol: string;
|
|
81
|
+
tool: string;
|
|
82
|
+
};
|
|
83
|
+
why: "Destroys a repository and its history. Bind owner/repo to a named human approval.";
|
|
84
|
+
execution_binding: {
|
|
85
|
+
required_fields: string[];
|
|
86
|
+
};
|
|
87
|
+
}> | Readonly<{
|
|
88
|
+
id: "github.permission.change";
|
|
89
|
+
label: "GitHub permission change";
|
|
90
|
+
action_type: "github.permission.change";
|
|
91
|
+
risk: "critical";
|
|
92
|
+
receipt_required: true;
|
|
93
|
+
assurance_class: "quorum";
|
|
94
|
+
match: {
|
|
95
|
+
protocol: string;
|
|
96
|
+
tool: string;
|
|
97
|
+
};
|
|
98
|
+
why: "Changes who can act on the repo. Privilege change deserves the two-person rule.";
|
|
99
|
+
execution_binding: {
|
|
100
|
+
required_fields: string[];
|
|
101
|
+
};
|
|
102
|
+
}> | Readonly<{
|
|
103
|
+
id: "github.branch_protection.remove";
|
|
104
|
+
label: "GitHub branch-protection removal";
|
|
105
|
+
action_type: "github.branch_protection.remove";
|
|
106
|
+
risk: "critical";
|
|
107
|
+
receipt_required: true;
|
|
108
|
+
assurance_class: "class_a";
|
|
109
|
+
match: {
|
|
110
|
+
protocol: string;
|
|
111
|
+
tool: string;
|
|
112
|
+
};
|
|
113
|
+
why: "Removes the guard rails on a protected branch.";
|
|
114
|
+
execution_binding: {
|
|
115
|
+
required_fields: string[];
|
|
116
|
+
};
|
|
117
|
+
}>)[];
|
|
118
|
+
GITHUB_OPS: readonly string[];
|
|
119
|
+
createGithubManifest: typeof createGithubManifest;
|
|
120
|
+
guardGithubMutation: typeof guardGithubMutation;
|
|
121
|
+
};
|
|
122
|
+
export default _default;
|
|
123
|
+
//# sourceMappingURL=github.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/adapters/github.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkC7B,CAAC;AA0BH,eAAO,MAAM,UAAU,mBAAc,CAAC;AAEtC,sFAAsF;AACtF,wBAAgB,oBAAoB,CAAC,YAAY,UAAK;;;EAErD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,KAAA,EAAE,OAAO,KAAA,EAAE,IAAI,KAAA;;;;GAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED,wBAA6F"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* EMILIA Gate — GitHub System-of-Record adapter.
|
|
4
|
+
*
|
|
5
|
+
* "Install this before your agent can touch production GitHub." Wraps destructive
|
|
6
|
+
* Octokit operations so the mutation NEVER reaches GitHub without a valid,
|
|
7
|
+
* sufficiently-assured, non-replayed human/quorum receipt bound to THIS repo —
|
|
8
|
+
* and on success returns a reliance packet proving exactly what was authorized
|
|
9
|
+
* and what executed.
|
|
10
|
+
*
|
|
11
|
+
* import { Octokit } from '@octokit/rest';
|
|
12
|
+
* import { createGate } from '@emilia-protocol/gate';
|
|
13
|
+
* import { createGithubManifest, guardGithubMutation } from '@emilia-protocol/gate/adapters/github';
|
|
14
|
+
*
|
|
15
|
+
* const gate = createGate({ manifest: createGithubManifest(), trustedKeys: [ISSUER], store: sharedConsumptionStore });
|
|
16
|
+
* const octokit = new Octokit({ auth });
|
|
17
|
+
* await guardGithubMutation(gate, octokit, {
|
|
18
|
+
* op: 'repo.delete', params: { owner, repo }, receipt, // throws if no valid receipt
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* The receipt's claim must carry the same owner/repo (and username/permission or
|
|
22
|
+
* branch) as the call — a receipt for repo A cannot authorize deleting repo B.
|
|
23
|
+
*/
|
|
24
|
+
import { createAdapter, manifestFromPack } from './_kit.js';
|
|
25
|
+
export const GITHUB_ACTION_PACK = Object.freeze([
|
|
26
|
+
Object.freeze({
|
|
27
|
+
id: 'github.repo.delete',
|
|
28
|
+
label: 'GitHub repo delete',
|
|
29
|
+
action_type: 'github.repo.delete',
|
|
30
|
+
risk: 'critical',
|
|
31
|
+
receipt_required: true,
|
|
32
|
+
assurance_class: 'class_a',
|
|
33
|
+
match: { protocol: 'github', tool: 'delete_repo' },
|
|
34
|
+
why: 'Destroys a repository and its history. Bind owner/repo to a named human approval.',
|
|
35
|
+
execution_binding: { required_fields: ['action_type', 'owner', 'repo'] },
|
|
36
|
+
}),
|
|
37
|
+
Object.freeze({
|
|
38
|
+
id: 'github.permission.change',
|
|
39
|
+
label: 'GitHub permission change',
|
|
40
|
+
action_type: 'github.permission.change',
|
|
41
|
+
risk: 'critical',
|
|
42
|
+
receipt_required: true,
|
|
43
|
+
assurance_class: 'quorum',
|
|
44
|
+
match: { protocol: 'github', tool: 'update_collaborator_permission' },
|
|
45
|
+
why: 'Changes who can act on the repo. Privilege change deserves the two-person rule.',
|
|
46
|
+
execution_binding: { required_fields: ['action_type', 'owner', 'repo', 'username', 'permission'] },
|
|
47
|
+
}),
|
|
48
|
+
Object.freeze({
|
|
49
|
+
id: 'github.branch_protection.remove',
|
|
50
|
+
label: 'GitHub branch-protection removal',
|
|
51
|
+
action_type: 'github.branch_protection.remove',
|
|
52
|
+
risk: 'critical',
|
|
53
|
+
receipt_required: true,
|
|
54
|
+
assurance_class: 'class_a',
|
|
55
|
+
match: { protocol: 'github', tool: 'delete_branch_protection' },
|
|
56
|
+
why: 'Removes the guard rails on a protected branch.',
|
|
57
|
+
execution_binding: { required_fields: ['action_type', 'owner', 'repo', 'branch'] },
|
|
58
|
+
}),
|
|
59
|
+
]);
|
|
60
|
+
const OPS = {
|
|
61
|
+
'repo.delete': {
|
|
62
|
+
selector: { protocol: 'github', tool: 'delete_repo' },
|
|
63
|
+
observed: (p) => ({ action_type: 'github.repo.delete', owner: p.owner, repo: p.repo }),
|
|
64
|
+
perform: (octokit, p) => octokit.repos.delete({ owner: p.owner, repo: p.repo }),
|
|
65
|
+
},
|
|
66
|
+
'permission.change': {
|
|
67
|
+
selector: { protocol: 'github', tool: 'update_collaborator_permission' },
|
|
68
|
+
observed: (p) => ({
|
|
69
|
+
action_type: 'github.permission.change',
|
|
70
|
+
owner: p.owner, repo: p.repo, username: p.username, permission: p.permission,
|
|
71
|
+
}),
|
|
72
|
+
perform: (octokit, p) => octokit.repos.addCollaborator({
|
|
73
|
+
owner: p.owner, repo: p.repo, username: p.username, permission: p.permission,
|
|
74
|
+
}),
|
|
75
|
+
},
|
|
76
|
+
'branch_protection.remove': {
|
|
77
|
+
selector: { protocol: 'github', tool: 'delete_branch_protection' },
|
|
78
|
+
observed: (p) => ({ action_type: 'github.branch_protection.remove', owner: p.owner, repo: p.repo, branch: p.branch }),
|
|
79
|
+
perform: (octokit, p) => octokit.repos.deleteBranchProtection({ owner: p.owner, repo: p.repo, branch: p.branch }),
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
const adapter = createAdapter({ system: 'github', ops: OPS });
|
|
83
|
+
export const GITHUB_OPS = adapter.OPS;
|
|
84
|
+
/** Build an action-risk manifest for the GitHub destructive ops (plus any extras). */
|
|
85
|
+
export function createGithubManifest(extraActions = []) {
|
|
86
|
+
return manifestFromPack(GITHUB_ACTION_PACK, extraActions);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Guard a destructive GitHub mutation behind the gate. The call never reaches
|
|
90
|
+
* GitHub unless a valid, sufficiently-assured, non-replayed receipt bound to
|
|
91
|
+
* THIS repo is present.
|
|
92
|
+
* @param {object} gate a gate built with createGithubManifest()
|
|
93
|
+
* @param {object} octokit an Octokit-like client (@octokit/rest or compatible)
|
|
94
|
+
* @param {object} o
|
|
95
|
+
* @param {string} o.op 'repo.delete' | 'permission.change' | 'branch_protection.remove'
|
|
96
|
+
* @param {object} o.params { owner, repo, [username], [permission], [branch] }
|
|
97
|
+
* @param {object} o.receipt the EMILIA receipt authorizing THIS exact op
|
|
98
|
+
* @returns {Promise<{ result:any, reliance:object, execution:object }>}
|
|
99
|
+
* @throws Error{code:'EMILIA_RECEIPT_REQUIRED'} if refused — the call never reaches GitHub
|
|
100
|
+
*/
|
|
101
|
+
export function guardGithubMutation(gate, octokit, args) {
|
|
102
|
+
return adapter.guard(gate, octokit, args);
|
|
103
|
+
}
|
|
104
|
+
export default { GITHUB_ACTION_PACK, GITHUB_OPS, createGithubManifest, guardGithubMutation };
|
|
105
|
+
//# sourceMappingURL=github.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github.js","sourceRoot":"","sources":["../../src/adapters/github.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE5D,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9C,MAAM,CAAC,MAAM,CAAC;QACZ,EAAE,EAAE,oBAAoB;QACxB,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,oBAAoB;QACjC,IAAI,EAAE,UAAU;QAChB,gBAAgB,EAAE,IAAI;QACtB,eAAe,EAAE,SAAS;QAC1B,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE;QAClD,GAAG,EAAE,mFAAmF;QACxF,iBAAiB,EAAE,EAAE,eAAe,EAAE,CAAC,aAAa,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE;KACzE,CAAC;IACF,MAAM,CAAC,MAAM,CAAC;QACZ,EAAE,EAAE,0BAA0B;QAC9B,KAAK,EAAE,0BAA0B;QACjC,WAAW,EAAE,0BAA0B;QACvC,IAAI,EAAE,UAAU;QAChB,gBAAgB,EAAE,IAAI;Q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,UAAU,oBAAoB,CAAC,YAAY,GAAG,EAAE;IACpD,OAAO,gBAAgB,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI;IACrD,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED,eAAe,EAAE,kBAAkB,EAAE,UAAU,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export declare const JIRA_ACTION_PACK: readonly (Readonly<{
|
|
2
|
+
id: "jira.issue.bulk_delete";
|
|
3
|
+
label: "Bulk delete issues";
|
|
4
|
+
action_type: "jira.issue.bulk_delete";
|
|
5
|
+
risk: "critical";
|
|
6
|
+
receipt_required: true;
|
|
7
|
+
assurance_class: "class_a";
|
|
8
|
+
match: {
|
|
9
|
+
protocol: string;
|
|
10
|
+
tool: string;
|
|
11
|
+
};
|
|
12
|
+
why: "Mass-destroys issues. Bind the exact JQL.";
|
|
13
|
+
execution_binding: {
|
|
14
|
+
required_fields: string[];
|
|
15
|
+
};
|
|
16
|
+
}> | Readonly<{
|
|
17
|
+
id: "jira.project.delete";
|
|
18
|
+
label: "Delete project";
|
|
19
|
+
action_type: "jira.project.delete";
|
|
20
|
+
risk: "critical";
|
|
21
|
+
receipt_required: true;
|
|
22
|
+
assurance_class: "quorum";
|
|
23
|
+
match: {
|
|
24
|
+
protocol: string;
|
|
25
|
+
tool: string;
|
|
26
|
+
};
|
|
27
|
+
why: "Deletes a project and its issues. Quorum.";
|
|
28
|
+
execution_binding: {
|
|
29
|
+
required_fields: string[];
|
|
30
|
+
};
|
|
31
|
+
}> | Readonly<{
|
|
32
|
+
id: "jira.permission.grant";
|
|
33
|
+
label: "Grant permission";
|
|
34
|
+
action_type: "jira.permission.grant";
|
|
35
|
+
risk: "critical";
|
|
36
|
+
receipt_required: true;
|
|
37
|
+
assurance_class: "quorum";
|
|
38
|
+
match: {
|
|
39
|
+
protocol: string;
|
|
40
|
+
tool: string;
|
|
41
|
+
};
|
|
42
|
+
why: "Changes who can act. Quorum + bind project/principal/role.";
|
|
43
|
+
execution_binding: {
|
|
44
|
+
required_fields: string[];
|
|
45
|
+
};
|
|
46
|
+
}>)[];
|
|
47
|
+
export declare const JIRA_OPS: readonly string[];
|
|
48
|
+
export declare function createJiraManifest(extra?: never[]): {
|
|
49
|
+
'@version': string;
|
|
50
|
+
actions: any[];
|
|
51
|
+
};
|
|
52
|
+
export declare function guardJiraMutation(gate: any, client: any, args: any): Promise<{
|
|
53
|
+
result: any;
|
|
54
|
+
reliance: any;
|
|
55
|
+
execution: any;
|
|
56
|
+
}>;
|
|
57
|
+
declare const _default: {
|
|
58
|
+
JIRA_ACTION_PACK: readonly (Readonly<{
|
|
59
|
+
id: "jira.issue.bulk_delete";
|
|
60
|
+
label: "Bulk delete issues";
|
|
61
|
+
action_type: "jira.issue.bulk_delete";
|
|
62
|
+
risk: "critical";
|
|
63
|
+
receipt_required: true;
|
|
64
|
+
assurance_class: "class_a";
|
|
65
|
+
match: {
|
|
66
|
+
protocol: string;
|
|
67
|
+
tool: string;
|
|
68
|
+
};
|
|
69
|
+
why: "Mass-destroys issues. Bind the exact JQL.";
|
|
70
|
+
execution_binding: {
|
|
71
|
+
required_fields: string[];
|
|
72
|
+
};
|
|
73
|
+
}> | Readonly<{
|
|
74
|
+
id: "jira.project.delete";
|
|
75
|
+
label: "Delete project";
|
|
76
|
+
action_type: "jira.project.delete";
|
|
77
|
+
risk: "critical";
|
|
78
|
+
receipt_required: true;
|
|
79
|
+
assurance_class: "quorum";
|
|
80
|
+
match: {
|
|
81
|
+
protocol: string;
|
|
82
|
+
tool: string;
|
|
83
|
+
};
|
|
84
|
+
why: "Deletes a project and its issues. Quorum.";
|
|
85
|
+
execution_binding: {
|
|
86
|
+
required_fields: string[];
|
|
87
|
+
};
|
|
88
|
+
}> | Readonly<{
|
|
89
|
+
id: "jira.permission.grant";
|
|
90
|
+
label: "Grant permission";
|
|
91
|
+
action_type: "jira.permission.grant";
|
|
92
|
+
risk: "critical";
|
|
93
|
+
receipt_required: true;
|
|
94
|
+
assurance_class: "quorum";
|
|
95
|
+
match: {
|
|
96
|
+
protocol: string;
|
|
97
|
+
tool: string;
|
|
98
|
+
};
|
|
99
|
+
why: "Changes who can act. Quorum + bind project/principal/role.";
|
|
100
|
+
execution_binding: {
|
|
101
|
+
required_fields: string[];
|
|
102
|
+
};
|
|
103
|
+
}>)[];
|
|
104
|
+
JIRA_OPS: readonly string[];
|
|
105
|
+
createJiraManifest: typeof createJiraManifest;
|
|
106
|
+
guardJiraMutation: typeof guardJiraMutation;
|
|
107
|
+
};
|
|
108
|
+
export default _default;
|
|
109
|
+
//# sourceMappingURL=jira.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jira.d.ts","sourceRoot":"","sources":["../../src/adapters/jira.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsB3B,CAAC;AAsBH,eAAO,MAAM,QAAQ,mBAAc,CAAC;AACpC,wBAAgB,kBAAkB,CAAC,KAAK,UAAK;;;EAAuD;AACpG,wBAAgB,iBAAiB,CAAC,IAAI,KAAA,EAAE,MAAM,KAAA,EAAE,IAAI,KAAA;;;;GAA+C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACnG,wBAAqF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* EMILIA Gate — Jira System-of-Record adapter.
|
|
4
|
+
* Guards bulk issue delete, project delete, and permission grants so they never
|
|
5
|
+
* reach Jira without a receipt bound to THIS resource. Client injected.
|
|
6
|
+
*/
|
|
7
|
+
import { createAdapter, manifestFromPack, hashCanonical } from './_kit.js';
|
|
8
|
+
export const JIRA_ACTION_PACK = Object.freeze([
|
|
9
|
+
Object.freeze({
|
|
10
|
+
id: 'jira.issue.bulk_delete', label: 'Bulk delete issues', action_type: 'jira.issue.bulk_delete',
|
|
11
|
+
risk: 'critical', receipt_required: true, assurance_class: 'class_a',
|
|
12
|
+
match: { protocol: 'jira', tool: 'bulk_delete_issues' },
|
|
13
|
+
why: 'Mass-destroys issues. Bind the exact JQL.',
|
|
14
|
+
execution_binding: { required_fields: ['action_type', 'project', 'jql_hash'] },
|
|
15
|
+
}),
|
|
16
|
+
Object.freeze({
|
|
17
|
+
id: 'jira.project.delete', label: 'Delete project', action_type: 'jira.project.delete',
|
|
18
|
+
risk: 'critical', receipt_required: true, assurance_class: 'quorum',
|
|
19
|
+
match: { protocol: 'jira', tool: 'delete_project' },
|
|
20
|
+
why: 'Deletes a project and its issues. Quorum.',
|
|
21
|
+
execution_binding: { required_fields: ['action_type', 'project_key'] },
|
|
22
|
+
}),
|
|
23
|
+
Object.freeze({
|
|
24
|
+
id: 'jira.permission.grant', label: 'Grant permission', action_type: 'jira.permission.grant',
|
|
25
|
+
risk: 'critical', receipt_required: true, assurance_class: 'quorum',
|
|
26
|
+
match: { protocol: 'jira', tool: 'grant_permission' },
|
|
27
|
+
why: 'Changes who can act. Quorum + bind project/principal/role.',
|
|
28
|
+
execution_binding: { required_fields: ['action_type', 'project', 'principal', 'role'] },
|
|
29
|
+
}),
|
|
30
|
+
]);
|
|
31
|
+
const OPS = {
|
|
32
|
+
'issue.bulk_delete': {
|
|
33
|
+
selector: { protocol: 'jira', tool: 'bulk_delete_issues' },
|
|
34
|
+
observed: (p) => ({ action_type: 'jira.issue.bulk_delete', project: p.project, jql_hash: hashCanonical(String(p.jql || '').trim()) }),
|
|
35
|
+
actuator: (p, observed) => ({ ...observed, jql: p.jql }),
|
|
36
|
+
perform: (c, p) => c.bulkDeleteIssues({ project: p.project, jql: p.jql }),
|
|
37
|
+
},
|
|
38
|
+
'project.delete': {
|
|
39
|
+
selector: { protocol: 'jira', tool: 'delete_project' },
|
|
40
|
+
observed: (p) => ({ action_type: 'jira.project.delete', project_key: p.project_key }),
|
|
41
|
+
perform: (c, p) => c.deleteProject({ projectKey: p.project_key }),
|
|
42
|
+
},
|
|
43
|
+
'permission.grant': {
|
|
44
|
+
selector: { protocol: 'jira', tool: 'grant_permission' },
|
|
45
|
+
observed: (p) => ({ action_type: 'jira.permission.grant', project: p.project, principal: p.principal, role: p.role }),
|
|
46
|
+
perform: (c, p) => c.grantPermission({ project: p.project, principal: p.principal, role: p.role }),
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
const adapter = createAdapter({ system: 'jira', ops: OPS });
|
|
50
|
+
export const JIRA_OPS = adapter.OPS;
|
|
51
|
+
export function createJiraManifest(extra = []) { return manifestFromPack(JIRA_ACTION_PACK, extra); }
|
|
52
|
+
export function guardJiraMutation(gate, client, args) { return adapter.guard(gate, client, args); }
|
|
53
|
+
export default { JIRA_ACTION_PACK, JIRA_OPS, createJiraManifest, guardJiraMutation };
|
|
54
|
+
//# sourceMappingURL=jira.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jira.js","sourceRoot":"","sources":["../../src/adapters/jira.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;GAIG;AACH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5C,MAAM,CAAC,MAAM,CAAC;QACZ,EAAE,EAAE,wBAAwB,EAAE,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,wBAAwB;QAChG,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS;QACpE,KAAK,EAAE,EAAE,QAAQ,E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CAAC,CAAC,IAAI,EAAE,CAAC;KACnG;CACF,CAAC;AAEF,MAAM,OAAO,GAAG,aAAa,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;AAC5D,MAAM,CAAC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;AACpC,MAAM,UAAU,kBAAkB,CAAC,KAAK,GAAG,EAAE,IAAI,OAAO,gBAAgB,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AACpG,MAAM,UAAU,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AACnG,eAAe,EAAE,gBAAgB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
export declare const K8S_ACTION_PACK: readonly (Readonly<{
|
|
2
|
+
id: "k8s.namespace.delete";
|
|
3
|
+
label: "Delete namespace";
|
|
4
|
+
action_type: "k8s.namespace.delete";
|
|
5
|
+
risk: "critical";
|
|
6
|
+
receipt_required: true;
|
|
7
|
+
assurance_class: "quorum";
|
|
8
|
+
match: {
|
|
9
|
+
protocol: string;
|
|
10
|
+
tool: string;
|
|
11
|
+
};
|
|
12
|
+
why: "Deletes an entire namespace and everything in it. Quorum.";
|
|
13
|
+
execution_binding: {
|
|
14
|
+
required_fields: string[];
|
|
15
|
+
};
|
|
16
|
+
}> | Readonly<{
|
|
17
|
+
id: "k8s.workload.delete";
|
|
18
|
+
label: "Delete workload";
|
|
19
|
+
action_type: "k8s.workload.delete";
|
|
20
|
+
risk: "high";
|
|
21
|
+
receipt_required: true;
|
|
22
|
+
assurance_class: "class_a";
|
|
23
|
+
match: {
|
|
24
|
+
protocol: string;
|
|
25
|
+
tool: string;
|
|
26
|
+
};
|
|
27
|
+
why: "Deletes a deployment/statefulset/job. Bind namespace+kind+name.";
|
|
28
|
+
execution_binding: {
|
|
29
|
+
required_fields: string[];
|
|
30
|
+
};
|
|
31
|
+
}> | Readonly<{
|
|
32
|
+
id: "k8s.rbac.bind";
|
|
33
|
+
label: "RBAC binding";
|
|
34
|
+
action_type: "k8s.rbac.bind";
|
|
35
|
+
risk: "critical";
|
|
36
|
+
receipt_required: true;
|
|
37
|
+
assurance_class: "quorum";
|
|
38
|
+
match: {
|
|
39
|
+
protocol: string;
|
|
40
|
+
tool: string;
|
|
41
|
+
};
|
|
42
|
+
why: "Grants cluster permissions. Privilege change → two-person rule.";
|
|
43
|
+
execution_binding: {
|
|
44
|
+
required_fields: string[];
|
|
45
|
+
};
|
|
46
|
+
}> | Readonly<{
|
|
47
|
+
id: "k8s.secret.delete";
|
|
48
|
+
label: "Delete secret";
|
|
49
|
+
action_type: "k8s.secret.delete";
|
|
50
|
+
risk: "high";
|
|
51
|
+
receipt_required: true;
|
|
52
|
+
assurance_class: "class_a";
|
|
53
|
+
match: {
|
|
54
|
+
protocol: string;
|
|
55
|
+
tool: string;
|
|
56
|
+
};
|
|
57
|
+
why: "Destroys a secret. Bind namespace+name.";
|
|
58
|
+
execution_binding: {
|
|
59
|
+
required_fields: string[];
|
|
60
|
+
};
|
|
61
|
+
}>)[];
|
|
62
|
+
export declare const K8S_OPS: readonly string[];
|
|
63
|
+
export declare function createK8sManifest(extraActions?: never[]): {
|
|
64
|
+
'@version': string;
|
|
65
|
+
actions: any[];
|
|
66
|
+
};
|
|
67
|
+
export declare function guardK8sMutation(gate: any, client: any, args: any): Promise<{
|
|
68
|
+
result: any;
|
|
69
|
+
reliance: any;
|
|
70
|
+
execution: any;
|
|
71
|
+
}>;
|
|
72
|
+
declare const _default: {
|
|
73
|
+
K8S_ACTION_PACK: readonly (Readonly<{
|
|
74
|
+
id: "k8s.namespace.delete";
|
|
75
|
+
label: "Delete namespace";
|
|
76
|
+
action_type: "k8s.namespace.delete";
|
|
77
|
+
risk: "critical";
|
|
78
|
+
receipt_required: true;
|
|
79
|
+
assurance_class: "quorum";
|
|
80
|
+
match: {
|
|
81
|
+
protocol: string;
|
|
82
|
+
tool: string;
|
|
83
|
+
};
|
|
84
|
+
why: "Deletes an entire namespace and everything in it. Quorum.";
|
|
85
|
+
execution_binding: {
|
|
86
|
+
required_fields: string[];
|
|
87
|
+
};
|
|
88
|
+
}> | Readonly<{
|
|
89
|
+
id: "k8s.workload.delete";
|
|
90
|
+
label: "Delete workload";
|
|
91
|
+
action_type: "k8s.workload.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 deployment/statefulset/job. Bind namespace+kind+name.";
|
|
100
|
+
execution_binding: {
|
|
101
|
+
required_fields: string[];
|
|
102
|
+
};
|
|
103
|
+
}> | Readonly<{
|
|
104
|
+
id: "k8s.rbac.bind";
|
|
105
|
+
label: "RBAC binding";
|
|
106
|
+
action_type: "k8s.rbac.bind";
|
|
107
|
+
risk: "critical";
|
|
108
|
+
receipt_required: true;
|
|
109
|
+
assurance_class: "quorum";
|
|
110
|
+
match: {
|
|
111
|
+
protocol: string;
|
|
112
|
+
tool: string;
|
|
113
|
+
};
|
|
114
|
+
why: "Grants cluster permissions. Privilege change → two-person rule.";
|
|
115
|
+
execution_binding: {
|
|
116
|
+
required_fields: string[];
|
|
117
|
+
};
|
|
118
|
+
}> | Readonly<{
|
|
119
|
+
id: "k8s.secret.delete";
|
|
120
|
+
label: "Delete secret";
|
|
121
|
+
action_type: "k8s.secret.delete";
|
|
122
|
+
risk: "high";
|
|
123
|
+
receipt_required: true;
|
|
124
|
+
assurance_class: "class_a";
|
|
125
|
+
match: {
|
|
126
|
+
protocol: string;
|
|
127
|
+
tool: string;
|
|
128
|
+
};
|
|
129
|
+
why: "Destroys a secret. Bind namespace+name.";
|
|
130
|
+
execution_binding: {
|
|
131
|
+
required_fields: string[];
|
|
132
|
+
};
|
|
133
|
+
}>)[];
|
|
134
|
+
K8S_OPS: readonly string[];
|
|
135
|
+
createK8sManifest: typeof createK8sManifest;
|
|
136
|
+
guardK8sMutation: typeof guardK8sMutation;
|
|
137
|
+
};
|
|
138
|
+
export default _default;
|
|
139
|
+
//# sourceMappingURL=k8s.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"k8s.d.ts","sourceRoot":"","sources":["../../src/adapters/k8s.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6B1B,CAAC;AA0BH,eAAO,MAAM,OAAO,mBAAc,CAAC;AACnC,wBAAgB,iBAAiB,CAAC,YAAY,UAAK;;;EAA6D;AAChH,wBAAgB,gBAAgB,CAAC,IAAI,KAAA,EAAE,MAAM,KAAA,EAAE,IAAI,KAAA;;;;GAA+C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAClG,wBAAiF"}
|