@veridid/openbadges 0.0.0-stage → 1.0.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 +202 -0
- package/README.md +43 -2
- package/build/OpenBadgesModule.d.mts +15 -0
- package/build/OpenBadgesModule.d.mts.map +1 -0
- package/build/OpenBadgesModule.mjs +71 -0
- package/build/OpenBadgesModule.mjs.map +1 -0
- package/build/OpenBadgesModuleConfig.d.mts +101 -0
- package/build/OpenBadgesModuleConfig.d.mts.map +1 -0
- package/build/OpenBadgesModuleConfig.mjs +51 -0
- package/build/OpenBadgesModuleConfig.mjs.map +1 -0
- package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.mjs +14 -0
- package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.mjs +11 -0
- package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateParam.mjs +13 -0
- package/build/_virtual/_rolldown/runtime.mjs +41 -0
- package/build/api/OpenBadgesApi.d.mts +77 -0
- package/build/api/OpenBadgesApi.d.mts.map +1 -0
- package/build/api/OpenBadgesApi.mjs +124 -0
- package/build/api/OpenBadgesApi.mjs.map +1 -0
- package/build/constants.d.mts +17 -0
- package/build/constants.d.mts.map +1 -0
- package/build/constants.mjs +19 -0
- package/build/constants.mjs.map +1 -0
- package/build/cryptosuites/EcdsaSd2023.d.mts +129 -0
- package/build/cryptosuites/EcdsaSd2023.d.mts.map +1 -0
- package/build/cryptosuites/EcdsaSd2023.mjs +408 -0
- package/build/cryptosuites/EcdsaSd2023.mjs.map +1 -0
- package/build/cryptosuites/EddsaRdfc2022.d.mts +118 -0
- package/build/cryptosuites/EddsaRdfc2022.d.mts.map +1 -0
- package/build/cryptosuites/EddsaRdfc2022.mjs +301 -0
- package/build/cryptosuites/EddsaRdfc2022.mjs.map +1 -0
- package/build/cryptosuites/constants.d.mts +18 -0
- package/build/cryptosuites/constants.d.mts.map +1 -0
- package/build/cryptosuites/constants.mjs +19 -0
- package/build/cryptosuites/constants.mjs.map +1 -0
- package/build/cryptosuites/contextPreprocessor.mjs +76 -0
- package/build/cryptosuites/contextPreprocessor.mjs.map +1 -0
- package/build/cryptosuites/dataIntegrityV2Context.d.mts +147 -0
- package/build/cryptosuites/dataIntegrityV2Context.d.mts.map +1 -0
- package/build/cryptosuites/dataIntegrityV2Context.mjs +82 -0
- package/build/cryptosuites/dataIntegrityV2Context.mjs.map +1 -0
- package/build/cryptosuites/index.mjs +4 -0
- package/build/formats/OpenBadgesCredentialFormat.d.mts +41 -0
- package/build/formats/OpenBadgesCredentialFormat.d.mts.map +1 -0
- package/build/formats/OpenBadgesCredentialFormat.mjs +7 -0
- package/build/formats/OpenBadgesCredentialFormat.mjs.map +1 -0
- package/build/formats/OpenBadgesCredentialFormatService.d.mts +79 -0
- package/build/formats/OpenBadgesCredentialFormatService.d.mts.map +1 -0
- package/build/formats/OpenBadgesCredentialFormatService.mjs +208 -0
- package/build/formats/OpenBadgesCredentialFormatService.mjs.map +1 -0
- package/build/formats/OpenBadgesProofFormat.d.mts +41 -0
- package/build/formats/OpenBadgesProofFormat.d.mts.map +1 -0
- package/build/formats/OpenBadgesProofFormat.mjs +7 -0
- package/build/formats/OpenBadgesProofFormat.mjs.map +1 -0
- package/build/formats/OpenBadgesProofFormatService.d.mts +56 -0
- package/build/formats/OpenBadgesProofFormatService.d.mts.map +1 -0
- package/build/formats/OpenBadgesProofFormatService.mjs +138 -0
- package/build/formats/OpenBadgesProofFormatService.mjs.map +1 -0
- package/build/formats/index.d.mts +4 -0
- package/build/formats/index.mjs +4 -0
- package/build/http/OpenBadgesHttpModule.d.mts +14 -0
- package/build/http/OpenBadgesHttpModule.d.mts.map +1 -0
- package/build/http/OpenBadgesHttpModule.mjs +85 -0
- package/build/http/OpenBadgesHttpModule.mjs.map +1 -0
- package/build/http/OpenBadgesHttpModuleConfig.d.mts +60 -0
- package/build/http/OpenBadgesHttpModuleConfig.d.mts.map +1 -0
- package/build/http/OpenBadgesHttpModuleConfig.mjs +80 -0
- package/build/http/OpenBadgesHttpModuleConfig.mjs.map +1 -0
- package/build/http/endpoints/authorize.mjs +69 -0
- package/build/http/endpoints/authorize.mjs.map +1 -0
- package/build/http/endpoints/consent.mjs +34 -0
- package/build/http/endpoints/consent.mjs.map +1 -0
- package/build/http/endpoints/credentials.mjs +77 -0
- package/build/http/endpoints/credentials.mjs.map +1 -0
- package/build/http/endpoints/did.mjs +44 -0
- package/build/http/endpoints/did.mjs.map +1 -0
- package/build/http/endpoints/introspect.mjs +34 -0
- package/build/http/endpoints/introspect.mjs.map +1 -0
- package/build/http/endpoints/jwks.mjs +40 -0
- package/build/http/endpoints/jwks.mjs.map +1 -0
- package/build/http/endpoints/profile.mjs +56 -0
- package/build/http/endpoints/profile.mjs.map +1 -0
- package/build/http/endpoints/refresh.mjs +99 -0
- package/build/http/endpoints/refresh.mjs.map +1 -0
- package/build/http/endpoints/registration.mjs +42 -0
- package/build/http/endpoints/registration.mjs.map +1 -0
- package/build/http/endpoints/revoke.mjs +31 -0
- package/build/http/endpoints/revoke.mjs.map +1 -0
- package/build/http/endpoints/serviceDescription.mjs +48 -0
- package/build/http/endpoints/serviceDescription.mjs.map +1 -0
- package/build/http/endpoints/statusList.mjs +91 -0
- package/build/http/endpoints/statusList.mjs.map +1 -0
- package/build/http/endpoints/token.mjs +123 -0
- package/build/http/endpoints/token.mjs.map +1 -0
- package/build/http/middleware/auth.mjs +38 -0
- package/build/http/middleware/auth.mjs.map +1 -0
- package/build/http/router.d.mts +19 -0
- package/build/http/router.d.mts.map +1 -0
- package/build/http/router.mjs +36 -0
- package/build/http/router.mjs.map +1 -0
- package/build/http/tenants.mjs +16 -0
- package/build/http/tenants.mjs.map +1 -0
- package/build/http/util/auth.mjs +38 -0
- package/build/http/util/auth.mjs.map +1 -0
- package/build/index.d.mts +57 -0
- package/build/index.mjs +68 -0
- package/build/index.mjs.map +1 -0
- package/build/models/ClrCredential.d.mts +116 -0
- package/build/models/ClrCredential.d.mts.map +1 -0
- package/build/models/ClrCredential.mjs +38 -0
- package/build/models/ClrCredential.mjs.map +1 -0
- package/build/models/EndorsementCredential.d.mts +93 -0
- package/build/models/EndorsementCredential.d.mts.map +1 -0
- package/build/models/StatusListCredential.d.mts +85 -0
- package/build/models/StatusListCredential.d.mts.map +1 -0
- package/build/models/StatusListCredential.mjs +29 -0
- package/build/models/StatusListCredential.mjs.map +1 -0
- package/build/models/index.mjs +2 -0
- package/build/repository/OpenBadgeCredentialRecord.d.mts +48 -0
- package/build/repository/OpenBadgeCredentialRecord.d.mts.map +1 -0
- package/build/repository/OpenBadgeCredentialRecord.mjs +44 -0
- package/build/repository/OpenBadgeCredentialRecord.mjs.map +1 -0
- package/build/repository/OpenBadgeCredentialRepository.d.mts +13 -0
- package/build/repository/OpenBadgeCredentialRepository.d.mts.map +1 -0
- package/build/repository/OpenBadgeCredentialRepository.mjs +34 -0
- package/build/repository/OpenBadgeCredentialRepository.mjs.map +1 -0
- package/build/repository/OpenBadgesAuthCodeRecord.d.mts +39 -0
- package/build/repository/OpenBadgesAuthCodeRecord.d.mts.map +1 -0
- package/build/repository/OpenBadgesAuthCodeRecord.mjs +40 -0
- package/build/repository/OpenBadgesAuthCodeRecord.mjs.map +1 -0
- package/build/repository/OpenBadgesAuthCodeRepository.d.mts +11 -0
- package/build/repository/OpenBadgesAuthCodeRepository.d.mts.map +1 -0
- package/build/repository/OpenBadgesAuthCodeRepository.mjs +29 -0
- package/build/repository/OpenBadgesAuthCodeRepository.mjs.map +1 -0
- package/build/repository/OpenBadgesConsentRecord.d.mts +28 -0
- package/build/repository/OpenBadgesConsentRecord.d.mts.map +1 -0
- package/build/repository/OpenBadgesConsentRecord.mjs +33 -0
- package/build/repository/OpenBadgesConsentRecord.mjs.map +1 -0
- package/build/repository/OpenBadgesConsentRepository.d.mts +11 -0
- package/build/repository/OpenBadgesConsentRepository.d.mts.map +1 -0
- package/build/repository/OpenBadgesConsentRepository.mjs +37 -0
- package/build/repository/OpenBadgesConsentRepository.mjs.map +1 -0
- package/build/repository/OpenBadgesKeyBindingRecord.d.mts +32 -0
- package/build/repository/OpenBadgesKeyBindingRecord.d.mts.map +1 -0
- package/build/repository/OpenBadgesKeyBindingRecord.mjs +37 -0
- package/build/repository/OpenBadgesKeyBindingRecord.mjs.map +1 -0
- package/build/repository/OpenBadgesKeyBindingRepository.d.mts +12 -0
- package/build/repository/OpenBadgesKeyBindingRepository.d.mts.map +1 -0
- package/build/repository/OpenBadgesKeyBindingRepository.mjs +31 -0
- package/build/repository/OpenBadgesKeyBindingRepository.mjs.map +1 -0
- package/build/repository/OpenBadgesOAuthRecord.d.mts +39 -0
- package/build/repository/OpenBadgesOAuthRecord.d.mts.map +1 -0
- package/build/repository/OpenBadgesOAuthRecord.mjs +37 -0
- package/build/repository/OpenBadgesOAuthRecord.mjs.map +1 -0
- package/build/repository/OpenBadgesOAuthRepository.d.mts +13 -0
- package/build/repository/OpenBadgesOAuthRepository.d.mts.map +1 -0
- package/build/repository/OpenBadgesOAuthRepository.mjs +35 -0
- package/build/repository/OpenBadgesOAuthRepository.mjs.map +1 -0
- package/build/repository/OpenBadgesProfileRecord.d.mts +25 -0
- package/build/repository/OpenBadgesProfileRecord.d.mts.map +1 -0
- package/build/repository/OpenBadgesProfileRecord.mjs +26 -0
- package/build/repository/OpenBadgesProfileRecord.mjs.map +1 -0
- package/build/repository/OpenBadgesProfileRepository.d.mts +11 -0
- package/build/repository/OpenBadgesProfileRepository.d.mts.map +1 -0
- package/build/repository/OpenBadgesProfileRepository.mjs +28 -0
- package/build/repository/OpenBadgesProfileRepository.mjs.map +1 -0
- package/build/repository/OpenBadgesRevocationCacheRecord.d.mts +27 -0
- package/build/repository/OpenBadgesRevocationCacheRecord.d.mts.map +1 -0
- package/build/repository/OpenBadgesRevocationCacheRecord.mjs +27 -0
- package/build/repository/OpenBadgesRevocationCacheRecord.mjs.map +1 -0
- package/build/repository/OpenBadgesRevocationCacheRepository.d.mts +11 -0
- package/build/repository/OpenBadgesRevocationCacheRepository.d.mts.map +1 -0
- package/build/repository/OpenBadgesRevocationCacheRepository.mjs +28 -0
- package/build/repository/OpenBadgesRevocationCacheRepository.mjs.map +1 -0
- package/build/repository/OpenBadgesServiceDescriptionRecord.d.mts +25 -0
- package/build/repository/OpenBadgesServiceDescriptionRecord.d.mts.map +1 -0
- package/build/repository/OpenBadgesServiceDescriptionRecord.mjs +26 -0
- package/build/repository/OpenBadgesServiceDescriptionRecord.mjs.map +1 -0
- package/build/repository/OpenBadgesServiceDescriptionRepository.d.mts +11 -0
- package/build/repository/OpenBadgesServiceDescriptionRepository.d.mts.map +1 -0
- package/build/repository/OpenBadgesServiceDescriptionRepository.mjs +28 -0
- package/build/repository/OpenBadgesServiceDescriptionRepository.mjs.map +1 -0
- package/build/repository/OpenBadgesTokenRecord.d.mts +43 -0
- package/build/repository/OpenBadgesTokenRecord.d.mts.map +1 -0
- package/build/repository/OpenBadgesTokenRecord.mjs +37 -0
- package/build/repository/OpenBadgesTokenRecord.mjs.map +1 -0
- package/build/repository/OpenBadgesTokenRepository.d.mts +14 -0
- package/build/repository/OpenBadgesTokenRepository.d.mts.map +1 -0
- package/build/repository/OpenBadgesTokenRepository.mjs +46 -0
- package/build/repository/OpenBadgesTokenRepository.mjs.map +1 -0
- package/build/repository/StatusListRecord.d.mts +40 -0
- package/build/repository/StatusListRecord.d.mts.map +1 -0
- package/build/repository/StatusListRecord.mjs +42 -0
- package/build/repository/StatusListRecord.mjs.map +1 -0
- package/build/repository/StatusListRepository.d.mts +23 -0
- package/build/repository/StatusListRepository.d.mts.map +1 -0
- package/build/repository/StatusListRepository.mjs +46 -0
- package/build/repository/StatusListRepository.mjs.map +1 -0
- package/build/services/AchievementValidator.d.mts +162 -0
- package/build/services/AchievementValidator.d.mts.map +1 -0
- package/build/services/AchievementValidator.mjs +173 -0
- package/build/services/AchievementValidator.mjs.map +1 -0
- package/build/services/ConsumerService.d.mts +29 -0
- package/build/services/ConsumerService.d.mts.map +1 -0
- package/build/services/ConsumerService.mjs +114 -0
- package/build/services/ConsumerService.mjs.map +1 -0
- package/build/services/ContextService.d.mts +17 -0
- package/build/services/ContextService.d.mts.map +1 -0
- package/build/services/ContextService.mjs +48 -0
- package/build/services/ContextService.mjs.map +1 -0
- package/build/services/DataIntegrityService.d.mts +58 -0
- package/build/services/DataIntegrityService.d.mts.map +1 -0
- package/build/services/DataIntegrityService.mjs +130 -0
- package/build/services/DataIntegrityService.mjs.map +1 -0
- package/build/services/DidCommLinkService.d.mts +12 -0
- package/build/services/DidCommLinkService.d.mts.map +1 -0
- package/build/services/DidCommLinkService.mjs +15 -0
- package/build/services/DidCommLinkService.mjs.map +1 -0
- package/build/services/DisplayMapper.d.mts +13 -0
- package/build/services/DisplayMapper.d.mts.map +1 -0
- package/build/services/DisplayMapper.mjs +23 -0
- package/build/services/DisplayMapper.mjs.map +1 -0
- package/build/services/IssuerService.d.mts +43 -0
- package/build/services/IssuerService.d.mts.map +1 -0
- package/build/services/IssuerService.mjs +230 -0
- package/build/services/IssuerService.mjs.map +1 -0
- package/build/services/JwtService.d.mts +22 -0
- package/build/services/JwtService.d.mts.map +1 -0
- package/build/services/JwtService.mjs +190 -0
- package/build/services/JwtService.mjs.map +1 -0
- package/build/services/KeyService.d.mts +122 -0
- package/build/services/KeyService.d.mts.map +1 -0
- package/build/services/KeyService.mjs +448 -0
- package/build/services/KeyService.mjs.map +1 -0
- package/build/services/OAuthClient.d.mts +31 -0
- package/build/services/OAuthClient.d.mts.map +1 -0
- package/build/services/OAuthClient.mjs +131 -0
- package/build/services/OAuthClient.mjs.map +1 -0
- package/build/services/ProofService.d.mts +20 -0
- package/build/services/ProofService.d.mts.map +1 -0
- package/build/services/ProofService.mjs +39 -0
- package/build/services/ProofService.mjs.map +1 -0
- package/build/services/RevocationService.d.mts +64 -0
- package/build/services/RevocationService.d.mts.map +1 -0
- package/build/services/RevocationService.mjs +253 -0
- package/build/services/RevocationService.mjs.map +1 -0
- package/build/services/VerifyService.d.mts +24 -0
- package/build/services/VerifyService.d.mts.map +1 -0
- package/build/services/VerifyService.mjs +59 -0
- package/build/services/VerifyService.mjs.map +1 -0
- package/build/services/crypto/CryptoDriver.d.mts +14 -0
- package/build/services/crypto/CryptoDriver.d.mts.map +1 -0
- package/build/services/crypto/CryptoDriver.mjs +6 -0
- package/build/services/crypto/CryptoDriver.mjs.map +1 -0
- package/build/services/crypto/JsonLdCryptoDriver.d.mts +22 -0
- package/build/services/crypto/JsonLdCryptoDriver.d.mts.map +1 -0
- package/build/services/crypto/JsonLdCryptoDriver.mjs +43 -0
- package/build/services/crypto/JsonLdCryptoDriver.mjs.map +1 -0
- package/build/services/crypto/JwtCryptoDriver.d.mts +18 -0
- package/build/services/crypto/JwtCryptoDriver.d.mts.map +1 -0
- package/build/services/crypto/JwtCryptoDriver.mjs +46 -0
- package/build/services/crypto/JwtCryptoDriver.mjs.map +1 -0
- package/build/services/index.d.mts +12 -0
- package/build/services/index.mjs +12 -0
- package/build/utils/validate.d.mts +21 -0
- package/build/utils/validate.d.mts.map +1 -0
- package/build/utils/validate.mjs +111 -0
- package/build/utils/validate.mjs.map +1 -0
- package/package.json +63 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2020-present Hyperledger Contributors.
|
|
190
|
+
Copyright 2021 Queen’s Printer for Ontario. Mostafa Youssef (https://github.com/MosCD3), Amit Padmani (https://github.com/nbAmit), Prasad Katkar (https://github.com/NB-PrasadKatkar), Mike Richardson (https://github.com/NB-MikeRichardson)
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @veridid/openbadges
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Open Badges 3.0 support for Credo: issue, verify and store OBv3 credentials.
|
|
4
|
+
|
|
5
|
+
Part of the VeriDID Credo modules. Version 1.x targets Credo `0.7.x`.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
pnpm add @veridid/openbadges @credo-ts/core@^0.7 @credo-ts/didcomm@^0.7
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Peer dependencies
|
|
14
|
+
|
|
15
|
+
- `@credo-ts/core` `>=0.7.0 <0.8`
|
|
16
|
+
- `@credo-ts/didcomm` `>=0.7.0 <0.8`
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { Agent } from '@credo-ts/core'
|
|
22
|
+
import { agentDependencies } from '@credo-ts/node' // or @credo-ts/react-native
|
|
23
|
+
import { OpenBadgesModule } from '@veridid/openbadges'
|
|
24
|
+
|
|
25
|
+
const agent = new Agent({
|
|
26
|
+
config: { /* … */ },
|
|
27
|
+
dependencies: agentDependencies,
|
|
28
|
+
modules: {
|
|
29
|
+
// …your other modules (didcomm, connections, …)
|
|
30
|
+
openbadges: new OpenBadgesModule({}),
|
|
31
|
+
},
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
await agent.initialize()
|
|
35
|
+
// The module API is available as agent.modules.openbadges
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## HTTP endpoints
|
|
39
|
+
|
|
40
|
+
The optional `@veridid/openbadges/http` entry point exposes the Open Badges HTTP endpoints. It needs `express` (`^4.18.0`), which is an optional peer dependency.
|
|
41
|
+
|
|
42
|
+
## License
|
|
43
|
+
|
|
44
|
+
Apache-2.0
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OpenBadgesModuleConfig, OpenBadgesModuleConfigOptions } from "./OpenBadgesModuleConfig.mjs";
|
|
2
|
+
import { OpenBadgesApi } from "./api/OpenBadgesApi.mjs";
|
|
3
|
+
import { AgentContext, DependencyManager, Module } from "@credo-ts/core";
|
|
4
|
+
|
|
5
|
+
//#region src/OpenBadgesModule.d.ts
|
|
6
|
+
declare class OpenBadgesModule implements Module {
|
|
7
|
+
readonly api: typeof OpenBadgesApi;
|
|
8
|
+
readonly config: OpenBadgesModuleConfig;
|
|
9
|
+
constructor(options: OpenBadgesModuleConfigOptions);
|
|
10
|
+
register(dependencyManager: DependencyManager): void;
|
|
11
|
+
initialize(_agentContext: AgentContext): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { OpenBadgesModule };
|
|
15
|
+
//# sourceMappingURL=OpenBadgesModule.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenBadgesModule.d.mts","names":[],"sources":["../src/OpenBadgesModule.ts"],"mappings":";;;;;cAmCa,gBAAA,YAA4B,MAAA;EAAA,SACvB,GAAA,SAAG,aAAA;EAAA,SACH,MAAA,EAAQ,sBAAA;cAEL,OAAA,EAAS,6BAAA;EAIrB,QAAA,CAAS,iBAAA,EAAmB,iBAAA;EAkCtB,UAAA,CAAW,aAAA,EAAe,YAAA,GAAe,OAAA;AAAA"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { OpenBadgesModuleConfig } from "./OpenBadgesModuleConfig.mjs";
|
|
2
|
+
import { OpenBadgeCredentialRepository } from "./repository/OpenBadgeCredentialRepository.mjs";
|
|
3
|
+
import { ContextService } from "./services/ContextService.mjs";
|
|
4
|
+
import { OpenBadgesKeyBindingRepository } from "./repository/OpenBadgesKeyBindingRepository.mjs";
|
|
5
|
+
import { KeyService } from "./services/KeyService.mjs";
|
|
6
|
+
import { DataIntegrityService } from "./services/DataIntegrityService.mjs";
|
|
7
|
+
import { JsonLdCryptoDriver } from "./services/crypto/JsonLdCryptoDriver.mjs";
|
|
8
|
+
import { JwtService } from "./services/JwtService.mjs";
|
|
9
|
+
import { JwtCryptoDriver } from "./services/crypto/JwtCryptoDriver.mjs";
|
|
10
|
+
import { ProofService } from "./services/ProofService.mjs";
|
|
11
|
+
import { IssuerService } from "./services/IssuerService.mjs";
|
|
12
|
+
import { OpenBadgesRevocationCacheRepository } from "./repository/OpenBadgesRevocationCacheRepository.mjs";
|
|
13
|
+
import { StatusListRepository } from "./repository/StatusListRepository.mjs";
|
|
14
|
+
import { RevocationService } from "./services/RevocationService.mjs";
|
|
15
|
+
import { VerifyService } from "./services/VerifyService.mjs";
|
|
16
|
+
import { OpenBadgesServiceDescriptionRepository } from "./repository/OpenBadgesServiceDescriptionRepository.mjs";
|
|
17
|
+
import { OpenBadgesOAuthRepository } from "./repository/OpenBadgesOAuthRepository.mjs";
|
|
18
|
+
import { OpenBadgesTokenRepository } from "./repository/OpenBadgesTokenRepository.mjs";
|
|
19
|
+
import { OAuthClient } from "./services/OAuthClient.mjs";
|
|
20
|
+
import { ConsumerService } from "./services/ConsumerService.mjs";
|
|
21
|
+
import { DidCommLinkService } from "./services/DidCommLinkService.mjs";
|
|
22
|
+
import { DisplayMapper } from "./services/DisplayMapper.mjs";
|
|
23
|
+
import { OpenBadgesApi } from "./api/OpenBadgesApi.mjs";
|
|
24
|
+
import { OpenBadgesProfileRepository } from "./repository/OpenBadgesProfileRepository.mjs";
|
|
25
|
+
import { OpenBadgesAuthCodeRepository } from "./repository/OpenBadgesAuthCodeRepository.mjs";
|
|
26
|
+
import { OpenBadgesConsentRepository, init_OpenBadgesConsentRepository } from "./repository/OpenBadgesConsentRepository.mjs";
|
|
27
|
+
import { AchievementValidator } from "./services/AchievementValidator.mjs";
|
|
28
|
+
import { AgentConfig } from "@credo-ts/core";
|
|
29
|
+
|
|
30
|
+
//#region src/OpenBadgesModule.ts
|
|
31
|
+
init_OpenBadgesConsentRepository();
|
|
32
|
+
var OpenBadgesModule = class {
|
|
33
|
+
constructor(options) {
|
|
34
|
+
this.api = OpenBadgesApi;
|
|
35
|
+
this.config = new OpenBadgesModuleConfig(options);
|
|
36
|
+
}
|
|
37
|
+
register(dependencyManager) {
|
|
38
|
+
dependencyManager.resolve(AgentConfig).logger.info("Registering OpenBadgesModule");
|
|
39
|
+
dependencyManager.registerInstance(OpenBadgesModuleConfig, this.config);
|
|
40
|
+
dependencyManager.registerSingleton(OpenBadgeCredentialRepository);
|
|
41
|
+
dependencyManager.registerSingleton(OpenBadgesProfileRepository);
|
|
42
|
+
dependencyManager.registerSingleton(OpenBadgesServiceDescriptionRepository);
|
|
43
|
+
dependencyManager.registerSingleton(OpenBadgesOAuthRepository);
|
|
44
|
+
dependencyManager.registerSingleton(OpenBadgesRevocationCacheRepository);
|
|
45
|
+
dependencyManager.registerSingleton(OpenBadgesKeyBindingRepository);
|
|
46
|
+
dependencyManager.registerSingleton(OpenBadgesAuthCodeRepository);
|
|
47
|
+
dependencyManager.registerSingleton(OpenBadgesTokenRepository);
|
|
48
|
+
dependencyManager.registerSingleton(OpenBadgesConsentRepository);
|
|
49
|
+
dependencyManager.registerSingleton(StatusListRepository);
|
|
50
|
+
dependencyManager.registerSingleton(IssuerService);
|
|
51
|
+
dependencyManager.registerSingleton(VerifyService);
|
|
52
|
+
dependencyManager.registerSingleton(ConsumerService);
|
|
53
|
+
dependencyManager.registerSingleton(OAuthClient);
|
|
54
|
+
dependencyManager.registerSingleton(DidCommLinkService);
|
|
55
|
+
dependencyManager.registerSingleton(DisplayMapper);
|
|
56
|
+
dependencyManager.registerSingleton(ContextService);
|
|
57
|
+
dependencyManager.registerSingleton(DataIntegrityService);
|
|
58
|
+
dependencyManager.registerSingleton(KeyService);
|
|
59
|
+
dependencyManager.registerSingleton(JwtService);
|
|
60
|
+
dependencyManager.registerSingleton(JsonLdCryptoDriver);
|
|
61
|
+
dependencyManager.registerSingleton(JwtCryptoDriver);
|
|
62
|
+
dependencyManager.registerSingleton(ProofService);
|
|
63
|
+
dependencyManager.registerSingleton(RevocationService);
|
|
64
|
+
dependencyManager.registerSingleton(AchievementValidator);
|
|
65
|
+
}
|
|
66
|
+
async initialize(_agentContext) {}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
//#endregion
|
|
70
|
+
export { OpenBadgesModule };
|
|
71
|
+
//# sourceMappingURL=OpenBadgesModule.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenBadgesModule.mjs","names":[],"sources":["../src/OpenBadgesModule.ts"],"sourcesContent":["import type { AgentContext, DependencyManager, Module } from '@credo-ts/core'\nimport { AgentConfig } from '@credo-ts/core'\n\nimport type { OpenBadgesModuleConfigOptions } from './OpenBadgesModuleConfig'\nimport { OpenBadgesModuleConfig } from './OpenBadgesModuleConfig'\nimport { OpenBadgesApi } from './api/OpenBadgesApi'\n\nimport { OpenBadgeCredentialRepository } from './repository/OpenBadgeCredentialRepository'\nimport { OpenBadgesProfileRepository } from './repository/OpenBadgesProfileRepository'\nimport { OpenBadgesServiceDescriptionRepository } from './repository/OpenBadgesServiceDescriptionRepository'\nimport { OpenBadgesOAuthRepository } from './repository/OpenBadgesOAuthRepository'\nimport { OpenBadgesRevocationCacheRepository } from './repository/OpenBadgesRevocationCacheRepository'\nimport { OpenBadgesAuthCodeRepository } from './repository/OpenBadgesAuthCodeRepository'\nimport { OpenBadgesTokenRepository } from './repository/OpenBadgesTokenRepository'\nimport { OpenBadgesConsentRepository } from './repository/OpenBadgesConsentRepository'\nimport { StatusListRepository } from './repository/StatusListRepository'\n\nimport { IssuerService } from './services/IssuerService'\nimport { VerifyService } from './services/VerifyService'\nimport { ConsumerService } from './services/ConsumerService'\nimport { OAuthClient } from './services/OAuthClient'\nimport { DidCommLinkService } from './services/DidCommLinkService'\nimport { DisplayMapper } from './services/DisplayMapper'\nimport { ContextService } from './services/ContextService'\nimport { DataIntegrityService } from './services/DataIntegrityService'\nimport { JwtService } from './services/JwtService'\nimport { KeyService } from './services/KeyService'\n// legacy key repository removed; using KMS-backed bindings instead\nimport { OpenBadgesKeyBindingRepository } from './repository/OpenBadgesKeyBindingRepository'\nimport { ProofService } from './services/ProofService'\nimport { RevocationService } from './services/RevocationService'\nimport { AchievementValidator } from './services/AchievementValidator'\nimport { JsonLdCryptoDriver } from './services/crypto/JsonLdCryptoDriver'\nimport { JwtCryptoDriver } from './services/crypto/JwtCryptoDriver'\n\nexport class OpenBadgesModule implements Module {\n public readonly api = OpenBadgesApi\n public readonly config: OpenBadgesModuleConfig\n\n public constructor(options: OpenBadgesModuleConfigOptions) {\n this.config = new OpenBadgesModuleConfig(options)\n }\n\n public register(dependencyManager: DependencyManager) {\n dependencyManager.resolve(AgentConfig).logger.info('Registering OpenBadgesModule')\n dependencyManager.registerInstance(OpenBadgesModuleConfig, this.config)\n\n // Records/Repositories\n dependencyManager.registerSingleton(OpenBadgeCredentialRepository)\n dependencyManager.registerSingleton(OpenBadgesProfileRepository)\n dependencyManager.registerSingleton(OpenBadgesServiceDescriptionRepository)\n dependencyManager.registerSingleton(OpenBadgesOAuthRepository)\n dependencyManager.registerSingleton(OpenBadgesRevocationCacheRepository)\n dependencyManager.registerSingleton(OpenBadgesKeyBindingRepository)\n dependencyManager.registerSingleton(OpenBadgesAuthCodeRepository)\n dependencyManager.registerSingleton(OpenBadgesTokenRepository)\n dependencyManager.registerSingleton(OpenBadgesConsentRepository)\n dependencyManager.registerSingleton(StatusListRepository)\n\n // Services\n dependencyManager.registerSingleton(IssuerService)\n dependencyManager.registerSingleton(VerifyService)\n dependencyManager.registerSingleton(ConsumerService)\n dependencyManager.registerSingleton(OAuthClient)\n dependencyManager.registerSingleton(DidCommLinkService)\n dependencyManager.registerSingleton(DisplayMapper)\n dependencyManager.registerSingleton(ContextService)\n dependencyManager.registerSingleton(DataIntegrityService)\n dependencyManager.registerSingleton(KeyService)\n dependencyManager.registerSingleton(JwtService)\n dependencyManager.registerSingleton(JsonLdCryptoDriver)\n dependencyManager.registerSingleton(JwtCryptoDriver)\n dependencyManager.registerSingleton(ProofService)\n dependencyManager.registerSingleton(RevocationService)\n dependencyManager.registerSingleton(AchievementValidator)\n }\n\n public async initialize(_agentContext: AgentContext): Promise<void> {\n // OpenBadges credentials are exchanged via the standard Issue Credentials v2 protocol.\n // Compose `OpenBadgesCredentialFormatService` onto `DidCommCredentialV2Protocol` from\n // `@credo-ts/didcomm`'s `DidCommCredentialsModule` when constructing your agent.\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAcsF;AAqBtF,IAAa,mBAAb,MAAgD;CAI9C,AAAO,YAAY,SAAwC;OAH3C,MAAM;AAIpB,OAAK,SAAS,IAAI,uBAAuB,QAAQ;;CAGnD,AAAO,SAAS,mBAAsC;AACpD,oBAAkB,QAAQ,YAAY,CAAC,OAAO,KAAK,+BAA+B;AAClF,oBAAkB,iBAAiB,wBAAwB,KAAK,OAAO;AAGvE,oBAAkB,kBAAkB,8BAA8B;AAClE,oBAAkB,kBAAkB,4BAA4B;AAChE,oBAAkB,kBAAkB,uCAAuC;AAC3E,oBAAkB,kBAAkB,0BAA0B;AAC9D,oBAAkB,kBAAkB,oCAAoC;AACxE,oBAAkB,kBAAkB,+BAA+B;AACnE,oBAAkB,kBAAkB,6BAA6B;AACjE,oBAAkB,kBAAkB,0BAA0B;AAC9D,oBAAkB,kBAAkB,4BAA4B;AAChE,oBAAkB,kBAAkB,qBAAqB;AAGzD,oBAAkB,kBAAkB,cAAc;AAClD,oBAAkB,kBAAkB,cAAc;AAClD,oBAAkB,kBAAkB,gBAAgB;AACpD,oBAAkB,kBAAkB,YAAY;AAChD,oBAAkB,kBAAkB,mBAAmB;AACvD,oBAAkB,kBAAkB,cAAc;AAClD,oBAAkB,kBAAkB,eAAe;AACnD,oBAAkB,kBAAkB,qBAAqB;AACzD,oBAAkB,kBAAkB,WAAW;AAC/C,oBAAkB,kBAAkB,WAAW;AAC/C,oBAAkB,kBAAkB,mBAAmB;AACvD,oBAAkB,kBAAkB,gBAAgB;AACpD,oBAAkB,kBAAkB,aAAa;AACjD,oBAAkB,kBAAkB,kBAAkB;AACtD,oBAAkB,kBAAkB,qBAAqB;;CAG3D,MAAa,WAAW,eAA4C"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { CRYPTOSUITE_ECDSA_SD_2023, CRYPTOSUITE_EDDSA_RDFC_2022, PROOF_TYPE_ED25519_2020 } from "./cryptosuites/constants.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/OpenBadgesModuleConfig.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Supported cryptosuites for JSON-LD proofs
|
|
6
|
+
*/
|
|
7
|
+
type Cryptosuite = typeof CRYPTOSUITE_EDDSA_RDFC_2022 | typeof CRYPTOSUITE_ECDSA_SD_2023 | typeof PROOF_TYPE_ED25519_2020;
|
|
8
|
+
/**
|
|
9
|
+
* Supported DID methods
|
|
10
|
+
*/
|
|
11
|
+
type DidMethod = 'did:web' | 'did:key' | 'did:jwk';
|
|
12
|
+
/**
|
|
13
|
+
* Selective disclosure configuration
|
|
14
|
+
*/
|
|
15
|
+
interface SelectiveDisclosureConfig {
|
|
16
|
+
/** Enable selective disclosure support */
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
/** Default mandatory pointers (JSON Pointers that are always disclosed) */
|
|
19
|
+
mandatoryPointers?: string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Status list configuration
|
|
23
|
+
*/
|
|
24
|
+
interface StatusListConfig {
|
|
25
|
+
/** Enable status list support for revocation/suspension */
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
/** Default purpose: 'revocation' or 'suspension' */
|
|
28
|
+
defaultPurpose?: 'revocation' | 'suspension';
|
|
29
|
+
/** Status list credential validity period in seconds */
|
|
30
|
+
validityPeriod?: number;
|
|
31
|
+
}
|
|
32
|
+
type OpenBadgesModuleConfigOptions = {
|
|
33
|
+
/**
|
|
34
|
+
* DID method to use for issuer identifiers
|
|
35
|
+
* @default 'did:web'
|
|
36
|
+
*/
|
|
37
|
+
didMethod?: DidMethod;
|
|
38
|
+
/**
|
|
39
|
+
* Proof format: 'jsonld' (Data Integrity / Linked Data Proof) or 'jwt' (VC-JWT)
|
|
40
|
+
* @default 'jsonld'
|
|
41
|
+
*/
|
|
42
|
+
proofFormat?: 'jsonld' | 'jwt';
|
|
43
|
+
/**
|
|
44
|
+
* Cryptosuite to use for JSON-LD proofs
|
|
45
|
+
* - 'eddsa-rdfc-2022': Ed25519 with RDFC canonicalization (recommended, required for cert)
|
|
46
|
+
* - 'ecdsa-sd-2023': ECDSA P-256 with selective disclosure (required for cert)
|
|
47
|
+
* - 'Ed25519Signature2020': Legacy Ed25519 suite
|
|
48
|
+
* @default 'eddsa-rdfc-2022'
|
|
49
|
+
*/
|
|
50
|
+
cryptosuite?: Cryptosuite;
|
|
51
|
+
/**
|
|
52
|
+
* Selective disclosure configuration
|
|
53
|
+
* Only applicable when cryptosuite is 'ecdsa-sd-2023'
|
|
54
|
+
*/
|
|
55
|
+
selectiveDisclosure?: SelectiveDisclosureConfig;
|
|
56
|
+
/**
|
|
57
|
+
* Status list configuration for credential revocation/suspension
|
|
58
|
+
*/
|
|
59
|
+
statusList?: StatusListConfig;
|
|
60
|
+
/**
|
|
61
|
+
* @deprecated Use proofFormat instead
|
|
62
|
+
*/
|
|
63
|
+
proofType?: 'jsonld' | 'jwt';
|
|
64
|
+
/**
|
|
65
|
+
* @deprecated No longer used
|
|
66
|
+
*/
|
|
67
|
+
allowJwtProofs?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Cache JSON-LD contexts locally
|
|
70
|
+
* @default true
|
|
71
|
+
*/
|
|
72
|
+
cacheContexts?: boolean;
|
|
73
|
+
};
|
|
74
|
+
declare class OpenBadgesModuleConfig {
|
|
75
|
+
readonly didMethod: DidMethod;
|
|
76
|
+
readonly proofFormat: 'jsonld' | 'jwt';
|
|
77
|
+
readonly cryptosuite: Cryptosuite;
|
|
78
|
+
readonly selectiveDisclosure: SelectiveDisclosureConfig;
|
|
79
|
+
readonly statusList: StatusListConfig;
|
|
80
|
+
readonly cacheContexts: boolean;
|
|
81
|
+
/** @deprecated Use proofFormat instead */
|
|
82
|
+
readonly proofType: 'jsonld' | 'jwt';
|
|
83
|
+
/** @deprecated No longer used */
|
|
84
|
+
readonly allowJwtProofs: boolean;
|
|
85
|
+
constructor(options?: OpenBadgesModuleConfigOptions);
|
|
86
|
+
/**
|
|
87
|
+
* Check if selective disclosure is supported and enabled
|
|
88
|
+
*/
|
|
89
|
+
get supportsSelectiveDisclosure(): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Check if using a Data Integrity cryptosuite
|
|
92
|
+
*/
|
|
93
|
+
get isDataIntegritySuite(): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Check if using JWT format
|
|
96
|
+
*/
|
|
97
|
+
get isJwtFormat(): boolean;
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
export { Cryptosuite, DidMethod, OpenBadgesModuleConfig, OpenBadgesModuleConfigOptions, SelectiveDisclosureConfig, StatusListConfig };
|
|
101
|
+
//# sourceMappingURL=OpenBadgesModuleConfig.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenBadgesModuleConfig.d.mts","names":[],"sources":["../src/OpenBadgesModuleConfig.ts"],"mappings":";;;;;AASA;KAAY,WAAA,UACD,2BAAA,UACA,yBAAA,UACA,uBAAA;;;;KAKC,SAAA;;;;UAKK,yBAAA;EAVN;EAYT,OAAA;EAZgC;EAchC,iBAAA;AAAA;;;;UAMe,gBAAA;EAVyB;EAYxC,OAAA;EAVA;EAYA,cAAA;EAJe;EAMf,cAAA;AAAA;AAAA,KAGU,6BAAA;EAPV;;;;EAYA,SAAA,GAAY,SAAA;EALF;;;;EAWV,WAAA;EAesB;;;;;;;EANtB,WAAA,GAAc,WAAA;EAAA;;;;EAMd,mBAAA,GAAsB,yBAAA;EAUtB;;;EALA,UAAA,GAAa,gBAAA;EAgBA;AAGf;;EAdE,SAAA;EAe2B;;;EAV3B,cAAA;EAsB4B;;;;EAhB5B,aAAA;AAAA;AAAA,cAGW,sBAAA;EAAA,SACK,SAAA,EAAW,SAAA;EAAA,SACX,WAAA;EAAA,SACA,WAAA,EAAa,WAAA;EAAA,SACb,mBAAA,EAAqB,yBAAA;EAAA,SACrB,UAAA,EAAY,gBAAA;EAAA,SACZ,aAAA;EAGA;EAAA,SAAA,SAAA;;WAEA,cAAA;cAEG,OAAA,GAAS,6BAAA;EA8BjB;;;EAAA,IAAA,2BAAA,CAAA;EAiBW;;;EAAA,IAVX,oBAAA,CAAA;;;;MAUA,WAAA,CAAA;AAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CRYPTOSUITE_ECDSA_SD_2023, CRYPTOSUITE_EDDSA_RDFC_2022 } from "./cryptosuites/constants.mjs";
|
|
2
|
+
import "./cryptosuites/index.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/OpenBadgesModuleConfig.ts
|
|
5
|
+
var OpenBadgesModuleConfig = class {
|
|
6
|
+
constructor(options = {}) {
|
|
7
|
+
this.didMethod = options.didMethod ?? "did:web";
|
|
8
|
+
this.proofFormat = options.proofFormat ?? options.proofType ?? "jsonld";
|
|
9
|
+
this.proofType = this.proofFormat;
|
|
10
|
+
this.cryptosuite = options.cryptosuite ?? CRYPTOSUITE_EDDSA_RDFC_2022;
|
|
11
|
+
this.selectiveDisclosure = options.selectiveDisclosure ?? {
|
|
12
|
+
enabled: false,
|
|
13
|
+
mandatoryPointers: [
|
|
14
|
+
"/issuer",
|
|
15
|
+
"/validFrom",
|
|
16
|
+
"/credentialSubject/id",
|
|
17
|
+
"/credentialSubject/achievement/id",
|
|
18
|
+
"/credentialSubject/achievement/name"
|
|
19
|
+
]
|
|
20
|
+
};
|
|
21
|
+
this.statusList = options.statusList ?? {
|
|
22
|
+
enabled: false,
|
|
23
|
+
defaultPurpose: "revocation",
|
|
24
|
+
validityPeriod: 86400
|
|
25
|
+
};
|
|
26
|
+
this.cacheContexts = options.cacheContexts ?? true;
|
|
27
|
+
this.allowJwtProofs = options.allowJwtProofs ?? false;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Check if selective disclosure is supported and enabled
|
|
31
|
+
*/
|
|
32
|
+
get supportsSelectiveDisclosure() {
|
|
33
|
+
return this.selectiveDisclosure.enabled && this.cryptosuite === CRYPTOSUITE_ECDSA_SD_2023;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Check if using a Data Integrity cryptosuite
|
|
37
|
+
*/
|
|
38
|
+
get isDataIntegritySuite() {
|
|
39
|
+
return this.cryptosuite === CRYPTOSUITE_EDDSA_RDFC_2022 || this.cryptosuite === CRYPTOSUITE_ECDSA_SD_2023;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Check if using JWT format
|
|
43
|
+
*/
|
|
44
|
+
get isJwtFormat() {
|
|
45
|
+
return this.proofFormat === "jwt";
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { OpenBadgesModuleConfig };
|
|
51
|
+
//# sourceMappingURL=OpenBadgesModuleConfig.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenBadgesModuleConfig.mjs","names":[],"sources":["../src/OpenBadgesModuleConfig.ts"],"sourcesContent":["import {\n CRYPTOSUITE_ECDSA_SD_2023,\n CRYPTOSUITE_EDDSA_RDFC_2022,\n PROOF_TYPE_ED25519_2020,\n} from './cryptosuites'\n\n/**\n * Supported cryptosuites for JSON-LD proofs\n */\nexport type Cryptosuite =\n | typeof CRYPTOSUITE_EDDSA_RDFC_2022 // 'eddsa-rdfc-2022' - Required for OBv3 cert\n | typeof CRYPTOSUITE_ECDSA_SD_2023 // 'ecdsa-sd-2023' - Required for OBv3 cert\n | typeof PROOF_TYPE_ED25519_2020 // 'Ed25519Signature2020' - Legacy\n\n/**\n * Supported DID methods\n */\nexport type DidMethod = 'did:web' | 'did:key' | 'did:jwk'\n\n/**\n * Selective disclosure configuration\n */\nexport interface SelectiveDisclosureConfig {\n /** Enable selective disclosure support */\n enabled: boolean\n /** Default mandatory pointers (JSON Pointers that are always disclosed) */\n mandatoryPointers?: string[]\n}\n\n/**\n * Status list configuration\n */\nexport interface StatusListConfig {\n /** Enable status list support for revocation/suspension */\n enabled: boolean\n /** Default purpose: 'revocation' or 'suspension' */\n defaultPurpose?: 'revocation' | 'suspension'\n /** Status list credential validity period in seconds */\n validityPeriod?: number\n}\n\nexport type OpenBadgesModuleConfigOptions = {\n /**\n * DID method to use for issuer identifiers\n * @default 'did:web'\n */\n didMethod?: DidMethod\n\n /**\n * Proof format: 'jsonld' (Data Integrity / Linked Data Proof) or 'jwt' (VC-JWT)\n * @default 'jsonld'\n */\n proofFormat?: 'jsonld' | 'jwt'\n\n /**\n * Cryptosuite to use for JSON-LD proofs\n * - 'eddsa-rdfc-2022': Ed25519 with RDFC canonicalization (recommended, required for cert)\n * - 'ecdsa-sd-2023': ECDSA P-256 with selective disclosure (required for cert)\n * - 'Ed25519Signature2020': Legacy Ed25519 suite\n * @default 'eddsa-rdfc-2022'\n */\n cryptosuite?: Cryptosuite\n\n /**\n * Selective disclosure configuration\n * Only applicable when cryptosuite is 'ecdsa-sd-2023'\n */\n selectiveDisclosure?: SelectiveDisclosureConfig\n\n /**\n * Status list configuration for credential revocation/suspension\n */\n statusList?: StatusListConfig\n\n /**\n * @deprecated Use proofFormat instead\n */\n proofType?: 'jsonld' | 'jwt'\n\n /**\n * @deprecated No longer used\n */\n allowJwtProofs?: boolean\n\n /**\n * Cache JSON-LD contexts locally\n * @default true\n */\n cacheContexts?: boolean\n}\n\nexport class OpenBadgesModuleConfig {\n public readonly didMethod: DidMethod\n public readonly proofFormat: 'jsonld' | 'jwt'\n public readonly cryptosuite: Cryptosuite\n public readonly selectiveDisclosure: SelectiveDisclosureConfig\n public readonly statusList: StatusListConfig\n public readonly cacheContexts: boolean\n\n /** @deprecated Use proofFormat instead */\n public readonly proofType: 'jsonld' | 'jwt'\n /** @deprecated No longer used */\n public readonly allowJwtProofs: boolean\n\n public constructor(options: OpenBadgesModuleConfigOptions = {}) {\n this.didMethod = options.didMethod ?? 'did:web'\n this.proofFormat = options.proofFormat ?? options.proofType ?? 'jsonld'\n this.proofType = this.proofFormat // Backward compat\n this.cryptosuite = options.cryptosuite ?? CRYPTOSUITE_EDDSA_RDFC_2022\n\n this.selectiveDisclosure = options.selectiveDisclosure ?? {\n enabled: false,\n mandatoryPointers: [\n '/issuer',\n '/validFrom',\n '/credentialSubject/id',\n '/credentialSubject/achievement/id',\n '/credentialSubject/achievement/name',\n ],\n }\n\n this.statusList = options.statusList ?? {\n enabled: false,\n defaultPurpose: 'revocation',\n validityPeriod: 86400, // 24 hours\n }\n\n this.cacheContexts = options.cacheContexts ?? true\n this.allowJwtProofs = options.allowJwtProofs ?? false\n }\n\n /**\n * Check if selective disclosure is supported and enabled\n */\n public get supportsSelectiveDisclosure(): boolean {\n return this.selectiveDisclosure.enabled && this.cryptosuite === CRYPTOSUITE_ECDSA_SD_2023\n }\n\n /**\n * Check if using a Data Integrity cryptosuite\n */\n public get isDataIntegritySuite(): boolean {\n return (\n this.cryptosuite === CRYPTOSUITE_EDDSA_RDFC_2022 ||\n this.cryptosuite === CRYPTOSUITE_ECDSA_SD_2023\n )\n }\n\n /**\n * Check if using JWT format\n */\n public get isJwtFormat(): boolean {\n return this.proofFormat === 'jwt'\n }\n}\n"],"mappings":";;;;AA2FA,IAAa,yBAAb,MAAoC;CAalC,AAAO,YAAY,UAAyC,EAAE,EAAE;AAC9D,OAAK,YAAY,QAAQ,aAAa;AACtC,OAAK,cAAc,QAAQ,eAAe,QAAQ,aAAa;AAC/D,OAAK,YAAY,KAAK;AACtB,OAAK,cAAc,QAAQ,eAAe;AAE1C,OAAK,sBAAsB,QAAQ,uBAAuB;GACxD,SAAS;GACT,mBAAmB;IACjB;IACA;IACA;IACA;IACA;IACD;GACF;AAED,OAAK,aAAa,QAAQ,cAAc;GACtC,SAAS;GACT,gBAAgB;GAChB,gBAAgB;GACjB;AAED,OAAK,gBAAgB,QAAQ,iBAAiB;AAC9C,OAAK,iBAAiB,QAAQ,kBAAkB;;;;;CAMlD,IAAW,8BAAuC;AAChD,SAAO,KAAK,oBAAoB,WAAW,KAAK,gBAAgB;;;;;CAMlE,IAAW,uBAAgC;AACzC,SACE,KAAK,gBAAgB,+BACrB,KAAK,gBAAgB;;;;;CAOzB,IAAW,cAAuB;AAChC,SAAO,KAAK,gBAAgB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { __esmMin } from "../../_rolldown/runtime.mjs";
|
|
2
|
+
|
|
3
|
+
//#region \0@oxc-project+runtime@0.112.0/helpers/decorate.js
|
|
4
|
+
function __decorate(decorators, target, key, desc) {
|
|
5
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
7
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
8
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9
|
+
}
|
|
10
|
+
var init_decorate = __esmMin(() => {});
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
init_decorate();
|
|
14
|
+
export { __decorate, init_decorate };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { __esmMin } from "../../_rolldown/runtime.mjs";
|
|
2
|
+
|
|
3
|
+
//#region \0@oxc-project+runtime@0.112.0/helpers/decorateMetadata.js
|
|
4
|
+
function __decorateMetadata(k, v) {
|
|
5
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
6
|
+
}
|
|
7
|
+
var init_decorateMetadata = __esmMin(() => {});
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
init_decorateMetadata();
|
|
11
|
+
export { __decorateMetadata, init_decorateMetadata };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { __esmMin } from "../../_rolldown/runtime.mjs";
|
|
2
|
+
|
|
3
|
+
//#region \0@oxc-project+runtime@0.112.0/helpers/decorateParam.js
|
|
4
|
+
function __decorateParam(paramIndex, decorator) {
|
|
5
|
+
return function(target, key) {
|
|
6
|
+
decorator(target, key, paramIndex);
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
var init_decorateParam = __esmMin(() => {});
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
init_decorateParam();
|
|
13
|
+
export { __decorateParam, init_decorateParam };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
7
|
+
var __exportAll = (all, no_symbols) => {
|
|
8
|
+
let target = {};
|
|
9
|
+
for (var name in all) {
|
|
10
|
+
__defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
if (!no_symbols) {
|
|
16
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
23
|
+
key = keys[i];
|
|
24
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
25
|
+
__defProp(to, key, {
|
|
26
|
+
get: ((k) => from[k]).bind(null, key),
|
|
27
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return to;
|
|
33
|
+
};
|
|
34
|
+
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
|
|
36
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
37
|
+
throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
export { __esmMin, __exportAll, __require, __toCommonJS };
|