@credo-ts/webvh 0.6.0-alpha-20250805230405
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/build/WebvhApi.d.ts +23 -0
- package/build/WebvhApi.js +30 -0
- package/build/WebvhApi.js.map +1 -0
- package/build/WebvhModule.d.ts +7 -0
- package/build/WebvhModule.js +14 -0
- package/build/WebvhModule.js.map +1 -0
- package/build/anoncreds/services/WebVhAnonCredsRegistry.d.ts +28 -0
- package/build/anoncreds/services/WebVhAnonCredsRegistry.js +377 -0
- package/build/anoncreds/services/WebVhAnonCredsRegistry.js.map +1 -0
- package/build/anoncreds/utils/transform.d.ts +50 -0
- package/build/anoncreds/utils/transform.js +175 -0
- package/build/anoncreds/utils/transform.js.map +1 -0
- package/build/dids/WebvhDidCrypto.d.ts +7 -0
- package/build/dids/WebvhDidCrypto.js +32 -0
- package/build/dids/WebvhDidCrypto.js.map +1 -0
- package/build/dids/WebvhDidResolver.d.ts +27 -0
- package/build/dids/WebvhDidResolver.js +113 -0
- package/build/dids/WebvhDidResolver.js.map +1 -0
- package/build/dids/index.d.ts +2 -0
- package/build/dids/index.js +8 -0
- package/build/dids/index.js.map +1 -0
- package/build/index.d.ts +4 -0
- package/build/index.js +12 -0
- package/build/index.js.map +1 -0
- package/package.json +34 -0
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.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AgentContext } from '@credo-ts/core';
|
|
2
|
+
export declare class WebvhApi {
|
|
3
|
+
private agentContext;
|
|
4
|
+
constructor(agentContext: AgentContext);
|
|
5
|
+
resolveResource(resourceUrl: string): Promise<{
|
|
6
|
+
content: string | Record<string, unknown>;
|
|
7
|
+
contentMetadata: {
|
|
8
|
+
contentType: string;
|
|
9
|
+
retrieved: string;
|
|
10
|
+
};
|
|
11
|
+
dereferencingMetadata: {
|
|
12
|
+
contentType: string;
|
|
13
|
+
};
|
|
14
|
+
error?: undefined;
|
|
15
|
+
message?: undefined;
|
|
16
|
+
} | {
|
|
17
|
+
error: string;
|
|
18
|
+
message: string;
|
|
19
|
+
content?: undefined;
|
|
20
|
+
contentMetadata?: undefined;
|
|
21
|
+
dereferencingMetadata?: undefined;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.WebvhApi = void 0;
|
|
13
|
+
const core_1 = require("@credo-ts/core");
|
|
14
|
+
const tsyringe_1 = require("tsyringe");
|
|
15
|
+
const WebvhDidResolver_1 = require("./dids/WebvhDidResolver");
|
|
16
|
+
let WebvhApi = class WebvhApi {
|
|
17
|
+
constructor(agentContext) {
|
|
18
|
+
this.agentContext = agentContext;
|
|
19
|
+
}
|
|
20
|
+
async resolveResource(resourceUrl) {
|
|
21
|
+
const webvhDidResolver = this.agentContext.dependencyManager.resolve(WebvhDidResolver_1.WebvhDidResolver);
|
|
22
|
+
return await webvhDidResolver.resolveResource(this.agentContext, resourceUrl);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
exports.WebvhApi = WebvhApi;
|
|
26
|
+
exports.WebvhApi = WebvhApi = __decorate([
|
|
27
|
+
(0, tsyringe_1.injectable)(),
|
|
28
|
+
__metadata("design:paramtypes", [core_1.AgentContext])
|
|
29
|
+
], WebvhApi);
|
|
30
|
+
//# sourceMappingURL=WebvhApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebvhApi.js","sourceRoot":"","sources":["../src/WebvhApi.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA6C;AAC7C,uCAAqC;AAErC,8DAA0D;AAGnD,IAAM,QAAQ,GAAd,MAAM,QAAQ;IAGnB,YAAmB,YAA0B;QAC3C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,WAAmB;QAC9C,MAAM,gBAAgB,GAAG,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,mCAAgB,CAAC,CAAA;QACtF,OAAO,MAAM,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;IAC/E,CAAC;CACF,CAAA;AAXY,4BAAQ;mBAAR,QAAQ;IADpB,IAAA,qBAAU,GAAE;qCAIsB,mBAAY;GAHlC,QAAQ,CAWpB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DependencyManager, Module } from '@credo-ts/core';
|
|
2
|
+
export declare class WebvhModule implements Module {
|
|
3
|
+
/**
|
|
4
|
+
* Registers the dependencies of the WebVH module on the dependency manager.
|
|
5
|
+
*/
|
|
6
|
+
register(dependencyManager: DependencyManager): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebvhModule = void 0;
|
|
4
|
+
const WebvhDidResolver_1 = require("./dids/WebvhDidResolver");
|
|
5
|
+
class WebvhModule {
|
|
6
|
+
/**
|
|
7
|
+
* Registers the dependencies of the WebVH module on the dependency manager.
|
|
8
|
+
*/
|
|
9
|
+
register(dependencyManager) {
|
|
10
|
+
dependencyManager.registerSingleton(WebvhDidResolver_1.WebvhDidResolver);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.WebvhModule = WebvhModule;
|
|
14
|
+
//# sourceMappingURL=WebvhModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebvhModule.js","sourceRoot":"","sources":["../src/WebvhModule.ts"],"names":[],"mappings":";;;AAEA,8DAA0D;AAE1D,MAAa,WAAW;IACtB;;OAEG;IACI,QAAQ,CAAC,iBAAoC;QAClD,iBAAiB,CAAC,iBAAiB,CAAC,mCAAgB,CAAC,CAAA;IACvD,CAAC;CACF;AAPD,kCAOC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { AnonCredsRegistry, GetCredentialDefinitionReturn, GetRevocationRegistryDefinitionReturn, GetRevocationStatusListReturn, GetSchemaReturn, RegisterCredentialDefinitionReturn, RegisterRevocationRegistryDefinitionReturn, RegisterRevocationStatusListReturn, RegisterSchemaReturn } from '@credo-ts/anoncreds';
|
|
2
|
+
import type { AgentContext, DataIntegrityProof } from '@credo-ts/core';
|
|
3
|
+
export declare class WebVhAnonCredsRegistry implements AnonCredsRegistry {
|
|
4
|
+
methodName: string;
|
|
5
|
+
/**
|
|
6
|
+
* This class supports resolving objects with did:webvh identifiers.
|
|
7
|
+
*/
|
|
8
|
+
readonly supportedIdentifier: RegExp;
|
|
9
|
+
/**
|
|
10
|
+
* Resolves a resource using the WebvhDidResolver and performs common validation steps.
|
|
11
|
+
*
|
|
12
|
+
* @param agentContext The agent context.
|
|
13
|
+
* @param resourceId The DID URI of the resource to resolve.
|
|
14
|
+
* @param resourceTypeString A descriptive string for the resource type (e.g., 'schema', 'credential definition') used in logs/errors.
|
|
15
|
+
* @returns The parsed and validated WebVhResource object and the original resolution result.
|
|
16
|
+
* @throws {CredoError} If resolution, parsing, or validation fails.
|
|
17
|
+
*/
|
|
18
|
+
private _resolveAndValidateAttestedResource;
|
|
19
|
+
getSchema(agentContext: AgentContext, schemaId: string): Promise<GetSchemaReturn>;
|
|
20
|
+
getCredentialDefinition(agentContext: AgentContext, credentialDefinitionId: string): Promise<GetCredentialDefinitionReturn>;
|
|
21
|
+
getRevocationRegistryDefinition(agentContext: AgentContext, revocationRegistryDefinitionId: string): Promise<GetRevocationRegistryDefinitionReturn>;
|
|
22
|
+
getRevocationStatusList(agentContext: AgentContext, revocationRegistryId: string, timestamp: number): Promise<GetRevocationStatusListReturn>;
|
|
23
|
+
registerSchema(agentContext: AgentContext): Promise<RegisterSchemaReturn>;
|
|
24
|
+
registerCredentialDefinition(agentContext: AgentContext): Promise<RegisterCredentialDefinitionReturn>;
|
|
25
|
+
registerRevocationRegistryDefinition(agentContext: AgentContext): Promise<RegisterRevocationRegistryDefinitionReturn>;
|
|
26
|
+
registerRevocationStatusList(agentContext: AgentContext): Promise<RegisterRevocationStatusListReturn>;
|
|
27
|
+
verifyProof(agentContext: AgentContext, proof: DataIntegrityProof, content: unknown): Promise<boolean>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebVhAnonCredsRegistry = void 0;
|
|
4
|
+
const core_1 = require("@credo-ts/core");
|
|
5
|
+
const json_canonicalize_1 = require("json-canonicalize");
|
|
6
|
+
const dids_1 = require("../../dids");
|
|
7
|
+
const transform_1 = require("../utils/transform");
|
|
8
|
+
class WebVhAnonCredsRegistry {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.methodName = 'webvh';
|
|
11
|
+
/**
|
|
12
|
+
* This class supports resolving objects with did:webvh identifiers.
|
|
13
|
+
*/
|
|
14
|
+
this.supportedIdentifier = /^did:webvh:.*/;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Resolves a resource using the WebvhDidResolver and performs common validation steps.
|
|
18
|
+
*
|
|
19
|
+
* @param agentContext The agent context.
|
|
20
|
+
* @param resourceId The DID URI of the resource to resolve.
|
|
21
|
+
* @param resourceTypeString A descriptive string for the resource type (e.g., 'schema', 'credential definition') used in logs/errors.
|
|
22
|
+
* @returns The parsed and validated WebVhResource object and the original resolution result.
|
|
23
|
+
* @throws {CredoError} If resolution, parsing, or validation fails.
|
|
24
|
+
*/
|
|
25
|
+
async _resolveAndValidateAttestedResource(agentContext, resourceId, resourceTypeString) {
|
|
26
|
+
try {
|
|
27
|
+
const webvhDidResolver = agentContext.dependencyManager.resolve(dids_1.WebvhDidResolver);
|
|
28
|
+
if (!this.supportedIdentifier.test(resourceId))
|
|
29
|
+
throw new core_1.CredoError(`Invalid ${resourceTypeString} ID: ${resourceId}`);
|
|
30
|
+
agentContext.config.logger.trace(`Attempting to resolve ${resourceTypeString} resource '${resourceId}' via did:webvh resolver`);
|
|
31
|
+
const resolutionResult = await webvhDidResolver.resolveResource(agentContext, resourceId);
|
|
32
|
+
if (!resolutionResult) {
|
|
33
|
+
throw new core_1.CredoError(`Resource resolution returned null/undefined for ${resourceId}`);
|
|
34
|
+
}
|
|
35
|
+
if ('error' in resolutionResult || !('content' in resolutionResult)) {
|
|
36
|
+
throw new core_1.CredoError(`Resource ${resourceId} could not be resolved or is missing data. Error: ${resolutionResult.error || 'unknown'} - ${resolutionResult.message || 'no message'}`);
|
|
37
|
+
}
|
|
38
|
+
let resourceObject;
|
|
39
|
+
try {
|
|
40
|
+
agentContext.config.logger.trace(`Parsing resource data: ${JSON.stringify(resolutionResult.content).substring(0, 200)}...`);
|
|
41
|
+
resourceObject = core_1.JsonTransformer.fromJSON(resolutionResult.content, transform_1.WebVhResource);
|
|
42
|
+
}
|
|
43
|
+
catch (parseError) {
|
|
44
|
+
agentContext.config.logger.error(`Failed to parse resource data for ${resourceId}`, {
|
|
45
|
+
error: parseError instanceof Error ? parseError.message : String(parseError),
|
|
46
|
+
stack: parseError instanceof Error ? parseError.stack : undefined,
|
|
47
|
+
});
|
|
48
|
+
throw new core_1.CredoError(`Failed to parse resource data for ${resourceId}: ${parseError instanceof Error ? parseError.message : String(parseError)}`);
|
|
49
|
+
}
|
|
50
|
+
// --- Validation Steps on parsed object ---
|
|
51
|
+
// 1. Check for attestation type
|
|
52
|
+
if (!Array.isArray(resourceObject.type) || !resourceObject.type.includes('AttestedResource')) {
|
|
53
|
+
throw new core_1.CredoError('Resolved resource data is not attested.');
|
|
54
|
+
}
|
|
55
|
+
agentContext.config.logger.trace(`Resource ${resourceId} attestation found.`);
|
|
56
|
+
// 2. Check for valid proof
|
|
57
|
+
const isProofValid = await this.verifyProof(agentContext, resourceObject.proof, resourceObject.content);
|
|
58
|
+
if (!isProofValid) {
|
|
59
|
+
throw new core_1.CredoError('Resolved resource proof is invalid.');
|
|
60
|
+
}
|
|
61
|
+
agentContext.config.logger.trace(`Resource ${resourceId} proof validated.`);
|
|
62
|
+
// 3. Check filename hash against content hash
|
|
63
|
+
const contentObject = resourceObject.content;
|
|
64
|
+
if (!contentObject) {
|
|
65
|
+
throw new core_1.CredoError('Resolved resource data does not contain a content object.');
|
|
66
|
+
}
|
|
67
|
+
const parts = resourceId.split(/[:/]/);
|
|
68
|
+
const expectedMultibaseHash = parts[parts.length - 1];
|
|
69
|
+
if (!expectedMultibaseHash) {
|
|
70
|
+
throw new core_1.CredoError(`Could not extract expected hash from ${resourceTypeString} ID: ${resourceId}`);
|
|
71
|
+
}
|
|
72
|
+
const contentString = (0, json_canonicalize_1.canonicalize)(contentObject);
|
|
73
|
+
const actualHashMultibase = core_1.MultiBaseEncoder.encode(core_1.MultiHashEncoder.encode(core_1.TypedArrayEncoder.fromString(contentString), 'sha-256'), 'base58btc');
|
|
74
|
+
if (actualHashMultibase !== expectedMultibaseHash) {
|
|
75
|
+
throw new core_1.CredoError(`Content hash mismatch for ${resourceId}. Expected: ${expectedMultibaseHash}, Actual: ${actualHashMultibase}`);
|
|
76
|
+
}
|
|
77
|
+
agentContext.config.logger.trace(`Resource ${resourceId} content hash matches filename.`);
|
|
78
|
+
// 4. Check that the issuerId in the content matches the DID part of the resourceId
|
|
79
|
+
const contentIssuerId = contentObject?.issuerId; // Type assertion for accessing issuerId
|
|
80
|
+
if (!contentIssuerId || typeof contentIssuerId !== 'string') {
|
|
81
|
+
throw new core_1.CredoError(`Resolved resource content for ${resourceId} is missing a valid issuerId.`);
|
|
82
|
+
}
|
|
83
|
+
// Extract the DID from the resourceId (part before /resources/hash)
|
|
84
|
+
const resourceDidMatch = resourceId.match(/^(did:webvh:[^/]+)/);
|
|
85
|
+
if (!resourceDidMatch || !resourceDidMatch[1]) {
|
|
86
|
+
throw new core_1.CredoError(`Could not extract DID from resource ID: ${resourceId}`);
|
|
87
|
+
}
|
|
88
|
+
const expectedIssuerDid = resourceDidMatch[1];
|
|
89
|
+
if (contentIssuerId !== expectedIssuerDid) {
|
|
90
|
+
throw new core_1.CredoError(`Issuer ID mismatch for ${resourceId}. Expected: ${expectedIssuerDid}, Actual: ${contentIssuerId}`);
|
|
91
|
+
}
|
|
92
|
+
agentContext.config.logger.trace(`Resource ${resourceId} issuer ID matches DID.`);
|
|
93
|
+
return { resourceObject, resolutionResult };
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
agentContext.config.logger.error('Error in did:webvh _resolveAndValidateAttestedResource:', error);
|
|
97
|
+
throw error;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
async getSchema(agentContext, schemaId) {
|
|
101
|
+
try {
|
|
102
|
+
const { resourceObject, resolutionResult } = await this._resolveAndValidateAttestedResource(agentContext, schemaId, 'schema');
|
|
103
|
+
// --- Parsing Step (Simplified) ---
|
|
104
|
+
const schemaContent = resourceObject.content;
|
|
105
|
+
// Type check to ensure we have a schema content object
|
|
106
|
+
if (!('attrNames' in schemaContent) || !('name' in schemaContent) || !('version' in schemaContent)) {
|
|
107
|
+
throw new core_1.CredoError(`Parsed resource content for ${schemaId} is not a valid schema.`);
|
|
108
|
+
}
|
|
109
|
+
// Use the issuerId from the content if available, otherwise extract from schemaId
|
|
110
|
+
// We need the hash part for this, extract it again or pass from helper?
|
|
111
|
+
// For simplicity, extract again.
|
|
112
|
+
const parts = schemaId.split(/[:/]/);
|
|
113
|
+
const expectedMultibaseHash = parts[parts.length - 1];
|
|
114
|
+
const issuerId = schemaContent.issuerId ||
|
|
115
|
+
schemaId.substring(0, schemaId.lastIndexOf(expectedMultibaseHash)).replace(/[:/]$/, '');
|
|
116
|
+
return {
|
|
117
|
+
schema: {
|
|
118
|
+
attrNames: schemaContent.attrNames,
|
|
119
|
+
name: schemaContent.name,
|
|
120
|
+
version: schemaContent.version,
|
|
121
|
+
issuerId: issuerId,
|
|
122
|
+
},
|
|
123
|
+
schemaId,
|
|
124
|
+
resolutionMetadata: resolutionResult.dereferencingMetadata || {},
|
|
125
|
+
schemaMetadata: resolutionResult.contentMetadata || {},
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
agentContext.config.logger.error(`Error retrieving schema '${schemaId}' via did:webvh`, {
|
|
130
|
+
error: error instanceof Error ? error.message : String(error),
|
|
131
|
+
schemaId,
|
|
132
|
+
});
|
|
133
|
+
return {
|
|
134
|
+
schemaId,
|
|
135
|
+
resolutionMetadata: {
|
|
136
|
+
error: 'invalid',
|
|
137
|
+
message: `unable to resolve schema: ${error instanceof Error ? error.message : String(error)}`,
|
|
138
|
+
},
|
|
139
|
+
schemaMetadata: {},
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
async getCredentialDefinition(agentContext, credentialDefinitionId) {
|
|
144
|
+
try {
|
|
145
|
+
const { resourceObject, resolutionResult } = await this._resolveAndValidateAttestedResource(agentContext, credentialDefinitionId, 'credential definition');
|
|
146
|
+
// Extract the content and make sure it's a CredDef
|
|
147
|
+
const credDefContent = resourceObject.content;
|
|
148
|
+
// Type check for WebVhCredDefContent
|
|
149
|
+
if (!('schemaId' in credDefContent) ||
|
|
150
|
+
!('type' in credDefContent) ||
|
|
151
|
+
!('tag' in credDefContent) ||
|
|
152
|
+
!('value' in credDefContent)) {
|
|
153
|
+
throw new core_1.CredoError('Resolved resource content is not a valid credential definition.');
|
|
154
|
+
}
|
|
155
|
+
// Extract metadata from the resolved resource
|
|
156
|
+
const credDefMetadata = resourceObject.metadata || resolutionResult.contentMetadata || {};
|
|
157
|
+
return {
|
|
158
|
+
credentialDefinition: {
|
|
159
|
+
issuerId: credDefContent.issuerId,
|
|
160
|
+
schemaId: credDefContent.schemaId,
|
|
161
|
+
type: 'CL', // Assuming CL type for now, might need adjustment if other types are supported
|
|
162
|
+
tag: credDefContent.tag,
|
|
163
|
+
value: credDefContent.value, // Assuming structure
|
|
164
|
+
},
|
|
165
|
+
credentialDefinitionId,
|
|
166
|
+
resolutionMetadata: resolutionResult.dereferencingMetadata || {},
|
|
167
|
+
credentialDefinitionMetadata: credDefMetadata,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
agentContext.config.logger.error(`Error retrieving credential definition '${credentialDefinitionId}' via did:webvh`, {
|
|
172
|
+
error: error instanceof Error ? error.message : String(error),
|
|
173
|
+
credentialDefinitionId,
|
|
174
|
+
});
|
|
175
|
+
return {
|
|
176
|
+
credentialDefinitionId,
|
|
177
|
+
resolutionMetadata: {
|
|
178
|
+
error: 'invalid',
|
|
179
|
+
message: `unable to resolve credential definition: ${error instanceof Error ? error.message : String(error)}`,
|
|
180
|
+
},
|
|
181
|
+
credentialDefinitionMetadata: {},
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
async getRevocationRegistryDefinition(agentContext, revocationRegistryDefinitionId) {
|
|
186
|
+
try {
|
|
187
|
+
const { resourceObject, resolutionResult } = await this._resolveAndValidateAttestedResource(agentContext, revocationRegistryDefinitionId, 'revocation registry definition');
|
|
188
|
+
const revRegDefContent = resourceObject.content;
|
|
189
|
+
if (!('revocDefType' in revRegDefContent) ||
|
|
190
|
+
!('credDefId' in revRegDefContent) ||
|
|
191
|
+
!('tag' in revRegDefContent) ||
|
|
192
|
+
!('value' in revRegDefContent)) {
|
|
193
|
+
throw new core_1.CredoError(`Parsed resource content for ${revocationRegistryDefinitionId} is not a valid revocation registry definition.`);
|
|
194
|
+
}
|
|
195
|
+
// Extract metadata
|
|
196
|
+
const revRegDefMetadata = resourceObject.metadata || resolutionResult.contentMetadata || {};
|
|
197
|
+
return {
|
|
198
|
+
revocationRegistryDefinition: {
|
|
199
|
+
issuerId: revRegDefContent.issuerId,
|
|
200
|
+
revocDefType: revRegDefContent.revocDefType, // TODO: Map revocDefType string to AnonCreds type
|
|
201
|
+
credDefId: revRegDefContent.credDefId,
|
|
202
|
+
tag: revRegDefContent.tag,
|
|
203
|
+
value: revRegDefContent.value, // TODO: Map value structure to AnonCreds type
|
|
204
|
+
},
|
|
205
|
+
revocationRegistryDefinitionId,
|
|
206
|
+
resolutionMetadata: resolutionResult.dereferencingMetadata || {},
|
|
207
|
+
revocationRegistryDefinitionMetadata: revRegDefMetadata,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
catch (error) {
|
|
211
|
+
agentContext.config.logger.error(`Error retrieving revocation registry definition '${revocationRegistryDefinitionId}' via did:webvh`, {
|
|
212
|
+
error: error instanceof Error ? error.message : String(error),
|
|
213
|
+
revocationRegistryDefinitionId,
|
|
214
|
+
});
|
|
215
|
+
return {
|
|
216
|
+
revocationRegistryDefinitionId,
|
|
217
|
+
resolutionMetadata: {
|
|
218
|
+
error: 'invalid',
|
|
219
|
+
message: `unable to resolve revocation registry definition: ${error instanceof Error ? error.message : String(error)}`,
|
|
220
|
+
},
|
|
221
|
+
revocationRegistryDefinitionMetadata: {},
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
async getRevocationStatusList(agentContext, revocationRegistryId, timestamp // TODO: How should timestamp be handled?
|
|
226
|
+
) {
|
|
227
|
+
try {
|
|
228
|
+
const webvhDidResolver = agentContext.dependencyManager.resolve(dids_1.WebvhDidResolver);
|
|
229
|
+
if (!revocationRegistryId.startsWith('did:web:'))
|
|
230
|
+
throw new core_1.CredoError(`Invalid revocationRegistryId: ${revocationRegistryId}`);
|
|
231
|
+
agentContext.config.logger.trace(`Attempting to resolve revocation status list resource for '${revocationRegistryId}' at timestamp ${timestamp} via did:web resolver`);
|
|
232
|
+
// TODO: Determine how to incorporate the timestamp into the resolution process for did:web
|
|
233
|
+
// Maybe resolving just the revocationRegistryId gives the structure, and another resource/path gives the status at a time?
|
|
234
|
+
// For now, just resolving the base ID.
|
|
235
|
+
const effectiveIdToResolve = revocationRegistryId; // Adjust this based on timestamp handling strategy
|
|
236
|
+
// Attempt to resolve the resource
|
|
237
|
+
await webvhDidResolver.resolveResource(agentContext, effectiveIdToResolve);
|
|
238
|
+
// TODO: Implement actual logic for parsing the resolved resource into AnonCreds RevocationStatusList format
|
|
239
|
+
throw new core_1.CredoError('Method not implemented.');
|
|
240
|
+
// Placeholder return - replace with actual implementation
|
|
241
|
+
/*
|
|
242
|
+
return {
|
|
243
|
+
revocationStatusList: {
|
|
244
|
+
issuerId: '', // Extract issuerId from revocationRegistryId or resolved data
|
|
245
|
+
revRegDefId: revocationRegistryId,
|
|
246
|
+
currentAccumulator: '', // Replace with actual data
|
|
247
|
+
revocationList: [], // Replace with actual data
|
|
248
|
+
timestamp: 0 // Extract or determine timestamp based on resolved data
|
|
249
|
+
},
|
|
250
|
+
resolutionMetadata: {},
|
|
251
|
+
revocationStatusListMetadata: {},
|
|
252
|
+
}
|
|
253
|
+
*/
|
|
254
|
+
}
|
|
255
|
+
catch (error) {
|
|
256
|
+
agentContext.config.logger.error(`Error retrieving revocation registry status list '${revocationRegistryId}' via did:web`, {
|
|
257
|
+
error,
|
|
258
|
+
revocationRegistryId,
|
|
259
|
+
timestamp,
|
|
260
|
+
});
|
|
261
|
+
return {
|
|
262
|
+
resolutionMetadata: {
|
|
263
|
+
error: 'notFound',
|
|
264
|
+
message: `unable to resolve revocation registry status list: ${error.message}`,
|
|
265
|
+
},
|
|
266
|
+
revocationStatusListMetadata: {},
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
async registerSchema(agentContext) {
|
|
271
|
+
agentContext.config.logger.warn('registerSchema not implemented for WebVhAnonCredsRegistry');
|
|
272
|
+
throw new core_1.CredoError('Method not implemented.');
|
|
273
|
+
}
|
|
274
|
+
async registerCredentialDefinition(agentContext) {
|
|
275
|
+
agentContext.config.logger.warn('registerCredentialDefinition not implemented for WebVhAnonCredsRegistry');
|
|
276
|
+
throw new core_1.CredoError('Method not implemented.');
|
|
277
|
+
}
|
|
278
|
+
async registerRevocationRegistryDefinition(agentContext) {
|
|
279
|
+
agentContext.config.logger.warn('registerRevocationRegistryDefinition not implemented for WebVhAnonCredsRegistry');
|
|
280
|
+
throw new core_1.CredoError('Method not implemented.');
|
|
281
|
+
}
|
|
282
|
+
async registerRevocationStatusList(agentContext) {
|
|
283
|
+
agentContext.config.logger.warn('registerRevocationStatusList not implemented for WebVhAnonCredsRegistry');
|
|
284
|
+
throw new core_1.CredoError('Method not implemented.');
|
|
285
|
+
}
|
|
286
|
+
// Proof validation logic for DataIntegrityProof with eddsa-jcs-2022
|
|
287
|
+
async verifyProof(agentContext, proof, content) {
|
|
288
|
+
try {
|
|
289
|
+
// Type check the proof object
|
|
290
|
+
if (!proof || typeof proof !== 'object') {
|
|
291
|
+
agentContext.config.logger.error('Invalid proof: proof must be an object in did:webvh resource proof');
|
|
292
|
+
return false;
|
|
293
|
+
}
|
|
294
|
+
// Validate proof structure for DataIntegrityProof
|
|
295
|
+
if (proof.type !== 'DataIntegrityProof') {
|
|
296
|
+
agentContext.config.logger.error(`Unsupported type: ${proof.type} in did:webvh resource proof`);
|
|
297
|
+
return false;
|
|
298
|
+
}
|
|
299
|
+
if (proof.cryptosuite !== 'eddsa-jcs-2022') {
|
|
300
|
+
agentContext.config.logger.error(`Unsupported cryptosuite: ${proof.cryptosuite} in did:webvh resource proof`);
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
if (!proof.verificationMethod || typeof proof.verificationMethod !== 'string') {
|
|
304
|
+
agentContext.config.logger.error('Invalid verificationMethod in did:webvh resource proof');
|
|
305
|
+
return false;
|
|
306
|
+
}
|
|
307
|
+
if (!proof.proofValue || typeof proof.proofValue !== 'string') {
|
|
308
|
+
agentContext.config.logger.error('Invalid proofValue in did:webvh resource proof');
|
|
309
|
+
return false;
|
|
310
|
+
}
|
|
311
|
+
// Resolve the verification method to get the public key
|
|
312
|
+
const didsApi = agentContext.dependencyManager.resolve(core_1.DidsApi);
|
|
313
|
+
const didDocument = await didsApi.resolveDidDocument(proof.verificationMethod);
|
|
314
|
+
if (!didDocument) {
|
|
315
|
+
agentContext.config.logger.error('Could not resolve verification method did:webvh DID document');
|
|
316
|
+
return false;
|
|
317
|
+
}
|
|
318
|
+
// Extract the verification method from the DID document
|
|
319
|
+
let verificationMethod;
|
|
320
|
+
if (proof.verificationMethod.includes('#')) {
|
|
321
|
+
const fragment = proof.verificationMethod.split('#')[1];
|
|
322
|
+
verificationMethod = didDocument.verificationMethod?.find((vm) => vm.id.endsWith(`#${fragment}`));
|
|
323
|
+
}
|
|
324
|
+
if (!verificationMethod) {
|
|
325
|
+
agentContext.config.logger.error('Could not find verification method in did:webvh DID document');
|
|
326
|
+
return false;
|
|
327
|
+
}
|
|
328
|
+
// Extract public key from verification method
|
|
329
|
+
let publicKeyBytes;
|
|
330
|
+
if ('publicKeyMultibase' in verificationMethod && verificationMethod.publicKeyMultibase) {
|
|
331
|
+
const publicKeyBuffer = core_1.MultiBaseEncoder.decode(verificationMethod.publicKeyMultibase);
|
|
332
|
+
publicKeyBytes = publicKeyBuffer.data;
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
agentContext.config.logger.error('did:webvh resource verification method does not contain a supported public key format');
|
|
336
|
+
return false;
|
|
337
|
+
}
|
|
338
|
+
// For eddsa-jcs-2022, we need to:
|
|
339
|
+
// 1. Create a document with the content and proof metadata (without proofValue)
|
|
340
|
+
// 2. Canonicalize it using JCS (JSON Canonicalization Scheme)
|
|
341
|
+
// 3. Verify the signature using EdDSA
|
|
342
|
+
// Create the document to be verified (content + proof without proofValue)
|
|
343
|
+
const documentToVerify = {
|
|
344
|
+
...content,
|
|
345
|
+
proof: {
|
|
346
|
+
type: proof.type,
|
|
347
|
+
cryptosuite: proof.cryptosuite,
|
|
348
|
+
verificationMethod: proof.verificationMethod,
|
|
349
|
+
proofPurpose: proof.proofPurpose || 'assertionMethod',
|
|
350
|
+
created: proof.created || new Date().toISOString(),
|
|
351
|
+
},
|
|
352
|
+
};
|
|
353
|
+
// Canonicalize the document using JCS
|
|
354
|
+
const canonicalizedDocument = (0, json_canonicalize_1.canonicalize)(documentToVerify);
|
|
355
|
+
const documentBytes = core_1.TypedArrayEncoder.fromString(canonicalizedDocument);
|
|
356
|
+
// Decode the signature from the proofValue (should be multibase encoded)
|
|
357
|
+
const signatureBuffer = core_1.MultiBaseEncoder.decode(proof.proofValue);
|
|
358
|
+
const crypto = new dids_1.WebvhDidCrypto(agentContext);
|
|
359
|
+
const isVerified = await crypto.verify(signatureBuffer.data, documentBytes, publicKeyBytes);
|
|
360
|
+
if (!isVerified) {
|
|
361
|
+
agentContext.config.logger.error('Signature verification failed for did:webvh resource');
|
|
362
|
+
return false;
|
|
363
|
+
}
|
|
364
|
+
agentContext.config.logger.debug('DataIntegrityProof verification successful');
|
|
365
|
+
return true;
|
|
366
|
+
}
|
|
367
|
+
catch (error) {
|
|
368
|
+
agentContext.config.logger.error('Error during proof validation of did:webvh resource', {
|
|
369
|
+
error: error instanceof Error ? error.message : String(error),
|
|
370
|
+
stack: error instanceof Error ? error.stack : undefined,
|
|
371
|
+
});
|
|
372
|
+
return false;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
exports.WebVhAnonCredsRegistry = WebVhAnonCredsRegistry;
|
|
377
|
+
//# sourceMappingURL=WebVhAnonCredsRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebVhAnonCredsRegistry.js","sourceRoot":"","sources":["../../../src/anoncreds/services/WebVhAnonCredsRegistry.ts"],"names":[],"mappings":";;;AAeA,yCAOuB;AACvB,yDAAgD;AAEhD,qCAA6D;AAC7D,kDAAkD;AAUlD,MAAa,sBAAsB;IAAnC;QACS,eAAU,GAAG,OAAO,CAAA;QAE3B;;WAEG;QACa,wBAAmB,GAAG,eAAe,CAAA;IAievD,CAAC;IA/dC;;;;;;;;OAQG;IACK,KAAK,CAAC,mCAAmC,CAC/C,YAA0B,EAC1B,UAAkB,EAClB,kBAA0B;QAE1B,IAAI,CAAC;YACH,MAAM,gBAAgB,GAAG,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,uBAAgB,CAAC,CAAA;YACjF,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC;gBAC5C,MAAM,IAAI,iBAAU,CAAC,WAAW,kBAAkB,QAAQ,UAAU,EAAE,CAAC,CAAA;YAEzE,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAC9B,yBAAyB,kBAAkB,cAAc,U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C,YAAY,CAAC,CAAA;YAC/C,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,aAAa,EAAE,cAAc,CAAC,CAAA;YAE3F,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChB,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,sDAAsD,CAAC,CAAA;gBACxF,OAAO,KAAK,CAAA;YACd,CAAC;YAED,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAA;YAC9E,OAAO,IAAI,CAAA;QACb,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,qDAAqD,EAAE;gBACtF,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;gBAC7D,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;aACxD,CAAC,CAAA;YACF,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;CACF;AAveD,wDAueC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare class WebVhSchemaContent {
|
|
2
|
+
attrNames: string[];
|
|
3
|
+
name: string;
|
|
4
|
+
version: string;
|
|
5
|
+
issuerId?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class WebVhCredDefContent {
|
|
8
|
+
issuerId: string;
|
|
9
|
+
schemaId: string;
|
|
10
|
+
type: string;
|
|
11
|
+
tag: string;
|
|
12
|
+
value: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
export declare class WebVhRevRegDefContent {
|
|
15
|
+
issuerId: string;
|
|
16
|
+
revocDefType: string;
|
|
17
|
+
credDefId: string;
|
|
18
|
+
tag: string;
|
|
19
|
+
value: {
|
|
20
|
+
publicKeys: {
|
|
21
|
+
accumKey: {
|
|
22
|
+
z: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
maxCredNum: number;
|
|
26
|
+
tailsLocation: string;
|
|
27
|
+
tailsHash: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export declare class WebVhProof {
|
|
31
|
+
type: string;
|
|
32
|
+
cryptosuite: string;
|
|
33
|
+
proofPurpose: string;
|
|
34
|
+
proofValue: string;
|
|
35
|
+
verificationMethod: string;
|
|
36
|
+
}
|
|
37
|
+
export declare class WebVhResource {
|
|
38
|
+
'@context': string[];
|
|
39
|
+
type: string[];
|
|
40
|
+
id: string;
|
|
41
|
+
content: WebVhSchemaContent | WebVhCredDefContent | WebVhRevRegDefContent;
|
|
42
|
+
proof: WebVhProof;
|
|
43
|
+
metadata?: Record<string, unknown>;
|
|
44
|
+
links?: WebVhLink[];
|
|
45
|
+
}
|
|
46
|
+
export declare class WebVhLink {
|
|
47
|
+
id: string;
|
|
48
|
+
type: string;
|
|
49
|
+
timestamp?: number;
|
|
50
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.WebVhLink = exports.WebVhResource = exports.WebVhProof = exports.WebVhRevRegDefContent = exports.WebVhCredDefContent = exports.WebVhSchemaContent = void 0;
|
|
13
|
+
const core_1 = require("@credo-ts/core");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
class WebVhSchemaContent {
|
|
17
|
+
}
|
|
18
|
+
exports.WebVhSchemaContent = WebVhSchemaContent;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsArray)(),
|
|
21
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
22
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
23
|
+
(0, class_transformer_1.Type)(() => String),
|
|
24
|
+
__metadata("design:type", Array)
|
|
25
|
+
], WebVhSchemaContent.prototype, "attrNames", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsString)(),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], WebVhSchemaContent.prototype, "name", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_validator_1.IsString)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], WebVhSchemaContent.prototype, "version", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_validator_1.IsOptional)(),
|
|
36
|
+
(0, class_validator_1.IsString)(),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], WebVhSchemaContent.prototype, "issuerId", void 0);
|
|
39
|
+
class WebVhCredDefContent {
|
|
40
|
+
}
|
|
41
|
+
exports.WebVhCredDefContent = WebVhCredDefContent;
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_validator_1.IsString)(),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], WebVhCredDefContent.prototype, "issuerId", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, class_validator_1.IsString)(),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], WebVhCredDefContent.prototype, "schemaId", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, class_validator_1.IsString)(),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], WebVhCredDefContent.prototype, "type", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, class_validator_1.IsString)(),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], WebVhCredDefContent.prototype, "tag", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, class_validator_1.IsObject)(),
|
|
60
|
+
__metadata("design:type", Object)
|
|
61
|
+
], WebVhCredDefContent.prototype, "value", void 0);
|
|
62
|
+
class WebVhRevRegDefContent {
|
|
63
|
+
}
|
|
64
|
+
exports.WebVhRevRegDefContent = WebVhRevRegDefContent;
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, class_validator_1.IsString)(),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], WebVhRevRegDefContent.prototype, "issuerId", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, class_validator_1.IsString)(),
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], WebVhRevRegDefContent.prototype, "revocDefType", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, class_validator_1.IsString)(),
|
|
75
|
+
__metadata("design:type", String)
|
|
76
|
+
], WebVhRevRegDefContent.prototype, "credDefId", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, class_validator_1.IsString)(),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], WebVhRevRegDefContent.prototype, "tag", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, class_validator_1.IsObject)(),
|
|
83
|
+
__metadata("design:type", Object)
|
|
84
|
+
], WebVhRevRegDefContent.prototype, "value", void 0);
|
|
85
|
+
class WebVhProof {
|
|
86
|
+
}
|
|
87
|
+
exports.WebVhProof = WebVhProof;
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, class_validator_1.IsString)(),
|
|
90
|
+
__metadata("design:type", String)
|
|
91
|
+
], WebVhProof.prototype, "type", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, class_validator_1.IsString)(),
|
|
94
|
+
__metadata("design:type", String)
|
|
95
|
+
], WebVhProof.prototype, "cryptosuite", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, class_validator_1.IsString)(),
|
|
98
|
+
__metadata("design:type", String)
|
|
99
|
+
], WebVhProof.prototype, "proofPurpose", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, class_validator_1.IsString)(),
|
|
102
|
+
__metadata("design:type", String)
|
|
103
|
+
], WebVhProof.prototype, "proofValue", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, class_validator_1.IsString)(),
|
|
106
|
+
__metadata("design:type", String)
|
|
107
|
+
], WebVhProof.prototype, "verificationMethod", void 0);
|
|
108
|
+
class WebVhResource {
|
|
109
|
+
}
|
|
110
|
+
exports.WebVhResource = WebVhResource;
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, class_validator_1.IsArray)(),
|
|
113
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
114
|
+
(0, class_transformer_1.Type)(() => String),
|
|
115
|
+
__metadata("design:type", Array)
|
|
116
|
+
], WebVhResource.prototype, "@context", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, class_validator_1.Validate)(core_1.IsStringOrStringArray),
|
|
119
|
+
(0, class_transformer_1.Transform)(({ value }) => (Array.isArray(value) ? value : [value])),
|
|
120
|
+
(0, class_transformer_1.Type)(() => String),
|
|
121
|
+
__metadata("design:type", Array)
|
|
122
|
+
], WebVhResource.prototype, "type", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
(0, class_validator_1.IsString)(),
|
|
125
|
+
__metadata("design:type", String)
|
|
126
|
+
], WebVhResource.prototype, "id", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
(0, class_transformer_1.Expose)(),
|
|
129
|
+
(0, class_transformer_1.Transform)(({ value }) => {
|
|
130
|
+
if (value && 'attrNames' in value) {
|
|
131
|
+
return core_1.JsonTransformer.fromJSON(value, WebVhSchemaContent);
|
|
132
|
+
}
|
|
133
|
+
if (value && 'schemaId' in value) {
|
|
134
|
+
return core_1.JsonTransformer.fromJSON(value, WebVhCredDefContent);
|
|
135
|
+
}
|
|
136
|
+
if (value && 'revocDefType' in value) {
|
|
137
|
+
return core_1.JsonTransformer.fromJSON(value, WebVhRevRegDefContent);
|
|
138
|
+
}
|
|
139
|
+
return value;
|
|
140
|
+
}),
|
|
141
|
+
__metadata("design:type", Object)
|
|
142
|
+
], WebVhResource.prototype, "content", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
(0, class_validator_1.ValidateNested)(),
|
|
145
|
+
(0, class_transformer_1.Type)(() => WebVhProof),
|
|
146
|
+
__metadata("design:type", WebVhProof)
|
|
147
|
+
], WebVhResource.prototype, "proof", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
(0, class_validator_1.IsOptional)(),
|
|
150
|
+
__metadata("design:type", Object)
|
|
151
|
+
], WebVhResource.prototype, "metadata", void 0);
|
|
152
|
+
__decorate([
|
|
153
|
+
(0, class_validator_1.IsOptional)(),
|
|
154
|
+
(0, class_validator_1.IsArray)(),
|
|
155
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
156
|
+
(0, class_transformer_1.Type)(() => WebVhLink),
|
|
157
|
+
__metadata("design:type", Array)
|
|
158
|
+
], WebVhResource.prototype, "links", void 0);
|
|
159
|
+
class WebVhLink {
|
|
160
|
+
}
|
|
161
|
+
exports.WebVhLink = WebVhLink;
|
|
162
|
+
__decorate([
|
|
163
|
+
(0, class_validator_1.IsString)(),
|
|
164
|
+
__metadata("design:type", String)
|
|
165
|
+
], WebVhLink.prototype, "id", void 0);
|
|
166
|
+
__decorate([
|
|
167
|
+
(0, class_validator_1.IsString)(),
|
|
168
|
+
__metadata("design:type", String)
|
|
169
|
+
], WebVhLink.prototype, "type", void 0);
|
|
170
|
+
__decorate([
|
|
171
|
+
(0, class_validator_1.IsOptional)(),
|
|
172
|
+
(0, class_validator_1.IsNumber)(),
|
|
173
|
+
__metadata("design:type", Number)
|
|
174
|
+
], WebVhLink.prototype, "timestamp", void 0);
|
|
175
|
+
//# sourceMappingURL=transform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../src/anoncreds/utils/transform.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAuE;AACvE,yDAA2D;AAC3D,qDASwB;AAExB,MAAa,kBAAkB;CAgB9B;AAhBD,gDAgBC;AAXQ;IAJN,IAAA,yBAAO,GAAE;IACT,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACxB,IAAA,8BAAY,EAAC,CAAC,CAAC;IACf,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;qDACQ;AAGpB;IADN,IAAA,0BAAQ,GAAE;;gDACS;AAGb;IADN,IAAA,0BAAQ,GAAE;;mDACY;AAIhB;IAFN,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;oDACa;AAG1B,MAAa,mBAAmB;CAe/B;AAfD,kDAeC;AAbQ;IADN,IAAA,0BAAQ,GAAE;;qDACa;AAGjB;IADN,IAAA,0BAAQ,GAAE;;qDACa;AAGjB;IADN,IAAA,0BAAQ,GAAE;;iDACS;AAGb;IADN,IAAA,0BAAQ,GAAE;;gDACQ;AAGZ;IADN,IAAA,0BAAQ,GAAE;;kDAC2B;AAGxC,MAAa,qBAAqB;CAoBjC;AApBD,sDAoBC;AAlBQ;IADN,IAAA,0BAAQ,GAAE;;uDACa;AAGjB;IADN,IAAA,0BAAQ,GAAE;;2DACiB;AAGrB;IADN,IAAA,0BAAQ,GAAE;;wDACc;AAGlB;IADN,IAAA,0BAAQ,GAAE;;kDACQ;AAGZ;IADN,IAAA,0BAAQ,GAAE;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AAC,KAAK,EAAE,qBAAqB,CAAC,CAAA;QAC/D,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC,CAAC;;8CAC+E;AAI1E;IAFN,IAAA,gCAAc,GAAE;IAChB,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,UAAU,CAAC;8BACR,UAAU;4CAAA;AAGlB;IADN,IAAA,4BAAU,GAAE;;+CAC4B;AAMlC;IAJN,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;IACT,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,SAAS,CAAC;;4CACI;AAG5B,MAAa,SAAS;CAUrB;AAVD,8BAUC;AARQ;IADN,IAAA,0BAAQ,GAAE;;qCACO;AAGX;IADN,IAAA,0BAAQ,GAAE;;uCACS;AAIb;IAFN,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;4CACc"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type AgentContext } from '@credo-ts/core';
|
|
2
|
+
import { Verifier } from 'didwebvh-ts';
|
|
3
|
+
export declare class WebvhDidCrypto implements Verifier {
|
|
4
|
+
private agentContext;
|
|
5
|
+
constructor(agentContext: AgentContext);
|
|
6
|
+
verify(signature: Uint8Array, message: Uint8Array, publicKey: Uint8Array): Promise<boolean>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebvhDidCrypto = void 0;
|
|
4
|
+
const core_1 = require("@credo-ts/core");
|
|
5
|
+
class WebvhDidCrypto {
|
|
6
|
+
constructor(agentContext) {
|
|
7
|
+
this.agentContext = agentContext;
|
|
8
|
+
}
|
|
9
|
+
async verify(signature, message, publicKey) {
|
|
10
|
+
try {
|
|
11
|
+
const kms = this.agentContext.dependencyManager.resolve(core_1.Kms.KeyManagementApi);
|
|
12
|
+
const publicJwk = core_1.Kms.PublicJwk.fromPublicKey({
|
|
13
|
+
kty: 'OKP',
|
|
14
|
+
crv: 'Ed25519',
|
|
15
|
+
publicKey: publicKey,
|
|
16
|
+
});
|
|
17
|
+
const verificationResult = await kms.verify({
|
|
18
|
+
key: { publicJwk: publicJwk.toJson() },
|
|
19
|
+
algorithm: 'EdDSA',
|
|
20
|
+
signature: signature,
|
|
21
|
+
data: message,
|
|
22
|
+
});
|
|
23
|
+
return verificationResult.verified;
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
this.agentContext.config.logger.error('KMS verification failed:', error);
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.WebvhDidCrypto = WebvhDidCrypto;
|
|
32
|
+
//# sourceMappingURL=WebvhDidCrypto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebvhDidCrypto.js","sourceRoot":"","sources":["../../src/dids/WebvhDidCrypto.ts"],"names":[],"mappings":";;;AAAA,yCAAuD;AAGvD,MAAa,cAAc;IAGzB,YAAmB,YAA0B;QAC3C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,SAAqB,EAAE,OAAmB,EAAE,SAAqB;QACnF,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,UAAG,CAAC,gBAAgB,CAAC,CAAA;YAE7E,MAAM,SAAS,GAAG,UAAG,CAAC,SAAS,CAAC,aAAa,CAAC;gBAC5C,GAAG,EAAE,KAAK;gBACV,GAAG,EAAE,SAAS;gBACd,SAAS,EAAE,SAAS;aACrB,CAAC,CAAA;YAEF,MAAM,kBAAkB,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC;gBAC1C,GAAG,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,MAAM,EAAE,EAAE;gBACtC,SAAS,EAAE,OAAO;gBAClB,SAAS,EAAE,SAAS;gBACpB,IAAI,EAAE,OAAO;aACd,CAAC,CAAA;YAEF,OAAO,kBAAkB,CAAC,QAAQ,CAAA;QACpC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAA;YACxE,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;CACF;AA9BD,wCA8BC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AgentContext, DidResolutionResult, DidResolver } from '@credo-ts/core';
|
|
2
|
+
export declare class WebvhDidResolver implements DidResolver {
|
|
3
|
+
readonly supportedMethods: string[];
|
|
4
|
+
readonly allowsCaching = true;
|
|
5
|
+
readonly allowsLocalDidRecord = true;
|
|
6
|
+
resolve(agentContext: AgentContext, did: string): Promise<DidResolutionResult>;
|
|
7
|
+
getBaseUrl: (id: string) => string;
|
|
8
|
+
resolveResource(agentContext: AgentContext, resourceUrl: string): Promise<{
|
|
9
|
+
content: string | Record<string, unknown>;
|
|
10
|
+
contentMetadata: {
|
|
11
|
+
contentType: string;
|
|
12
|
+
retrieved: string;
|
|
13
|
+
};
|
|
14
|
+
dereferencingMetadata: {
|
|
15
|
+
contentType: string;
|
|
16
|
+
};
|
|
17
|
+
error?: undefined;
|
|
18
|
+
message?: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
error: string;
|
|
21
|
+
message: string;
|
|
22
|
+
content?: undefined;
|
|
23
|
+
contentMetadata?: undefined;
|
|
24
|
+
dereferencingMetadata?: undefined;
|
|
25
|
+
}>;
|
|
26
|
+
private resolveDidDoc;
|
|
27
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebvhDidResolver = void 0;
|
|
4
|
+
const core_1 = require("@credo-ts/core");
|
|
5
|
+
const didwebvh_ts_1 = require("didwebvh-ts");
|
|
6
|
+
const WebvhDidCrypto_1 = require("./WebvhDidCrypto");
|
|
7
|
+
class WebvhDidResolver {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.supportedMethods = ['webvh'];
|
|
10
|
+
this.allowsCaching = true;
|
|
11
|
+
this.allowsLocalDidRecord = true;
|
|
12
|
+
this.getBaseUrl = (id) => {
|
|
13
|
+
// Handle DID URL paths - split on first slash to separate DID from URL path
|
|
14
|
+
const slashIndex = id.indexOf('/');
|
|
15
|
+
let didPart = id;
|
|
16
|
+
let urlPath = '';
|
|
17
|
+
if (slashIndex !== -1) {
|
|
18
|
+
didPart = id.substring(0, slashIndex);
|
|
19
|
+
urlPath = id.substring(slashIndex);
|
|
20
|
+
}
|
|
21
|
+
const parts = didPart.split(':');
|
|
22
|
+
if (!didPart.startsWith('did:webvh:') || parts.length < 4) {
|
|
23
|
+
throw new Error(`${id} is not a valid did:webvh identifier`);
|
|
24
|
+
}
|
|
25
|
+
// Extract domain and path parts from the DID (after did:webvh:CID)
|
|
26
|
+
const domainAndPathParts = parts.slice(3);
|
|
27
|
+
const protocol = domainAndPathParts.join(':').includes('localhost') ? 'http' : 'https';
|
|
28
|
+
// First part is domain, rest are path components
|
|
29
|
+
const domain = domainAndPathParts[0];
|
|
30
|
+
const pathComponents = domainAndPathParts.slice(1);
|
|
31
|
+
// Check if domain has port
|
|
32
|
+
const [host, port] = domain.split(':');
|
|
33
|
+
const normalizedHost = port ? `${host}:${port}` : host;
|
|
34
|
+
// Build the base URL
|
|
35
|
+
let baseUrl = `${protocol}://${normalizedHost}`;
|
|
36
|
+
if (pathComponents.length > 0) {
|
|
37
|
+
baseUrl += `/${pathComponents.join('/')}`;
|
|
38
|
+
}
|
|
39
|
+
// Append the URL path if present
|
|
40
|
+
if (urlPath) {
|
|
41
|
+
baseUrl += urlPath;
|
|
42
|
+
}
|
|
43
|
+
return baseUrl;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
async resolve(agentContext, did) {
|
|
47
|
+
const didDocumentMetadata = {};
|
|
48
|
+
try {
|
|
49
|
+
return await this.resolveDidDoc(agentContext, did);
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
agentContext.config.logger.error(`Error resolving DID ${did}: ${error}`);
|
|
53
|
+
return {
|
|
54
|
+
didDocument: null,
|
|
55
|
+
didDocumentMetadata,
|
|
56
|
+
didResolutionMetadata: {
|
|
57
|
+
error: 'notFound',
|
|
58
|
+
message: `resolver_error: Unable to resolve did '${did}': ${error}`,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async resolveResource(agentContext, resourceUrl) {
|
|
64
|
+
try {
|
|
65
|
+
agentContext.config.logger.debug(`Attempting to resolve resource: ${resourceUrl}`);
|
|
66
|
+
// Use the getBaseUrl method to parse the did:webvh resource URL
|
|
67
|
+
const httpsUrl = this.getBaseUrl(resourceUrl);
|
|
68
|
+
agentContext.config.logger.debug(`Fetching resource from: ${httpsUrl}`);
|
|
69
|
+
// Fetch the resource using agent dependencies fetch
|
|
70
|
+
const response = await agentContext.config.agentDependencies.fetch(httpsUrl);
|
|
71
|
+
if (!response.ok) {
|
|
72
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
73
|
+
}
|
|
74
|
+
const contentType = response.headers.get('content-type') || 'application/json';
|
|
75
|
+
let content;
|
|
76
|
+
if (contentType.includes('application/json')) {
|
|
77
|
+
content = (await response.json());
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
content = await response.text();
|
|
81
|
+
}
|
|
82
|
+
agentContext.config.logger.debug(`Successfully fetched resource, content type: ${contentType}`);
|
|
83
|
+
return {
|
|
84
|
+
content: content,
|
|
85
|
+
contentMetadata: {
|
|
86
|
+
contentType: contentType,
|
|
87
|
+
retrieved: new Date().toISOString(),
|
|
88
|
+
},
|
|
89
|
+
dereferencingMetadata: {
|
|
90
|
+
contentType: contentType,
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
agentContext.config.logger.error(`Error resolving resource ${resourceUrl}:`, error);
|
|
96
|
+
return {
|
|
97
|
+
error: 'notFound',
|
|
98
|
+
message: `resolver_error: Unable to resolve resource '${resourceUrl}': ${error instanceof Error ? error.message : String(error)}`,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
async resolveDidDoc(agentContext, did) {
|
|
103
|
+
const crypto = new WebvhDidCrypto_1.WebvhDidCrypto(agentContext);
|
|
104
|
+
const { doc } = await (0, didwebvh_ts_1.resolveDID)(did, { verifier: crypto });
|
|
105
|
+
return {
|
|
106
|
+
didDocument: new core_1.DidDocument(doc),
|
|
107
|
+
didDocumentMetadata: {},
|
|
108
|
+
didResolutionMetadata: {},
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
exports.WebvhDidResolver = WebvhDidResolver;
|
|
113
|
+
//# sourceMappingURL=WebvhDidResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebvhDidResolver.js","sourceRoot":"","sources":["../../src/dids/WebvhDidResolver.ts"],"names":[],"mappings":";;;AAEA,yCAA4C;AAC5C,6CAAwC;AAExC,qDAAiD;AAEjD,MAAa,gBAAgB;IAA7B;QACkB,qBAAgB,GAAG,CAAC,OAAO,CAAC,CAAA;QAC5B,kBAAa,GAAG,IAAI,CAAA;QACpB,yBAAoB,GAAG,IAAI,CAAA;QAoBpC,eAAU,GAAG,CAAC,EAAU,EAAE,EAAE;YACjC,4EAA4E;YAC5E,MAAM,UAAU,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YAClC,IAAI,OAAO,GAAG,EAAE,CAAA;YAChB,IAAI,OAAO,GAAG,EAAE,CAAA;YAEhB,IAAI,UAAU,KAAK,CAAC,CAAC,E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OAAO;YACL,WAAW,EAAE,IAAI,kBAAW,CAAC,GAAG,CAAC;YACjC,mBAAmB,EAAE,EAAE;YACvB,qBAAqB,EAAE,EAAE;SAC1B,CAAA;IACH,CAAC;CACF;AAxHD,4CAwHC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebvhDidCrypto = exports.WebvhDidResolver = void 0;
|
|
4
|
+
var WebvhDidResolver_1 = require("./WebvhDidResolver");
|
|
5
|
+
Object.defineProperty(exports, "WebvhDidResolver", { enumerable: true, get: function () { return WebvhDidResolver_1.WebvhDidResolver; } });
|
|
6
|
+
var WebvhDidCrypto_1 = require("./WebvhDidCrypto");
|
|
7
|
+
Object.defineProperty(exports, "WebvhDidCrypto", { enumerable: true, get: function () { return WebvhDidCrypto_1.WebvhDidCrypto; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dids/index.ts"],"names":[],"mappings":";;;AAAA,uDAAqD;AAA5C,oHAAA,gBAAgB,OAAA;AACzB,mDAAiD;AAAxC,gHAAA,cAAc,OAAA"}
|
package/build/index.d.ts
ADDED
package/build/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebvhApi = exports.WebvhModule = exports.WebVhAnonCredsRegistry = exports.WebvhDidResolver = void 0;
|
|
4
|
+
var dids_1 = require("./dids");
|
|
5
|
+
Object.defineProperty(exports, "WebvhDidResolver", { enumerable: true, get: function () { return dids_1.WebvhDidResolver; } });
|
|
6
|
+
var WebVhAnonCredsRegistry_1 = require("./anoncreds/services/WebVhAnonCredsRegistry");
|
|
7
|
+
Object.defineProperty(exports, "WebVhAnonCredsRegistry", { enumerable: true, get: function () { return WebVhAnonCredsRegistry_1.WebVhAnonCredsRegistry; } });
|
|
8
|
+
var WebvhModule_1 = require("./WebvhModule");
|
|
9
|
+
Object.defineProperty(exports, "WebvhModule", { enumerable: true, get: function () { return WebvhModule_1.WebvhModule; } });
|
|
10
|
+
var WebvhApi_1 = require("./WebvhApi");
|
|
11
|
+
Object.defineProperty(exports, "WebvhApi", { enumerable: true, get: function () { return WebvhApi_1.WebvhApi; } });
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+BAAyC;AAAhC,wGAAA,gBAAgB,OAAA;AACzB,sFAAoF;AAA3E,gIAAA,sBAAsB,OAAA;AAE/B,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AACpB,uCAAqC;AAA5B,oGAAA,QAAQ,OAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@credo-ts/webvh",
|
|
3
|
+
"version": "0.6.0-alpha-20250805230405",
|
|
4
|
+
"description": "Credo WebVH DID method implementation",
|
|
5
|
+
"main": "build/index",
|
|
6
|
+
"types": "build/index",
|
|
7
|
+
"files": [
|
|
8
|
+
"build"
|
|
9
|
+
],
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"license": "Apache-2.0",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"class-transformer": "^0.5.1",
|
|
16
|
+
"class-validator": "0.14.1",
|
|
17
|
+
"didwebvh-ts": "^2.4.1",
|
|
18
|
+
"json-canonicalize": "^1.0.6",
|
|
19
|
+
"tsyringe": "^4.8.0",
|
|
20
|
+
"@credo-ts/core": "0.6.0-alpha-20250805230405",
|
|
21
|
+
"@credo-ts/anoncreds": "0.6.0-alpha-20250805230405"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"rimraf": "^4.4.0",
|
|
25
|
+
"typescript": "~5.5.2"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "pnpm run clean && pnpm run compile",
|
|
29
|
+
"clean": "rimraf -rf ./build",
|
|
30
|
+
"compile": "tsc -p tsconfig.build.json",
|
|
31
|
+
"test": "jest",
|
|
32
|
+
"test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand --config jest.config.js"
|
|
33
|
+
}
|
|
34
|
+
}
|