@credo-ts/askar 0.4.1-alpha.157
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 +31 -0
- package/build/AskarModule.d.ts +9 -0
- package/build/AskarModule.js +58 -0
- package/build/AskarModule.js.map +1 -0
- package/build/AskarModuleConfig.d.ts +68 -0
- package/build/AskarModuleConfig.js +33 -0
- package/build/AskarModuleConfig.js.map +1 -0
- package/build/index.d.ts +4 -0
- package/build/index.js +16 -0
- package/build/index.js.map +1 -0
- package/build/storage/AskarStorageService.d.ts +17 -0
- package/build/storage/AskarStorageService.js +139 -0
- package/build/storage/AskarStorageService.js.map +1 -0
- package/build/storage/index.d.ts +1 -0
- package/build/storage/index.js +18 -0
- package/build/storage/index.js.map +1 -0
- package/build/storage/utils.d.ts +15 -0
- package/build/storage/utils.js +110 -0
- package/build/storage/utils.js.map +1 -0
- package/build/utils/askarError.d.ts +14 -0
- package/build/utils/askarError.js +20 -0
- package/build/utils/askarError.js.map +1 -0
- package/build/utils/askarKeyTypes.d.ts +7 -0
- package/build/utils/askarKeyTypes.js +45 -0
- package/build/utils/askarKeyTypes.js.map +1 -0
- package/build/utils/askarWalletConfig.d.ts +14 -0
- package/build/utils/askarWalletConfig.js +75 -0
- package/build/utils/askarWalletConfig.js.map +1 -0
- package/build/utils/assertAskarWallet.d.ts +3 -0
- package/build/utils/assertAskarWallet.js +15 -0
- package/build/utils/assertAskarWallet.js.map +1 -0
- package/build/utils/index.d.ts +3 -0
- package/build/utils/index.js +20 -0
- package/build/utils/index.js.map +1 -0
- package/build/wallet/AskarBaseWallet.d.ts +89 -0
- package/build/wallet/AskarBaseWallet.js +385 -0
- package/build/wallet/AskarBaseWallet.js.map +1 -0
- package/build/wallet/AskarProfileWallet.d.ts +24 -0
- package/build/wallet/AskarProfileWallet.js +150 -0
- package/build/wallet/AskarProfileWallet.js.map +1 -0
- package/build/wallet/AskarWallet.d.ts +58 -0
- package/build/wallet/AskarWallet.js +342 -0
- package/build/wallet/AskarWallet.js.map +1 -0
- package/build/wallet/AskarWalletStorageConfig.d.ts +31 -0
- package/build/wallet/AskarWalletStorageConfig.js +12 -0
- package/build/wallet/AskarWalletStorageConfig.js.map +1 -0
- package/build/wallet/JweEnvelope.d.ts +32 -0
- package/build/wallet/JweEnvelope.js +55 -0
- package/build/wallet/JweEnvelope.js.map +1 -0
- package/build/wallet/didcommV1.d.ts +8 -0
- package/build/wallet/didcommV1.js +156 -0
- package/build/wallet/didcommV1.js.map +1 -0
- package/build/wallet/index.d.ts +3 -0
- package/build/wallet/index.js +23 -0
- package/build/wallet/index.js.map +1 -0
- package/package.json +48 -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.
|
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<br />
|
|
3
|
+
<img
|
|
4
|
+
alt="Credo Logo"
|
|
5
|
+
src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png"
|
|
6
|
+
height="250px"
|
|
7
|
+
/>
|
|
8
|
+
</p>
|
|
9
|
+
<h1 align="center"><b>Credo Askar Module</b></h1>
|
|
10
|
+
<p align="center">
|
|
11
|
+
<a
|
|
12
|
+
href="https://raw.githubusercontent.com/openwallet-foundation/credo-ts/main/LICENSE"
|
|
13
|
+
><img
|
|
14
|
+
alt="License"
|
|
15
|
+
src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"
|
|
16
|
+
/></a>
|
|
17
|
+
<a href="https://www.typescriptlang.org/"
|
|
18
|
+
><img
|
|
19
|
+
alt="typescript"
|
|
20
|
+
src="https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg"
|
|
21
|
+
/></a>
|
|
22
|
+
<a href="https://www.npmjs.com/package/@credo-ts/askar"
|
|
23
|
+
><img
|
|
24
|
+
alt="@credo-ts/askar version"
|
|
25
|
+
src="https://img.shields.io/npm/v/@credo-ts/askar"
|
|
26
|
+
/></a>
|
|
27
|
+
|
|
28
|
+
</p>
|
|
29
|
+
<br />
|
|
30
|
+
|
|
31
|
+
Credo Askar provides secure storage and crypto capabilities of Credo. See the [Aries Askar Setup](https://credo.js.org/guides/getting-started/set-up/aries-askar) for installation instructions.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AskarModuleConfigOptions } from './AskarModuleConfig';
|
|
2
|
+
import type { AgentContext, DependencyManager, Module } from '@credo-ts/core';
|
|
3
|
+
import { AskarModuleConfig } from './AskarModuleConfig';
|
|
4
|
+
export declare class AskarModule implements Module {
|
|
5
|
+
readonly config: AskarModuleConfig;
|
|
6
|
+
constructor(config: AskarModuleConfigOptions);
|
|
7
|
+
register(dependencyManager: DependencyManager): void;
|
|
8
|
+
initialize(agentContext: AgentContext): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AskarModule = void 0;
|
|
4
|
+
const core_1 = require("@credo-ts/core");
|
|
5
|
+
const aries_askar_shared_1 = require("@hyperledger/aries-askar-shared");
|
|
6
|
+
const AskarModuleConfig_1 = require("./AskarModuleConfig");
|
|
7
|
+
const storage_1 = require("./storage");
|
|
8
|
+
const assertAskarWallet_1 = require("./utils/assertAskarWallet");
|
|
9
|
+
const wallet_1 = require("./wallet");
|
|
10
|
+
class AskarModule {
|
|
11
|
+
constructor(config) {
|
|
12
|
+
this.config = new AskarModuleConfig_1.AskarModuleConfig(config);
|
|
13
|
+
}
|
|
14
|
+
register(dependencyManager) {
|
|
15
|
+
dependencyManager.registerInstance(AskarModuleConfig_1.AskarModuleConfig, this.config);
|
|
16
|
+
if (dependencyManager.isRegistered(core_1.InjectionSymbols.Wallet)) {
|
|
17
|
+
throw new core_1.CredoError('There is an instance of Wallet already registered');
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
dependencyManager.registerContextScoped(core_1.InjectionSymbols.Wallet, wallet_1.AskarWallet);
|
|
21
|
+
// If the multiWalletDatabaseScheme is set to ProfilePerWallet, we want to register the AskarProfileWallet
|
|
22
|
+
if (this.config.multiWalletDatabaseScheme === AskarModuleConfig_1.AskarMultiWalletDatabaseScheme.ProfilePerWallet) {
|
|
23
|
+
dependencyManager.registerContextScoped(wallet_1.AskarProfileWallet);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (dependencyManager.isRegistered(core_1.InjectionSymbols.StorageService)) {
|
|
27
|
+
throw new core_1.CredoError('There is an instance of StorageService already registered');
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
dependencyManager.registerSingleton(core_1.InjectionSymbols.StorageService, storage_1.AskarStorageService);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
async initialize(agentContext) {
|
|
34
|
+
// We MUST use an askar wallet here
|
|
35
|
+
(0, assertAskarWallet_1.assertAskarWallet)(agentContext.wallet);
|
|
36
|
+
const wallet = agentContext.wallet;
|
|
37
|
+
// Register the Askar store instance on the dependency manager
|
|
38
|
+
// This allows it to be re-used for tenants
|
|
39
|
+
agentContext.dependencyManager.registerInstance(aries_askar_shared_1.Store, agentContext.wallet.store);
|
|
40
|
+
// If the multiWalletDatabaseScheme is set to ProfilePerWallet, we want to register the AskarProfileWallet
|
|
41
|
+
// and return that as the wallet for all tenants, but not for the main agent, that should use the AskarWallet
|
|
42
|
+
if (this.config.multiWalletDatabaseScheme === AskarModuleConfig_1.AskarMultiWalletDatabaseScheme.ProfilePerWallet) {
|
|
43
|
+
agentContext.dependencyManager.container.register(core_1.InjectionSymbols.Wallet, {
|
|
44
|
+
useFactory: (container) => {
|
|
45
|
+
// If the container is the same as the root dependency manager container
|
|
46
|
+
// it means we are in the main agent, and we should use the root wallet
|
|
47
|
+
if (container === agentContext.dependencyManager.container) {
|
|
48
|
+
return wallet;
|
|
49
|
+
}
|
|
50
|
+
// Otherwise we want to return the AskarProfileWallet
|
|
51
|
+
return container.resolve(wallet_1.AskarProfileWallet);
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.AskarModule = AskarModule;
|
|
58
|
+
//# sourceMappingURL=AskarModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AskarModule.js","sourceRoot":"","sources":["../src/AskarModule.ts"],"names":[],"mappings":";;;AAGA,yCAA6D;AAC7D,wEAAuD;AAEvD,2DAAuF;AACvF,uCAA+C;AAC/C,iEAA6D;AAC7D,qCAA0D;AAE1D,MAAa,WAAW;IAGtB,YAAmB,MAAgC;QACjD,IAAI,CAAC,MAAM,GAAG,IAAI,qCAAiB,CAAC,MAAM,CAAC,CAAA;IAC7C,CAAC;IAEM,QAAQ,CAAC,iBAAoC;QAClD,iBAAiB,CAAC,gBAAgB,CAAC,qCAAiB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;QAElE,IAAI,iBAAiB,CAAC,YAAY,CAAC,uBAAgB,CAAC,MAAM,CAAC,EAAE;YAC3D,MAAM,IAAI,iBAAU,CAAC,mDAAmD,CAAC,CAAA;SAC1E;aAAM;YACL,iBAAiB,CAAC,qBAAqB,CAAC,uBAAgB,CAA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
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { AriesAskar } from '@hyperledger/aries-askar-shared';
|
|
2
|
+
export declare enum AskarMultiWalletDatabaseScheme {
|
|
3
|
+
/**
|
|
4
|
+
* Each wallet get its own database and uses a separate store.
|
|
5
|
+
*/
|
|
6
|
+
DatabasePerWallet = "DatabasePerWallet",
|
|
7
|
+
/**
|
|
8
|
+
* All wallets are stored in a single database, but each wallet uses a separate profile.
|
|
9
|
+
*/
|
|
10
|
+
ProfilePerWallet = "ProfilePerWallet"
|
|
11
|
+
}
|
|
12
|
+
export interface AskarModuleConfigOptions {
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* ## Node.JS
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { ariesAskar } from '@hyperledger/aries-askar-nodejs'
|
|
19
|
+
*
|
|
20
|
+
* const agent = new Agent({
|
|
21
|
+
* config: {},
|
|
22
|
+
* dependencies: agentDependencies,
|
|
23
|
+
* modules: {
|
|
24
|
+
* ariesAskar: new AskarModule({
|
|
25
|
+
* ariesAskar,
|
|
26
|
+
* })
|
|
27
|
+
* }
|
|
28
|
+
* })
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* ## React Native
|
|
32
|
+
*
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { ariesAskar } from '@hyperledger/aries-askar-react-native'
|
|
35
|
+
*
|
|
36
|
+
* const agent = new Agent({
|
|
37
|
+
* config: {},
|
|
38
|
+
* dependencies: agentDependencies,
|
|
39
|
+
* modules: {
|
|
40
|
+
* ariesAskar: new AskarModule({
|
|
41
|
+
* ariesAskar,
|
|
42
|
+
* })
|
|
43
|
+
* }
|
|
44
|
+
* })
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
ariesAskar: AriesAskar;
|
|
48
|
+
/**
|
|
49
|
+
* Determine the strategy for storing wallets if multiple wallets are used in a single agent.
|
|
50
|
+
* This is mostly the case in multi-tenancy, and determines whether each tenant will get a separate
|
|
51
|
+
* database, or whether all wallets will be stored in a single database, using a different profile
|
|
52
|
+
* for each wallet.
|
|
53
|
+
*
|
|
54
|
+
* @default {@link AskarMultiWalletDatabaseScheme.DatabasePerWallet} (for backwards compatibility)
|
|
55
|
+
*/
|
|
56
|
+
multiWalletDatabaseScheme?: AskarMultiWalletDatabaseScheme;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
61
|
+
export declare class AskarModuleConfig {
|
|
62
|
+
private options;
|
|
63
|
+
constructor(options: AskarModuleConfigOptions);
|
|
64
|
+
/** See {@link AskarModuleConfigOptions.ariesAskar} */
|
|
65
|
+
get ariesAskar(): AriesAskar;
|
|
66
|
+
/** See {@link AskarModuleConfigOptions.multiWalletDatabaseScheme} */
|
|
67
|
+
get multiWalletDatabaseScheme(): AskarMultiWalletDatabaseScheme;
|
|
68
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AskarModuleConfig = exports.AskarMultiWalletDatabaseScheme = void 0;
|
|
4
|
+
var AskarMultiWalletDatabaseScheme;
|
|
5
|
+
(function (AskarMultiWalletDatabaseScheme) {
|
|
6
|
+
/**
|
|
7
|
+
* Each wallet get its own database and uses a separate store.
|
|
8
|
+
*/
|
|
9
|
+
AskarMultiWalletDatabaseScheme["DatabasePerWallet"] = "DatabasePerWallet";
|
|
10
|
+
/**
|
|
11
|
+
* All wallets are stored in a single database, but each wallet uses a separate profile.
|
|
12
|
+
*/
|
|
13
|
+
AskarMultiWalletDatabaseScheme["ProfilePerWallet"] = "ProfilePerWallet";
|
|
14
|
+
})(AskarMultiWalletDatabaseScheme = exports.AskarMultiWalletDatabaseScheme || (exports.AskarMultiWalletDatabaseScheme = {}));
|
|
15
|
+
/**
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
class AskarModuleConfig {
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this.options = options;
|
|
21
|
+
}
|
|
22
|
+
/** See {@link AskarModuleConfigOptions.ariesAskar} */
|
|
23
|
+
get ariesAskar() {
|
|
24
|
+
return this.options.ariesAskar;
|
|
25
|
+
}
|
|
26
|
+
/** See {@link AskarModuleConfigOptions.multiWalletDatabaseScheme} */
|
|
27
|
+
get multiWalletDatabaseScheme() {
|
|
28
|
+
var _a;
|
|
29
|
+
return (_a = this.options.multiWalletDatabaseScheme) !== null && _a !== void 0 ? _a : AskarMultiWalletDatabaseScheme.DatabasePerWallet;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.AskarModuleConfig = AskarModuleConfig;
|
|
33
|
+
//# sourceMappingURL=AskarModuleConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AskarModuleConfig.js","sourceRoot":"","sources":["../src/AskarModuleConfig.ts"],"names":[],"mappings":";;;AAEA,IAAY,8BAUX;AAVD,WAAY,8BAA8B;IACxC;;OAEG;IACH,yEAAuC,CAAA;IAEvC;;OAEG;IACH,uEAAqC,CAAA;AACvC,CAAC,EAVW,8BAA8B,GAA9B,sCAA8B,KAA9B,sCAA8B,QAUzC;AAkDD;;GAEG;AACH,MAAa,iBAAiB;IAG5B,YAAmB,OAAiC;QAClD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,sDAAsD;IACtD,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAA;IAChC,CAAC;IAED,qEAAqE;IACrE,IAAW,yBAAyB;;QAClC,OAAO,MAAA,IAAI,CAAC,OAAO,CAAC,yBAAyB,mCAAI,8BAA8B,CAAC,iBAAiB,CAAA;IACnG,CAAC;CACF;AAhBD,8CAgBC"}
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { AskarWallet, AskarWalletPostgresStorageConfig, AskarWalletPostgresConfig, AskarWalletPostgresCredentials, AskarProfileWallet, } from './wallet';
|
|
2
|
+
export { AskarStorageService } from './storage';
|
|
3
|
+
export { AskarModule } from './AskarModule';
|
|
4
|
+
export { AskarModuleConfigOptions, AskarMultiWalletDatabaseScheme } from './AskarModuleConfig';
|
package/build/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AskarMultiWalletDatabaseScheme = exports.AskarModule = exports.AskarStorageService = exports.AskarProfileWallet = exports.AskarWallet = void 0;
|
|
4
|
+
// Wallet
|
|
5
|
+
var wallet_1 = require("./wallet");
|
|
6
|
+
Object.defineProperty(exports, "AskarWallet", { enumerable: true, get: function () { return wallet_1.AskarWallet; } });
|
|
7
|
+
Object.defineProperty(exports, "AskarProfileWallet", { enumerable: true, get: function () { return wallet_1.AskarProfileWallet; } });
|
|
8
|
+
// Storage
|
|
9
|
+
var storage_1 = require("./storage");
|
|
10
|
+
Object.defineProperty(exports, "AskarStorageService", { enumerable: true, get: function () { return storage_1.AskarStorageService; } });
|
|
11
|
+
// Module
|
|
12
|
+
var AskarModule_1 = require("./AskarModule");
|
|
13
|
+
Object.defineProperty(exports, "AskarModule", { enumerable: true, get: function () { return AskarModule_1.AskarModule; } });
|
|
14
|
+
var AskarModuleConfig_1 = require("./AskarModuleConfig");
|
|
15
|
+
Object.defineProperty(exports, "AskarMultiWalletDatabaseScheme", { enumerable: true, get: function () { return AskarModuleConfig_1.AskarMultiWalletDatabaseScheme; } });
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,SAAS;AACT,mCAMiB;AALf,qGAAA,WAAW,OAAA;AAIX,4GAAA,kBAAkB,OAAA;AAGpB,UAAU;AACV,qCAA+C;AAAtC,8GAAA,mBAAmB,OAAA;AAE5B,SAAS;AACT,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AACpB,yDAA8F;AAA3D,mIAAA,8BAA8B,OAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { BaseRecordConstructor, AgentContext, BaseRecord, Query, StorageService } from '@credo-ts/core';
|
|
2
|
+
export declare class AskarStorageService<T extends BaseRecord> implements StorageService<T> {
|
|
3
|
+
/** @inheritDoc */
|
|
4
|
+
save(agentContext: AgentContext, record: T): Promise<void>;
|
|
5
|
+
/** @inheritDoc */
|
|
6
|
+
update(agentContext: AgentContext, record: T): Promise<void>;
|
|
7
|
+
/** @inheritDoc */
|
|
8
|
+
delete(agentContext: AgentContext, record: T): Promise<void>;
|
|
9
|
+
/** @inheritDoc */
|
|
10
|
+
deleteById(agentContext: AgentContext, recordClass: BaseRecordConstructor<T>, id: string): Promise<void>;
|
|
11
|
+
/** @inheritDoc */
|
|
12
|
+
getById(agentContext: AgentContext, recordClass: BaseRecordConstructor<T>, id: string): Promise<T>;
|
|
13
|
+
/** @inheritDoc */
|
|
14
|
+
getAll(agentContext: AgentContext, recordClass: BaseRecordConstructor<T>): Promise<T[]>;
|
|
15
|
+
/** @inheritDoc */
|
|
16
|
+
findByQuery(agentContext: AgentContext, recordClass: BaseRecordConstructor<T>, query: Query<T>): Promise<T[]>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.AskarStorageService = void 0;
|
|
10
|
+
const core_1 = require("@credo-ts/core");
|
|
11
|
+
const aries_askar_shared_1 = require("@hyperledger/aries-askar-shared");
|
|
12
|
+
const askarError_1 = require("../utils/askarError");
|
|
13
|
+
const assertAskarWallet_1 = require("../utils/assertAskarWallet");
|
|
14
|
+
const utils_1 = require("./utils");
|
|
15
|
+
let AskarStorageService = class AskarStorageService {
|
|
16
|
+
/** @inheritDoc */
|
|
17
|
+
async save(agentContext, record) {
|
|
18
|
+
(0, assertAskarWallet_1.assertAskarWallet)(agentContext.wallet);
|
|
19
|
+
record.updatedAt = new Date();
|
|
20
|
+
const value = core_1.JsonTransformer.serialize(record);
|
|
21
|
+
const tags = (0, utils_1.transformFromRecordTagValues)(record.getTags());
|
|
22
|
+
try {
|
|
23
|
+
await agentContext.wallet.withSession((session) => session.insert({ category: record.type, name: record.id, value, tags }));
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
if ((0, askarError_1.isAskarError)(error, askarError_1.AskarErrorCode.Duplicate)) {
|
|
27
|
+
throw new core_1.RecordDuplicateError(`Record with id ${record.id} already exists`, { recordType: record.type });
|
|
28
|
+
}
|
|
29
|
+
throw new core_1.WalletError('Error saving record', { cause: error });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/** @inheritDoc */
|
|
33
|
+
async update(agentContext, record) {
|
|
34
|
+
(0, assertAskarWallet_1.assertAskarWallet)(agentContext.wallet);
|
|
35
|
+
record.updatedAt = new Date();
|
|
36
|
+
const value = core_1.JsonTransformer.serialize(record);
|
|
37
|
+
const tags = (0, utils_1.transformFromRecordTagValues)(record.getTags());
|
|
38
|
+
try {
|
|
39
|
+
await agentContext.wallet.withSession((session) => session.replace({ category: record.type, name: record.id, value, tags }));
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
if ((0, askarError_1.isAskarError)(error, askarError_1.AskarErrorCode.NotFound)) {
|
|
43
|
+
throw new core_1.RecordNotFoundError(`record with id ${record.id} not found.`, {
|
|
44
|
+
recordType: record.type,
|
|
45
|
+
cause: error,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
throw new core_1.WalletError('Error updating record', { cause: error });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/** @inheritDoc */
|
|
52
|
+
async delete(agentContext, record) {
|
|
53
|
+
(0, assertAskarWallet_1.assertAskarWallet)(agentContext.wallet);
|
|
54
|
+
try {
|
|
55
|
+
await agentContext.wallet.withSession((session) => session.remove({ category: record.type, name: record.id }));
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
if ((0, askarError_1.isAskarError)(error, askarError_1.AskarErrorCode.NotFound)) {
|
|
59
|
+
throw new core_1.RecordNotFoundError(`record with id ${record.id} not found.`, {
|
|
60
|
+
recordType: record.type,
|
|
61
|
+
cause: error,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
throw new core_1.WalletError('Error deleting record', { cause: error });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/** @inheritDoc */
|
|
68
|
+
async deleteById(agentContext, recordClass, id) {
|
|
69
|
+
(0, assertAskarWallet_1.assertAskarWallet)(agentContext.wallet);
|
|
70
|
+
try {
|
|
71
|
+
await agentContext.wallet.withSession((session) => session.remove({ category: recordClass.type, name: id }));
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
if ((0, askarError_1.isAskarError)(error, askarError_1.AskarErrorCode.NotFound)) {
|
|
75
|
+
throw new core_1.RecordNotFoundError(`record with id ${id} not found.`, {
|
|
76
|
+
recordType: recordClass.type,
|
|
77
|
+
cause: error,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
throw new core_1.WalletError('Error deleting record', { cause: error });
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/** @inheritDoc */
|
|
84
|
+
async getById(agentContext, recordClass, id) {
|
|
85
|
+
(0, assertAskarWallet_1.assertAskarWallet)(agentContext.wallet);
|
|
86
|
+
try {
|
|
87
|
+
const record = await agentContext.wallet.withSession((session) => session.fetch({ category: recordClass.type, name: id }));
|
|
88
|
+
if (!record) {
|
|
89
|
+
throw new core_1.RecordNotFoundError(`record with id ${id} not found.`, {
|
|
90
|
+
recordType: recordClass.type,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return (0, utils_1.recordToInstance)(record, recordClass);
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
if (error instanceof core_1.RecordNotFoundError)
|
|
97
|
+
throw error;
|
|
98
|
+
throw new core_1.WalletError(`Error getting record ${recordClass.name}`, { cause: error });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/** @inheritDoc */
|
|
102
|
+
async getAll(agentContext, recordClass) {
|
|
103
|
+
(0, assertAskarWallet_1.assertAskarWallet)(agentContext.wallet);
|
|
104
|
+
const records = await agentContext.wallet.withSession((session) => session.fetchAll({ category: recordClass.type }));
|
|
105
|
+
const instances = [];
|
|
106
|
+
for (const record of records) {
|
|
107
|
+
instances.push((0, utils_1.recordToInstance)(record, recordClass));
|
|
108
|
+
}
|
|
109
|
+
return instances;
|
|
110
|
+
}
|
|
111
|
+
/** @inheritDoc */
|
|
112
|
+
async findByQuery(agentContext, recordClass, query) {
|
|
113
|
+
const wallet = agentContext.wallet;
|
|
114
|
+
(0, assertAskarWallet_1.assertAskarWallet)(wallet);
|
|
115
|
+
const askarQuery = (0, utils_1.askarQueryFromSearchQuery)(query);
|
|
116
|
+
const scan = new aries_askar_shared_1.Scan({
|
|
117
|
+
category: recordClass.type,
|
|
118
|
+
store: wallet.store,
|
|
119
|
+
tagFilter: askarQuery,
|
|
120
|
+
profile: wallet.profile,
|
|
121
|
+
});
|
|
122
|
+
const instances = [];
|
|
123
|
+
try {
|
|
124
|
+
const records = await scan.fetchAll();
|
|
125
|
+
for (const record of records) {
|
|
126
|
+
instances.push((0, utils_1.recordToInstance)(record, recordClass));
|
|
127
|
+
}
|
|
128
|
+
return instances;
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
throw new core_1.WalletError(`Error executing query. ${error.message}`, { cause: error });
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
AskarStorageService = __decorate([
|
|
136
|
+
(0, core_1.injectable)()
|
|
137
|
+
], AskarStorageService);
|
|
138
|
+
exports.AskarStorageService = AskarStorageService;
|
|
139
|
+
//# sourceMappingURL=AskarStorageService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AskarStorageService.js","sourceRoot":"","sources":["../../src/storage/AskarStorageService.ts"],"names":[],"mappings":";;;;;;;;;AAEA,yCAAoH;AACpH,wEAAsD;AAEtD,oDAAkE;AAClE,kEAA8D;AAE9D,mCAAmG;AAG5F,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,kBAAkB;IACX,KAAK,CAAC,IAAI,CAAC,YAA0B,EAAE,MAAS;QACrD,IAAA,qCAAiB,EAAC,YAAY,CAAC,MAAM,CAAC,CAAA;QAEtC,MAAM,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAA;QAE7B,MAAM,KAAK,GAAG,sBAAe,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;QAC/C,MAAM,IAAI,GAAG,IAAA,oCAA4B,EAAC,MAAM,CAAC,OAAO,EAAE,CAA2B,CAAA;QAErF,IAAI;YACF,MAAM,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,EAAE,CAChD,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CACxE,CAAA;SACF;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,IAAA,yBAAY,EAAC,KAAK,EAAE,2BAAc,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ding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AskarStorageService"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAqC"}
|