@europeum-ebsi/cli 0.0.0 → 1.0.0-rc.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/LICENSE.txt +289 -289
- package/LICENSES.txt +538 -0
- package/README.md +1140 -98
- package/dist/api/client.d.ts +4 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +14 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/fetch.d.ts +13 -0
- package/dist/api/fetch.d.ts.map +1 -0
- package/dist/api/fetch.js +30 -0
- package/dist/api/fetch.js.map +1 -0
- package/dist/api/params.d.ts +4 -0
- package/dist/api/params.d.ts.map +1 -0
- package/dist/api/params.js +9 -0
- package/dist/api/params.js.map +1 -0
- package/dist/auth/dcql.d.ts +5 -0
- package/dist/auth/dcql.d.ts.map +1 -0
- package/dist/auth/dcql.js +41 -0
- package/dist/auth/dcql.js.map +1 -0
- package/dist/auth/presentation.d.ts +30 -0
- package/dist/auth/presentation.d.ts.map +1 -0
- package/dist/auth/presentation.js +99 -0
- package/dist/auth/presentation.js.map +1 -0
- package/dist/auth/token.d.ts +11 -0
- package/dist/auth/token.d.ts.map +1 -0
- package/dist/auth/token.js +116 -0
- package/dist/auth/token.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +96 -10
- package/dist/cli.js.map +1 -1
- package/dist/commands/auth.d.ts +3 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +99 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/config-cmd.d.ts +3 -0
- package/dist/commands/config-cmd.d.ts.map +1 -0
- package/dist/commands/config-cmd.js +86 -0
- package/dist/commands/config-cmd.js.map +1 -0
- package/dist/commands/contracts-registry.d.ts +3 -0
- package/dist/commands/contracts-registry.d.ts.map +1 -0
- package/dist/commands/contracts-registry.js +132 -0
- package/dist/commands/contracts-registry.js.map +1 -0
- package/dist/commands/did-registry.d.ts +3 -0
- package/dist/commands/did-registry.d.ts.map +1 -0
- package/dist/commands/did-registry.js +110 -0
- package/dist/commands/did-registry.js.map +1 -0
- package/dist/commands/faucet.d.ts +3 -0
- package/dist/commands/faucet.d.ts.map +1 -0
- package/dist/commands/faucet.js +78 -0
- package/dist/commands/faucet.js.map +1 -0
- package/dist/commands/health.d.ts +3 -0
- package/dist/commands/health.d.ts.map +1 -0
- package/dist/commands/health.js +20 -0
- package/dist/commands/health.js.map +1 -0
- package/dist/commands/issuers-registry.d.ts +3 -0
- package/dist/commands/issuers-registry.d.ts.map +1 -0
- package/dist/commands/issuers-registry.js +340 -0
- package/dist/commands/issuers-registry.js.map +1 -0
- package/dist/commands/ledger.d.ts +3 -0
- package/dist/commands/ledger.d.ts.map +1 -0
- package/dist/commands/ledger.js +549 -372
- package/dist/commands/ledger.js.map +1 -1
- package/dist/commands/onboarding.d.ts +3 -0
- package/dist/commands/onboarding.d.ts.map +1 -0
- package/dist/commands/onboarding.js +301 -0
- package/dist/commands/onboarding.js.map +1 -0
- package/dist/commands/openapi.d.ts +3 -0
- package/dist/commands/openapi.d.ts.map +1 -0
- package/dist/commands/openapi.js +37 -0
- package/dist/commands/openapi.js.map +1 -0
- package/dist/commands/policies-registry.d.ts +3 -0
- package/dist/commands/policies-registry.d.ts.map +1 -0
- package/dist/commands/policies-registry.js +198 -0
- package/dist/commands/policies-registry.js.map +1 -0
- package/dist/commands/registry.d.ts +27 -0
- package/dist/commands/registry.d.ts.map +1 -0
- package/dist/commands/registry.js +62 -0
- package/dist/commands/registry.js.map +1 -0
- package/dist/commands/schemas-registry.d.ts +3 -0
- package/dist/commands/schemas-registry.d.ts.map +1 -0
- package/dist/commands/schemas-registry.js +231 -0
- package/dist/commands/schemas-registry.js.map +1 -0
- package/dist/commands/shared/args.d.ts +2 -0
- package/dist/commands/shared/args.d.ts.map +1 -0
- package/dist/commands/shared/args.js +4 -0
- package/dist/commands/shared/args.js.map +1 -0
- package/dist/commands/shared/wallet-opts.d.ts +9 -0
- package/dist/commands/shared/wallet-opts.d.ts.map +1 -0
- package/dist/commands/shared/wallet-opts.js +44 -0
- package/dist/commands/shared/wallet-opts.js.map +1 -0
- package/dist/commands/timestamp.d.ts +3 -0
- package/dist/commands/timestamp.d.ts.map +1 -0
- package/dist/commands/timestamp.js +250 -0
- package/dist/commands/timestamp.js.map +1 -0
- package/dist/commands/track-and-trace.d.ts +3 -0
- package/dist/commands/track-and-trace.d.ts.map +1 -0
- package/dist/commands/track-and-trace.js +235 -0
- package/dist/commands/track-and-trace.js.map +1 -0
- package/dist/commands/wallet.d.ts +3 -0
- package/dist/commands/wallet.d.ts.map +1 -0
- package/dist/commands/wallet.js +123 -0
- package/dist/commands/wallet.js.map +1 -0
- package/dist/config/config.d.ts +45 -0
- package/dist/config/config.d.ts.map +1 -0
- package/dist/config/config.js +111 -0
- package/dist/config/config.js.map +1 -0
- package/dist/config/ebsi-env.d.ts +4 -0
- package/dist/config/ebsi-env.d.ts.map +1 -0
- package/dist/config/ebsi-env.js +37 -0
- package/dist/config/ebsi-env.js.map +1 -0
- package/dist/crypto/wallet.d.ts +34 -0
- package/dist/crypto/wallet.d.ts.map +1 -0
- package/dist/crypto/wallet.js +100 -0
- package/dist/crypto/wallet.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -6
- package/dist/index.js.map +1 -1
- package/dist/ledger/read.d.ts +11 -0
- package/dist/ledger/read.d.ts.map +1 -0
- package/dist/ledger/read.js +24 -0
- package/dist/ledger/read.js.map +1 -0
- package/dist/ledger/registries.d.ts +25 -0
- package/dist/ledger/registries.d.ts.map +1 -0
- package/dist/ledger/registries.js +111 -0
- package/dist/ledger/registries.js.map +1 -0
- package/dist/ledger/write.d.ts +43 -0
- package/dist/ledger/write.d.ts.map +1 -0
- package/dist/ledger/write.js +119 -0
- package/dist/ledger/write.js.map +1 -0
- package/dist/onboarding/vc.d.ts +18 -0
- package/dist/onboarding/vc.d.ts.map +1 -0
- package/dist/onboarding/vc.js +72 -0
- package/dist/onboarding/vc.js.map +1 -0
- package/dist/output/format.d.ts +7 -0
- package/dist/output/format.d.ts.map +1 -0
- package/dist/output/format.js +94 -0
- package/dist/output/format.js.map +1 -0
- package/dist/tui/App.d.ts +3 -0
- package/dist/tui/App.d.ts.map +1 -0
- package/dist/tui/App.js +99 -0
- package/dist/tui/App.js.map +1 -0
- package/dist/tui/CommandPalette.d.ts +8 -0
- package/dist/tui/CommandPalette.d.ts.map +1 -0
- package/dist/tui/CommandPalette.js +105 -0
- package/dist/tui/CommandPalette.js.map +1 -0
- package/package.json +66 -108
- package/src/api/client.ts +26 -0
- package/src/api/fetch.ts +53 -0
- package/src/api/params.ts +17 -0
- package/src/auth/dcql.ts +84 -0
- package/src/auth/presentation.ts +255 -0
- package/src/auth/token.ts +244 -0
- package/src/cli.ts +164 -0
- package/src/commands/auth.ts +119 -0
- package/src/commands/config-cmd.ts +122 -0
- package/src/commands/contracts-registry.ts +156 -0
- package/src/commands/did-registry.ts +126 -0
- package/src/commands/faucet.ts +112 -0
- package/src/commands/health.ts +21 -0
- package/src/commands/issuers-registry.ts +385 -0
- package/src/commands/ledger.ts +777 -0
- package/src/commands/onboarding.ts +411 -0
- package/src/commands/openapi.ts +42 -0
- package/src/commands/policies-registry.ts +218 -0
- package/src/commands/registry.ts +152 -0
- package/src/commands/schemas-registry.ts +255 -0
- package/src/commands/shared/args.ts +14 -0
- package/src/commands/shared/wallet-opts.ts +85 -0
- package/src/commands/timestamp.ts +272 -0
- package/src/commands/track-and-trace.ts +263 -0
- package/src/commands/wallet.ts +175 -0
- package/src/config/config.ts +275 -0
- package/src/config/ebsi-env.ts +67 -0
- package/src/crypto/wallet.ts +291 -0
- package/src/index.ts +24 -0
- package/src/ledger/read.ts +70 -0
- package/src/ledger/registries.ts +285 -0
- package/src/ledger/write.ts +381 -0
- package/src/onboarding/vc.ts +205 -0
- package/src/output/format.ts +157 -0
- package/src/tui/App.tsx +282 -0
- package/src/tui/CommandPalette.tsx +223 -0
- package/bin/cli.js +0 -13
- package/dist/abi/pilot/DidRegistry.js +0 -568
- package/dist/abi/pilot/DidRegistry.js.map +0 -1
- package/dist/abi/pilot/Ptr.js +0 -666
- package/dist/abi/pilot/Ptr.js.map +0 -1
- package/dist/abi/pilot/SchemaSCRegistry.js +0 -264
- package/dist/abi/pilot/SchemaSCRegistry.js.map +0 -1
- package/dist/abi/pilot/Tcr.js +0 -715
- package/dist/abi/pilot/Tcr.js.map +0 -1
- package/dist/abi/pilot/Timestamp.js +0 -658
- package/dist/abi/pilot/Timestamp.js.map +0 -1
- package/dist/abi/pilot/Tir.js +0 -428
- package/dist/abi/pilot/Tir.js.map +0 -1
- package/dist/abi/pilot/TnT.js +0 -842
- package/dist/abi/pilot/TnT.js.map +0 -1
- package/dist/abi/pilot/Tpr.js +0 -492
- package/dist/abi/pilot/Tpr.js.map +0 -1
- package/dist/abi/test/DidRegistry.js +0 -568
- package/dist/abi/test/DidRegistry.js.map +0 -1
- package/dist/abi/test/Ptr.js +0 -666
- package/dist/abi/test/Ptr.js.map +0 -1
- package/dist/abi/test/SchemaSCRegistry.js +0 -300
- package/dist/abi/test/SchemaSCRegistry.js.map +0 -1
- package/dist/abi/test/Tcr.js +0 -715
- package/dist/abi/test/Tcr.js.map +0 -1
- package/dist/abi/test/Timestamp.js +0 -658
- package/dist/abi/test/Timestamp.js.map +0 -1
- package/dist/abi/test/Tir.js +0 -428
- package/dist/abi/test/Tir.js.map +0 -1
- package/dist/abi/test/TnT.js +0 -842
- package/dist/abi/test/TnT.js.map +0 -1
- package/dist/abi/test/Tpr.js +0 -492
- package/dist/abi/test/Tpr.js.map +0 -1
- package/dist/app.js +0 -659
- package/dist/app.js.map +0 -1
- package/dist/buildParam/didr.js +0 -374
- package/dist/buildParam/didr.js.map +0 -1
- package/dist/buildParam/index.js +0 -53
- package/dist/buildParam/index.js.map +0 -1
- package/dist/buildParam/ptr.js +0 -80
- package/dist/buildParam/ptr.js.map +0 -1
- package/dist/buildParam/tcr.js +0 -36
- package/dist/buildParam/tcr.js.map +0 -1
- package/dist/buildParam/timestamp.js +0 -350
- package/dist/buildParam/timestamp.js.map +0 -1
- package/dist/buildParam/tir.js +0 -110
- package/dist/buildParam/tir.js.map +0 -1
- package/dist/buildParam/tnt.js +0 -214
- package/dist/buildParam/tnt.js.map +0 -1
- package/dist/buildParam/tpr.js +0 -91
- package/dist/buildParam/tpr.js.map +0 -1
- package/dist/buildParam/tsr.js +0 -115
- package/dist/buildParam/tsr.js.map +0 -1
- package/dist/commands/authorisation.js +0 -144
- package/dist/commands/authorisation.js.map +0 -1
- package/dist/commands/compute.js +0 -680
- package/dist/commands/compute.js.map +0 -1
- package/dist/commands/conformance.js +0 -813
- package/dist/commands/conformance.js.map +0 -1
- package/dist/commands/hardwarewallet.js +0 -41
- package/dist/commands/hardwarewallet.js.map +0 -1
- package/dist/commands/index.js +0 -8
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/ptr.js +0 -54
- package/dist/commands/ptr.js.map +0 -1
- package/dist/commands/tcr.js +0 -50
- package/dist/commands/tcr.js.map +0 -1
- package/dist/commands/tir.js +0 -64
- package/dist/commands/tir.js.map +0 -1
- package/dist/commands/tnl.js +0 -81
- package/dist/commands/tnl.js.map +0 -1
- package/dist/commands/tsr.js +0 -45
- package/dist/commands/tsr.js.map +0 -1
- package/dist/commands/view.js +0 -53
- package/dist/commands/view.js.map +0 -1
- package/dist/config.js +0 -497
- package/dist/config.js.map +0 -1
- package/dist/interfaces/context.js +0 -2
- package/dist/interfaces/context.js.map +0 -1
- package/dist/interfaces/contracts/ProxyFactory.js +0 -2
- package/dist/interfaces/contracts/ProxyFactory.js.map +0 -1
- package/dist/interfaces/contracts/ProxyTemplateRegistry.js +0 -2
- package/dist/interfaces/contracts/ProxyTemplateRegistry.js.map +0 -1
- package/dist/interfaces/contracts/SchemaSCRegistry.js +0 -2
- package/dist/interfaces/contracts/SchemaSCRegistry.js.map +0 -1
- package/dist/interfaces/contracts/common.js +0 -2
- package/dist/interfaces/contracts/common.js.map +0 -1
- package/dist/interfaces/index.js +0 -5
- package/dist/interfaces/index.js.map +0 -1
- package/dist/interfaces/jsonrpc.interface.js +0 -2
- package/dist/interfaces/jsonrpc.interface.js.map +0 -1
- package/dist/interfaces/paginated-list.interface.js +0 -2
- package/dist/interfaces/paginated-list.interface.js.map +0 -1
- package/dist/interfaces/unsigned-transaction.interface.js +0 -2
- package/dist/interfaces/unsigned-transaction.interface.js.map +0 -1
- package/dist/interfaces/utils.interface.js +0 -2
- package/dist/interfaces/utils.interface.js.map +0 -1
- package/dist/programs/migrateDid.js +0 -159
- package/dist/programs/migrateDid.js.map +0 -1
- package/dist/programs/migrateDids.js +0 -232
- package/dist/programs/migrateDids.js.map +0 -1
- package/dist/programs/migrateTsr.js +0 -201
- package/dist/programs/migrateTsr.js.map +0 -1
- package/dist/scripts/accreditAndAuthorize/conformance/step1 +0 -34
- package/dist/scripts/accreditAndAuthorize/conformance/step2 +0 -18
- package/dist/scripts/accreditAndAuthorize/conformance/step3 +0 -9
- package/dist/scripts/accreditAndAuthorize/conformance/step4 +0 -27
- package/dist/scripts/accreditAndAuthorize/conformance/step5 +0 -13
- package/dist/scripts/accreditAndAuthorize/conformance/step6 +0 -14
- package/dist/scripts/accreditAndAuthorize/conformance/step7 +0 -7
- package/dist/scripts/accreditAndAuthorize/test/step1 +0 -34
- package/dist/scripts/accreditAndAuthorize/test/step2 +0 -18
- package/dist/scripts/accreditAndAuthorize/test/step3 +0 -9
- package/dist/scripts/accreditAndAuthorize/test/step4 +0 -27
- package/dist/scripts/accreditAndAuthorize/test/step5 +0 -13
- package/dist/scripts/accreditAndAuthorize/test/step6 +0 -14
- package/dist/scripts/accreditAndAuthorize/test/step7 +0 -7
- package/dist/scripts/accreditTI +0 -21
- package/dist/scripts/assets/Nodes.json +0 -27
- package/dist/scripts/assets/vcdm1.1/CTRevocableCredential.json +0 -30
- package/dist/scripts/assets/vcdm1.1/CredentialToAttestVerifiableAuthorisationForTrustChain.json +0 -29
- package/dist/scripts/assets/vcdm1.1/Nodes.json +0 -27
- package/dist/scripts/assets/vcdm1.1/TrustedNodesList.json +0 -35
- package/dist/scripts/assets/vcdm1.1/VerifiableAccreditationToAccredit.json +0 -35
- package/dist/scripts/assets/vcdm1.1/VerifiableAccreditationToAttest.json +0 -33
- package/dist/scripts/assets/vcdm1.1/VerifiableAuthorisationForTrustChain.json +0 -22
- package/dist/scripts/assets/vcdm1.1/VerifiableAuthorisationToInvoke.json +0 -24
- package/dist/scripts/assets/vcdm1.1/VerifiableAuthorisationToOnboard.json +0 -24
- package/dist/scripts/assets/vcdm2.0/CredentialToAttestVerifiableAuthorisationForTrustChain.json +0 -29
- package/dist/scripts/assets/vcdm2.0/TrustedNodesList.json +0 -36
- package/dist/scripts/assets/vcdm2.0/VerifiableAccreditationToAccredit.json +0 -40
- package/dist/scripts/assets/vcdm2.0/VerifiableAccreditationToAttest.json +0 -38
- package/dist/scripts/assets/vcdm2.0/VerifiableAuthorisationForTrustChain.json +0 -30
- package/dist/scripts/assets/vcdm2.0/VerifiableAuthorisationToInvoke.json +0 -24
- package/dist/scripts/assets/vcdm2.0/VerifiableAuthorisationToOnboard.json +0 -23
- package/dist/scripts/bootstrap/0a-loadTPROperator +0 -5
- package/dist/scripts/bootstrap/0b-loadAdmin +0 -8
- package/dist/scripts/bootstrap/1-populateTPR +0 -92
- package/dist/scripts/bootstrap/2-populateDID +0 -6
- package/dist/scripts/bootstrap/3-populateTimestamp +0 -9
- package/dist/scripts/bootstrap/4-populateTIR +0 -8
- package/dist/scripts/bootstrap/5-populateTSR +0 -85
- package/dist/scripts/bootstrap/6-setupConformanceIssuer +0 -35
- package/dist/scripts/bootstrap/README.md +0 -218
- package/dist/scripts/issueVcInvoke +0 -10
- package/dist/scripts/issueVcOnboard +0 -9
- package/dist/scripts/issueVcRootTAO +0 -11
- package/dist/scripts/issueVcTAO +0 -12
- package/dist/scripts/issueVcTI +0 -12
- package/dist/scripts/issueVcTnl +0 -32
- package/dist/scripts/issue_CTRevocableCredential +0 -12
- package/dist/scripts/issue_SelfAttestationSupportOffice +0 -10
- package/dist/scripts/issue_VerifiableAccreditationToAccredit +0 -11
- package/dist/scripts/issue_VerifiableAccreditationToAttest +0 -11
- package/dist/scripts/issue_VerifiableAuthorisationForTrustChain +0 -10
- package/dist/scripts/issue_VerifiableAuthorisationToOnboard +0 -9
- package/dist/scripts/preregisterIssuer +0 -6
- package/dist/scripts/registerDidDocument +0 -15
- package/dist/scripts/registerIssuer +0 -6
- package/dist/scripts/updateVcRootTAO +0 -10
- package/dist/scripts/updateVcTAO +0 -11
- package/dist/scripts/updateVcTI +0 -11
- package/dist/scripts/vcdm2.0/issueSelfAttestationSupportOffice +0 -10
- package/dist/scripts/vcdm2.0/issueVcInvoke +0 -12
- package/dist/scripts/vcdm2.0/issueVcOnboard +0 -11
- package/dist/scripts/vcdm2.0/issueVcRootTAO +0 -14
- package/dist/scripts/vcdm2.0/issueVcTAO +0 -15
- package/dist/scripts/vcdm2.0/issueVcTI +0 -15
- package/dist/scripts/vcdm2.0/issueVcTnl +0 -34
- package/dist/scripts/vcdm2.0/registerDidDocument +0 -15
- package/dist/scripts/vcdm2.0/updateVcRootTAO +0 -13
- package/dist/scripts/vcdm2.0/updateVcTAO +0 -14
- package/dist/scripts/vcdm2.0/updateVcTI +0 -14
- package/dist/scripts/vcdm2.0/verifyVcTnl +0 -10
- package/dist/scripts/verifyVcTnl +0 -10
- package/dist/scripts/wct/accreditAndAuthorize +0 -133
- package/dist/scripts/wct/accreditAndAuthorize2 +0 -89
- package/dist/scripts/wct/holderWallet +0 -39
- package/dist/scripts/wct/holderWallet2 +0 -39
- package/dist/scripts/wct/issueToHolder +0 -38
- package/dist/scripts/wct/issueToHolder2 +0 -38
- package/dist/scripts/wct/pda1 +0 -3
- package/dist/scripts/wct/verifier +0 -8
- package/dist/scripts/wct/verifier2 +0 -7
- package/dist/utils/Client.js +0 -155
- package/dist/utils/Client.js.map +0 -1
- package/dist/utils/HardwareWallet.js +0 -326
- package/dist/utils/HardwareWallet.js.map +0 -1
- package/dist/utils/http.js +0 -132
- package/dist/utils/http.js.map +0 -1
- package/dist/utils/index.js +0 -8
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/jsonrpc.js +0 -38
- package/dist/utils/jsonrpc.js.map +0 -1
- package/dist/utils/print.js +0 -56
- package/dist/utils/print.js.map +0 -1
- package/dist/utils/utils.js +0 -427
- package/dist/utils/utils.js.map +0 -1
- package/dist/utils/vcdm.js +0 -47
- package/dist/utils/vcdm.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandPalette.js","sourceRoot":"","sources":["../../src/tui/CommandPalette.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAI7D,OAAO,EACL,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,UAAU,GACX,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,UAAU,GAAG,MAAM,CAAC;AAC1B,MAAM,WAAW,GAAG,MAAM,CAAC;AAC3B,MAAM,SAAS,GAAG,QAAQ,CAAC;AAC3B,MAAM,WAAW,GAAG,MAAM,CAAC;AAe3B,MAAM,UAAU,cAAc,CAAC,EAC7B,QAAQ,GACY;IACpB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACvC,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACtD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAA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AAO,CAAC,CAAC,CAAC,GAAG,GAC3C,IACH,CACP,EAGD,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,kBAE7B,sEAAsE,GAEnE,GACH,IACF,CACP,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,121 +1,79 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@europeum-ebsi/cli",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"description": "EBSI
|
|
3
|
+
"version": "1.0.0-rc.0",
|
|
4
|
+
"description": "EBSI CLI",
|
|
5
5
|
"license": "EUPL-1.2",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"bin",
|
|
11
|
-
"dist"
|
|
12
|
-
],
|
|
13
|
-
"publishConfig": {
|
|
14
|
-
"access": "public"
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://gitlab.com/europeum/public/core.git",
|
|
9
|
+
"directory": "cli"
|
|
15
10
|
},
|
|
11
|
+
"type": "module",
|
|
16
12
|
"bin": {
|
|
17
|
-
"
|
|
13
|
+
"ebsi": "./dist/index.js"
|
|
18
14
|
},
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"build": "rimraf dist && tsc --project tsconfig.build.json && cpy . ../../dist/scripts --cwd=src/scripts",
|
|
22
|
-
"dev": "node --loader ts-node/esm src/cli.ts",
|
|
23
|
-
"lint-staged": "lint-staged",
|
|
24
|
-
"lint": "pnpm run lint:eslint && pnpm run lint:tsc && pnpm run lint:prettier",
|
|
25
|
-
"lint:eslint": "eslint . --ext .js,.mjs,.cjs,.ts",
|
|
26
|
-
"lint:tsc": "tsc --noEmit --incremental false",
|
|
27
|
-
"lint:prettier": "prettier . --check",
|
|
28
|
-
"prepare": "husky && pnpm run build",
|
|
29
|
-
"prepare:release": "release-it --ci",
|
|
30
|
-
"program:migrate": "ts-node --esm src/programs/migrateDids.ts",
|
|
31
|
-
"program:migrateTsr": "node --loader ts-node/esm src/programs/migrateTsr.ts",
|
|
32
|
-
"start": "node dist/cli",
|
|
33
|
-
"test": "vitest --run",
|
|
34
|
-
"test:ci": "vitest --run unit",
|
|
35
|
-
"test:authorisation": "vitest --run authorisation.spec.ts",
|
|
36
|
-
"test:did": "vitest --run did.spec.ts",
|
|
37
|
-
"test:essentials": "vitest --run essentials.spec.ts",
|
|
38
|
-
"test:ledger": "vitest --run ledger.spec.ts",
|
|
39
|
-
"test:tar": "vitest --run tar.spec.ts",
|
|
40
|
-
"test:timestamp": "vitest --run timestamp.spec.ts",
|
|
41
|
-
"test:tir": "vitest --run tir.spec.ts",
|
|
42
|
-
"test:tnt": "vitest --run tnt.spec.ts",
|
|
43
|
-
"test:tpr": "vitest --run tpr.spec.ts",
|
|
44
|
-
"test:tsr": "vitest --run tsr.spec.ts",
|
|
45
|
-
"test:accredit-and-authorize": "vitest --run accredit-and-authorize.spec.ts",
|
|
46
|
-
"test:holder-wallet": "vitest --run holder-wallet.spec.ts",
|
|
47
|
-
"test:issue-to-holder": "vitest --run issue-to-holder.spec.ts",
|
|
48
|
-
"test:verifier": "vitest --run verifier.spec.ts",
|
|
49
|
-
"test:pda1": "vitest --run pda1.spec.ts",
|
|
50
|
-
"test:trust-model": "vitest --run trust-model-vcdm2.spec.ts",
|
|
51
|
-
"knip": "knip"
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
52
17
|
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"LICENSES.txt",
|
|
21
|
+
"src"
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"europeum",
|
|
25
|
+
"ebsi",
|
|
26
|
+
"cli"
|
|
27
|
+
],
|
|
53
28
|
"dependencies": {
|
|
54
|
-
"@
|
|
55
|
-
"@europeum-ebsi/did-jwt": "0.0.0",
|
|
56
|
-
"@europeum-ebsi/
|
|
57
|
-
"@europeum-ebsi/
|
|
58
|
-
"@europeum-ebsi/
|
|
59
|
-
"@europeum-ebsi/
|
|
60
|
-
"@europeum-ebsi/
|
|
61
|
-
"@
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"jose": "
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"qs": "6.15.0"
|
|
77
|
-
},
|
|
78
|
-
"optionalDependencies": {
|
|
79
|
-
"graphene-pk11": "2.3.6"
|
|
29
|
+
"@europeum-ebsi/api-contract": "1.0.0-rc.0",
|
|
30
|
+
"@europeum-ebsi/did-jwt": "1.0.0-rc.0",
|
|
31
|
+
"@europeum-ebsi/did-registry-contract": "1.0.0-rc.0",
|
|
32
|
+
"@europeum-ebsi/ebsi-uri": "1.0.0-rc.0",
|
|
33
|
+
"@europeum-ebsi/issuers-registry-contract": "1.0.0-rc.0",
|
|
34
|
+
"@europeum-ebsi/policies-registry-contract": "1.0.0-rc.0",
|
|
35
|
+
"@europeum-ebsi/schemas-registry-contract": "1.0.0-rc.0",
|
|
36
|
+
"@europeum-ebsi/timestamp-contract": "1.0.0-rc.0",
|
|
37
|
+
"@europeum-ebsi/track-and-trace-contract": "1.0.0-rc.0",
|
|
38
|
+
"@europeum-ebsi/vcdm1.1-attestation-schema": "0.0.0",
|
|
39
|
+
"@europeum-ebsi/verifiable-credential": "1.0.0-rc.0",
|
|
40
|
+
"@europeum-ebsi/verifiable-presentation": "1.0.0-rc.0",
|
|
41
|
+
"@europeum-ebsi/wallet": "1.0.0-rc.0",
|
|
42
|
+
"commander": "15.0.0",
|
|
43
|
+
"env-paths": "4.0.0",
|
|
44
|
+
"ethers": "6.17.0",
|
|
45
|
+
"ink": "7.1.1",
|
|
46
|
+
"ink-text-input": "6.0.0",
|
|
47
|
+
"jose": "5.10.0",
|
|
48
|
+
"openapi-fetch": "0.17.0",
|
|
49
|
+
"picocolors": "1.1.1",
|
|
50
|
+
"react": "19.3.0"
|
|
80
51
|
},
|
|
81
52
|
"devDependencies": {
|
|
82
|
-
"@
|
|
83
|
-
"@
|
|
84
|
-
"@eslint/js": "10.0.1",
|
|
85
|
-
"@release-it/conventional-changelog": "10.0.6",
|
|
86
|
-
"@sphereon/pex-models": "2.3.2",
|
|
87
|
-
"@total-typescript/ts-reset": "0.6.1",
|
|
88
|
-
"@tsconfig/node24": "24.0.4",
|
|
53
|
+
"@nomicfoundation/hardhat-ethers": "4.1.0",
|
|
54
|
+
"@tsconfig/node24": "24.0.5",
|
|
89
55
|
"@tsconfig/strictest": "2.0.8",
|
|
90
|
-
"@types/
|
|
91
|
-
"@types/
|
|
92
|
-
"@
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"@vitest/eslint-plugin": "1.6.14",
|
|
96
|
-
"audit-ci": "7.1.0",
|
|
97
|
-
"cpy-cli": "7.0.0",
|
|
98
|
-
"eslint": "10.2.0",
|
|
99
|
-
"eslint-config-prettier": "10.1.8",
|
|
100
|
-
"eslint-import-resolver-typescript": "4.4.4",
|
|
101
|
-
"eslint-plugin-import-x": "4.16.2",
|
|
102
|
-
"eslint-plugin-perfectionist": "5.8.0",
|
|
103
|
-
"eslint-plugin-prettier": "5.5.5",
|
|
104
|
-
"eslint-plugin-regexp": "3.1.0",
|
|
105
|
-
"eslint-plugin-unicorn": "64.0.0",
|
|
106
|
-
"globals": "17.4.0",
|
|
107
|
-
"husky": "9.1.7",
|
|
108
|
-
"knip": "6.3.0",
|
|
109
|
-
"lint-staged": "16.4.0",
|
|
110
|
-
"prettier": "3.8.1",
|
|
111
|
-
"read-pkg": "10.1.0",
|
|
112
|
-
"release-it": "19.2.4",
|
|
56
|
+
"@types/node": "24.13.6",
|
|
57
|
+
"@types/react": "19.3.0",
|
|
58
|
+
"@vitest/coverage-v8": "5.0.1",
|
|
59
|
+
"get-port": "7.2.0",
|
|
60
|
+
"hardhat": "3.17.0",
|
|
113
61
|
"rimraf": "6.1.3",
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"typescript-eslint": "8.58.0",
|
|
118
|
-
"vitest": "4.1.2"
|
|
62
|
+
"typescript": "6.0.3",
|
|
63
|
+
"vite": "8.3.0",
|
|
64
|
+
"vitest": "5.0.1"
|
|
119
65
|
},
|
|
120
|
-
"
|
|
121
|
-
|
|
66
|
+
"scripts": {
|
|
67
|
+
"build": "tsc -p tsconfig/tsconfig.build.esm.json",
|
|
68
|
+
"clean": "rimraf coverage dist",
|
|
69
|
+
"coverage": "pnpm run test:unit --coverage --reporter=default",
|
|
70
|
+
"lint": "pnpm run lint:tsc",
|
|
71
|
+
"lint:tsc": "tsc --noEmit --incremental false",
|
|
72
|
+
"setup": "exit 0",
|
|
73
|
+
"test": "vitest --run",
|
|
74
|
+
"test:ci": "pnpm run coverage && pnpm run test:integration",
|
|
75
|
+
"test:e2e": "echo \"Info: there's no e2e tests for @europeum-ebsi/cli\" && exit 0",
|
|
76
|
+
"test:integration": "pnpm run test integration",
|
|
77
|
+
"test:unit": "pnpm run test unit"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { paths } from "@europeum-ebsi/api-contract/types";
|
|
2
|
+
|
|
3
|
+
import createClient from "openapi-fetch";
|
|
4
|
+
|
|
5
|
+
export type ApiClient = ReturnType<typeof makeClient>;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Creates a type-safe openapi-fetch client bound to the given base URL.
|
|
9
|
+
* The base URL must already include the `/v1` prefix (e.g. "https://api-test.testnode02.ebsi.eu/v1").
|
|
10
|
+
*
|
|
11
|
+
* When a Bearer `token` is provided every request will include an
|
|
12
|
+
* `Authorization: Bearer <token>` header. This is needed for write methods on
|
|
13
|
+
* `POST /ledger` (e.g. `eth_sendRawTransaction`).
|
|
14
|
+
*/
|
|
15
|
+
export function makeClient(baseUrl: string, token?: string) {
|
|
16
|
+
const client = createClient<paths>({ baseUrl });
|
|
17
|
+
if (token) {
|
|
18
|
+
client.use({
|
|
19
|
+
onRequest({ request }) {
|
|
20
|
+
request.headers.set("Authorization", `Bearer ${token}`);
|
|
21
|
+
return request;
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return client;
|
|
26
|
+
}
|
package/src/api/fetch.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { CliConfig } from "../config/config.ts";
|
|
2
|
+
|
|
3
|
+
import { makeClient } from "./client.ts";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Cached client instances keyed by `baseUrl\0token`
|
|
7
|
+
*/
|
|
8
|
+
const clients = new Map<string, ReturnType<typeof makeClient>>();
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents a failed API response
|
|
12
|
+
*/
|
|
13
|
+
export class ApiError extends Error {
|
|
14
|
+
readonly detail: unknown;
|
|
15
|
+
readonly status: number;
|
|
16
|
+
|
|
17
|
+
constructor(status: number, detail: unknown) {
|
|
18
|
+
const message =
|
|
19
|
+
typeof detail === "object" && detail !== null && "title" in detail
|
|
20
|
+
? String((detail as Record<string, unknown>)["title"])
|
|
21
|
+
: `HTTP ${status}`;
|
|
22
|
+
super(message);
|
|
23
|
+
this.name = "ApiError";
|
|
24
|
+
this.status = status;
|
|
25
|
+
this.detail = detail;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function getClient(config: CliConfig) {
|
|
30
|
+
const cacheKey = `${config.baseUrl}\0${config.token ?? ""}`;
|
|
31
|
+
const existing = clients.get(cacheKey);
|
|
32
|
+
if (existing) return existing;
|
|
33
|
+
const client = makeClient(config.baseUrl, config.token);
|
|
34
|
+
clients.set(cacheKey, client);
|
|
35
|
+
return client;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Unwraps an openapi-fetch result, throwing ApiError on any non-2xx response
|
|
40
|
+
* or network error.
|
|
41
|
+
*/
|
|
42
|
+
export function unwrap<T>({
|
|
43
|
+
data,
|
|
44
|
+
error,
|
|
45
|
+
response,
|
|
46
|
+
}: {
|
|
47
|
+
data?: T;
|
|
48
|
+
error?: unknown;
|
|
49
|
+
response: Response;
|
|
50
|
+
}): T {
|
|
51
|
+
if (data !== undefined) return data;
|
|
52
|
+
throw new ApiError(response.status, error);
|
|
53
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds a clean query-params object by removing undefined values.
|
|
3
|
+
*
|
|
4
|
+
* With `exactOptionalPropertyTypes: true`, TypeScript disallows explicit
|
|
5
|
+
* `undefined` values in optional properties. This helper accepts an object
|
|
6
|
+
* that may contain `undefined` values and returns one that only contains
|
|
7
|
+
* the defined entries, satisfying the strict type check.
|
|
8
|
+
*/
|
|
9
|
+
export function q<T extends Record<string, unknown>>(
|
|
10
|
+
obj: T,
|
|
11
|
+
): { [K in keyof T]?: NonNullable<T[K]> } {
|
|
12
|
+
const result: Record<string, unknown> = {};
|
|
13
|
+
for (const [k, v] of Object.entries(obj)) {
|
|
14
|
+
if (v !== undefined && v !== "") result[k] = v;
|
|
15
|
+
}
|
|
16
|
+
return result as { [K in keyof T]?: NonNullable<T[K]> };
|
|
17
|
+
}
|
package/src/auth/dcql.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { SELF_ATTESTATION_VC_TYPE } from "@europeum-ebsi/api-contract/scopes";
|
|
2
|
+
import { createJWT } from "@europeum-ebsi/did-jwt";
|
|
3
|
+
import { metadata as attestationMetadata } from "@europeum-ebsi/vcdm1.1-attestation-schema";
|
|
4
|
+
import { randomUUID } from "node:crypto";
|
|
5
|
+
|
|
6
|
+
import type { KeyMaterial } from "../crypto/wallet.ts";
|
|
7
|
+
|
|
8
|
+
// `SELF_ATTESTATION_VC_TYPE`/`dcqlCredentialQueryId` are shared with `api`
|
|
9
|
+
// via `@europeum-ebsi/api-contract/scopes` (the single source of truth for
|
|
10
|
+
// both), since the CLI must build a self-attestation credential and address
|
|
11
|
+
// it under the exact same DCQL credential-query id the server expects.
|
|
12
|
+
export { dcqlCredentialQueryId } from "@europeum-ebsi/api-contract/scopes";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Builds the `vp_token` for the OpenID4VP 1.0 (final)/DCQL grant: a
|
|
16
|
+
* JSON-encoded object keyed by DCQL credential-query id (see
|
|
17
|
+
* https://openid.net/specs/openid-4-verifiable-presentations-1_0-final.html#section-8.1),
|
|
18
|
+
* e.g. `{"self_attestation_credential": ["eyJ..."]}`.
|
|
19
|
+
*/
|
|
20
|
+
export function buildDcqlVpToken(
|
|
21
|
+
credentialQueryId: string,
|
|
22
|
+
vpJwt: string,
|
|
23
|
+
): string {
|
|
24
|
+
return JSON.stringify({ [credentialQueryId]: [vpJwt] });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Creates and signs the self-issued Verifiable Credential a combinable
|
|
29
|
+
* scope's DCQL query requires (see `SELF_ATTESTATION_VC_TYPE` above):
|
|
30
|
+
* `iss`/`vc.issuer` and `sub`/`credentialSubject.id` are both the wallet's
|
|
31
|
+
* own DID, deliberately with no `termsOfUse`. This carries no trust-chain
|
|
32
|
+
* meaning of its own, but the server's shared VP/VC verification pipeline
|
|
33
|
+
* still unconditionally structurally validates every embedded credential
|
|
34
|
+
* against the EBSI Verifiable Attestation schema, so `id`, `issuanceDate`,
|
|
35
|
+
* `issued`, `validFrom` and `credentialSchema` are all required even though
|
|
36
|
+
* this is a placeholder -- hence `createJWT` directly (rather than the full
|
|
37
|
+
* `createVerifiableCredentialJwt`) to control the `type` array precisely
|
|
38
|
+
* (DCQL matches on `SELF_ATTESTATION_VC_TYPE`, not `VerifiableAttestation`).
|
|
39
|
+
* `credentialSchema` references the generic "VerifiableAttestation" schema
|
|
40
|
+
* itself, bundled with and pre-registered by
|
|
41
|
+
* `@europeum-ebsi/vcdm1.1-attestation-schema`, so this validates with no
|
|
42
|
+
* network dependency and no new Schemas Registry entry.
|
|
43
|
+
*/
|
|
44
|
+
export function createSelfAttestationVcJwt(signingKey: KeyMaterial): string {
|
|
45
|
+
const { alg, did, kid, signer } = signingKey.issuer;
|
|
46
|
+
const issuanceDate = new Date();
|
|
47
|
+
const issued = `${issuanceDate.toISOString().slice(0, -5)}Z`;
|
|
48
|
+
const iat = Math.floor(issuanceDate.getTime() / 1000);
|
|
49
|
+
const id = `urn:uuid:${randomUUID()}`;
|
|
50
|
+
|
|
51
|
+
return createJWT(
|
|
52
|
+
{
|
|
53
|
+
iat,
|
|
54
|
+
iss: did,
|
|
55
|
+
jti: id,
|
|
56
|
+
nbf: iat,
|
|
57
|
+
sub: did,
|
|
58
|
+
vc: {
|
|
59
|
+
"@context": ["https://www.w3.org/2018/credentials/v1"],
|
|
60
|
+
credentialSchema: {
|
|
61
|
+
// Must be a well-formed URI whose last path segment is the schema
|
|
62
|
+
// id ajv already has pre-registered (see `validateCredentialSchema`
|
|
63
|
+
// in `libs/verifiable-credential`) -- the host is never
|
|
64
|
+
// dereferenced since the lookup succeeds locally first.
|
|
65
|
+
id: `https://schemas-registry.example/schemas/${attestationMetadata.id.base16}`,
|
|
66
|
+
type: "FullJsonSchemaValidator2021",
|
|
67
|
+
},
|
|
68
|
+
credentialSubject: { id: did },
|
|
69
|
+
id,
|
|
70
|
+
issuanceDate: issued,
|
|
71
|
+
issued,
|
|
72
|
+
issuer: did,
|
|
73
|
+
type: [
|
|
74
|
+
"VerifiableCredential",
|
|
75
|
+
"VerifiableAttestation",
|
|
76
|
+
SELF_ATTESTATION_VC_TYPE,
|
|
77
|
+
],
|
|
78
|
+
validFrom: issued,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{ signer },
|
|
82
|
+
{ alg, kid, typ: "JWT" },
|
|
83
|
+
);
|
|
84
|
+
}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CUSTOM_SCOPES,
|
|
3
|
+
dcqlCredentialQueryId,
|
|
4
|
+
mergedPresentationDefinitionId,
|
|
5
|
+
parseScopeToken as parseSharedScopeToken,
|
|
6
|
+
COMBINABLE_SCOPES as SHARED_COMBINABLE_SCOPES,
|
|
7
|
+
} from "@europeum-ebsi/api-contract/scopes";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Derives the `presentation_submission` for each EBSI authorisation scope.
|
|
11
|
+
*
|
|
12
|
+
* The scope grammar itself -- known families, combinability, and token
|
|
13
|
+
* parsing -- is shared with the API via `@europeum-ebsi/api-contract/scopes` (the single
|
|
14
|
+
* source of truth for both, embedded in and exported by the API package).
|
|
15
|
+
* What's below is CLI-specific: which scopes need a VC in the VP, and how to
|
|
16
|
+
* build the actual `presentation_submission` payload.
|
|
17
|
+
*
|
|
18
|
+
* Rules:
|
|
19
|
+
* - Scopes that need a VC in the VP: did-registry:invite, ledger:invoke, issuers-registry:invite, track-and-trace:authorise
|
|
20
|
+
* - All others (write / create scopes): empty VP (verifiableCredential: [], descriptor_map: [])
|
|
21
|
+
*
|
|
22
|
+
* A single access token may also combine several "write" scopes (e.g.
|
|
23
|
+
* `"did-registry:write issuers-registry:write"`), in which case the API returns a merged
|
|
24
|
+
* Presentation Definition and expects the client to echo its `definition_id`
|
|
25
|
+
* back — see `mergedDefinitionId` below.
|
|
26
|
+
*
|
|
27
|
+
* Every scope may optionally be suffixed with `:<0x-address>` (e.g.
|
|
28
|
+
* `"track-and-trace:write:0x61c36a8d610163660E21a8b7359e1Cac0C9133e1"`) to target a
|
|
29
|
+
* specific deployed beacon-proxy instance of that scope's registry instead of
|
|
30
|
+
* the environment-configured default. The suffix is part of what gets sent to
|
|
31
|
+
* the API verbatim (see `getAccessToken` in `./token.ts`), but is stripped
|
|
32
|
+
* down to its "family" (`<registry>:<action>`) before deriving Presentation
|
|
33
|
+
* Definition ids and before running the rules below (unknown-scope,
|
|
34
|
+
* duplicate, combinability).
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The set of scope families that require a real VC in the VP
|
|
39
|
+
*/
|
|
40
|
+
const VC_REQUIRED_SCOPES = new Set([
|
|
41
|
+
"did-registry:invite",
|
|
42
|
+
"issuers-registry:invite",
|
|
43
|
+
"ledger:invoke",
|
|
44
|
+
"track-and-trace:authorise",
|
|
45
|
+
]);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Scope families that can be combined together in a single access token
|
|
49
|
+
* request, e.g. `"did-registry:write issuers-registry:write"`. Every scope here uses the empty-VP
|
|
50
|
+
* pattern and gates an independent registry check, so combining them is a
|
|
51
|
+
* pure AND with no privilege escalation.
|
|
52
|
+
*/
|
|
53
|
+
export const COMBINABLE_SCOPES = new Set<string>(SHARED_COMBINABLE_SCOPES);
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* All EBSI authorisation scope families the CLI knows about.
|
|
57
|
+
*/
|
|
58
|
+
export const KNOWN_SCOPES = CUSTOM_SCOPES;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* A single parsed scope token, e.g. `"track-and-trace:write:0xAbc..."` -> `{ family: "track-and-trace:write", targetAddress: "0xAbc..." }`.
|
|
62
|
+
*/
|
|
63
|
+
export interface ParsedScope {
|
|
64
|
+
family: string;
|
|
65
|
+
targetAddress?: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface PresentationSubmission {
|
|
69
|
+
definition_id: string;
|
|
70
|
+
descriptor_map: PresentationDescriptor[];
|
|
71
|
+
id: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
interface PresentationDescriptor {
|
|
75
|
+
format: string;
|
|
76
|
+
id: string;
|
|
77
|
+
path: string;
|
|
78
|
+
path_nested: {
|
|
79
|
+
format: string;
|
|
80
|
+
id: string;
|
|
81
|
+
path: string;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Builds the `presentation_submission` object for the given scope (single or
|
|
87
|
+
* space-separated multi-scope).
|
|
88
|
+
*
|
|
89
|
+
* For a single VC-required scope, the descriptor_map contains one entry
|
|
90
|
+
* pointing to `$.vp.verifiableCredential[0]`. For write/create scopes — and
|
|
91
|
+
* for any combined multi-scope request, which is always drawn from the
|
|
92
|
+
* combinable write scopes — the descriptor_map is empty (empty VP pattern).
|
|
93
|
+
*/
|
|
94
|
+
export function buildPresentationSubmission(
|
|
95
|
+
scope: string,
|
|
96
|
+
submissionId: string,
|
|
97
|
+
): PresentationSubmission {
|
|
98
|
+
const families = scopeFamilies(scope);
|
|
99
|
+
const definitionId = mergedDefinitionId(families);
|
|
100
|
+
|
|
101
|
+
if (families.length === 1 && requiresVc(scope)) {
|
|
102
|
+
const soleFamily = families[0]!;
|
|
103
|
+
const credentialId = dcqlCredentialQueryId(soleFamily);
|
|
104
|
+
return {
|
|
105
|
+
definition_id: definitionId,
|
|
106
|
+
descriptor_map: [
|
|
107
|
+
{
|
|
108
|
+
format: "jwt_vp",
|
|
109
|
+
id: credentialId,
|
|
110
|
+
path: "$",
|
|
111
|
+
path_nested: {
|
|
112
|
+
format: "jwt_vc",
|
|
113
|
+
id: credentialId,
|
|
114
|
+
path: "$.vp.verifiableCredential[0]",
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
id: submissionId,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Empty VP pattern (write/create scopes, including combined multi-scope requests)
|
|
123
|
+
return {
|
|
124
|
+
definition_id: definitionId,
|
|
125
|
+
descriptor_map: [],
|
|
126
|
+
id: submissionId,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Builds the `definition_id` of the (possibly merged) Presentation Definition
|
|
132
|
+
* for the given scope families, delegating to the shared
|
|
133
|
+
* `mergedPresentationDefinitionId`. Scopes are sorted alphabetically so the id
|
|
134
|
+
* doesn't depend on request order, and colons are mapped to underscores since
|
|
135
|
+
* Presentation Definition ids stay underscore-form even though scopes are
|
|
136
|
+
* colon-form (so a target instance address can be appended to a scope without
|
|
137
|
+
* ever touching the id). For a single scope this is the identity:
|
|
138
|
+
* `"<scope_with_underscores>_presentation"`.
|
|
139
|
+
*/
|
|
140
|
+
export function mergedDefinitionId(families: string[]): string {
|
|
141
|
+
return mergedPresentationDefinitionId(
|
|
142
|
+
families as (typeof CUSTOM_SCOPES)[number][],
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Splits a scope string into its individual scope tokens, e.g.
|
|
148
|
+
* `"openid did-registry:write issuers-registry:write"` or `"did-registry:write issuers-registry:write"` both yield
|
|
149
|
+
* `["did-registry:write", "issuers-registry:write"]` — a leading `"openid"` token is dropped when
|
|
150
|
+
* present. Each token may carry a `:<0x-address>` targeting suffix; this
|
|
151
|
+
* function does not parse or validate that — see `parseScopeToken` /
|
|
152
|
+
* `scopeFamilies` for that.
|
|
153
|
+
*/
|
|
154
|
+
export function parseScopes(scope: string): string[] {
|
|
155
|
+
const tokens = scope.trim().split(/\s+/).filter(Boolean);
|
|
156
|
+
return tokens[0] === "openid" ? tokens.slice(1) : tokens;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Parses a single scope token (no leading "openid", no spaces). Delegates the
|
|
161
|
+
* actual grammar (2-or-3 colon-delimited segments, known family, valid
|
|
162
|
+
* Ethereum address suffix) to the shared `parseScopeToken`, adapting its
|
|
163
|
+
* `{ scope, targetAddress }` shape to this module's own `{ family,
|
|
164
|
+
* targetAddress }` `ParsedScope`.
|
|
165
|
+
*/
|
|
166
|
+
export function parseScopeToken(token: string): ParsedScope | undefined {
|
|
167
|
+
const parsed = parseSharedScopeToken(token);
|
|
168
|
+
if (!parsed) {
|
|
169
|
+
return undefined;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return {
|
|
173
|
+
family: parsed.scope,
|
|
174
|
+
...(parsed.targetAddress && { targetAddress: parsed.targetAddress }),
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Returns true when the given scope requires a real VC to be placed in the
|
|
180
|
+
* VP. Only ever true for a single VC-required scope — a combined multi-scope
|
|
181
|
+
* request is always drawn from the combinable (empty-VP) write scopes, so it
|
|
182
|
+
* never requires a VC.
|
|
183
|
+
*/
|
|
184
|
+
export function requiresVc(scope: string): boolean {
|
|
185
|
+
const tokens = parseScopes(scope);
|
|
186
|
+
if (tokens.length !== 1) {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
const parsed = parseScopeToken(tokens[0]!);
|
|
190
|
+
return parsed !== undefined && VC_REQUIRED_SCOPES.has(parsed.family);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Splits a scope string into its scope *families* (targeting addresses
|
|
195
|
+
* stripped), e.g. `"track-and-trace:write:0xAbc..."` -> `"track-and-trace:write"`. Throws a
|
|
196
|
+
* descriptive `Error` if any token fails to parse (unknown family or a
|
|
197
|
+
* malformed address suffix).
|
|
198
|
+
*/
|
|
199
|
+
export function scopeFamilies(scope: string): string[] {
|
|
200
|
+
return parseScopes(scope).map((token) => {
|
|
201
|
+
const parsed = parseScopeToken(token);
|
|
202
|
+
if (!parsed) {
|
|
203
|
+
throw new Error(
|
|
204
|
+
`Invalid scope token "${token}". Expected "<registry>:<action>", optionally ` +
|
|
205
|
+
`suffixed with ":<0x-address>" to target a specific contract instance. ` +
|
|
206
|
+
`Known scopes: ${KNOWN_SCOPES.join(", ")}`,
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
return parsed.family;
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Validates a scope string against the same rules enforced by the
|
|
215
|
+
* Authorisation service's `IsScope` validator: every token must parse (known
|
|
216
|
+
* family, optionally a valid `:<0x-address>` suffix), no duplicate families
|
|
217
|
+
* (an address suffix doesn't distinguish a family — `did-registry:write` and
|
|
218
|
+
* `did-registry:write:0x...` collide), and — when more than one scope is requested —
|
|
219
|
+
* every family must be in `COMBINABLE_SCOPES` (the invite / `ledger:invoke`
|
|
220
|
+
* scopes can only ever be requested alone).
|
|
221
|
+
*
|
|
222
|
+
* Throws a descriptive `Error` when invalid; returns void otherwise.
|
|
223
|
+
*/
|
|
224
|
+
export function validateScope(scope: string): void {
|
|
225
|
+
const tokens = parseScopes(scope);
|
|
226
|
+
|
|
227
|
+
if (tokens.length === 0) {
|
|
228
|
+
throw new Error(
|
|
229
|
+
`Missing scope. Provide one of: ${KNOWN_SCOPES.join(", ")}`,
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Throws with a descriptive message if any token is unknown or malformed.
|
|
234
|
+
const families = scopeFamilies(scope);
|
|
235
|
+
|
|
236
|
+
const seen = new Set<string>();
|
|
237
|
+
const duplicates = new Set<string>();
|
|
238
|
+
for (const family of families) {
|
|
239
|
+
if (seen.has(family)) duplicates.add(family);
|
|
240
|
+
seen.add(family);
|
|
241
|
+
}
|
|
242
|
+
if (duplicates.size > 0) {
|
|
243
|
+
throw new Error(`Duplicate scope(s): ${[...duplicates].join(", ")}`);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
if (families.length <= 1) return;
|
|
247
|
+
|
|
248
|
+
const nonCombinable = families.filter((f) => !COMBINABLE_SCOPES.has(f));
|
|
249
|
+
if (nonCombinable.length > 0) {
|
|
250
|
+
throw new Error(
|
|
251
|
+
`Scope(s) "${nonCombinable.join(", ")}" cannot be combined with other scopes. ` +
|
|
252
|
+
`Only these scopes may be combined in a single token: ${[...COMBINABLE_SCOPES].join(", ")}.`,
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
}
|