@tdxvolt/volt-client-grpc 0.16.0-beta.3 → 0.16.0-beta.4
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/lib/index.cjs +7 -7
- package/package.json +1 -1
- package/src/volt-client-internal.js +7 -7
package/lib/index.cjs
CHANGED
|
@@ -1775,7 +1775,7 @@ function findDIDDocumentService(document, serviceType) {
|
|
|
1775
1775
|
return matches;
|
|
1776
1776
|
}
|
|
1777
1777
|
|
|
1778
|
-
async function authenticateInternal(
|
|
1778
|
+
async function authenticateInternal(useDID = true) {
|
|
1779
1779
|
try {
|
|
1780
1780
|
// Check if we need to resolve a Relay volt.
|
|
1781
1781
|
if (
|
|
@@ -1841,13 +1841,11 @@ async function authenticateInternal(createDID = true) {
|
|
|
1841
1841
|
);
|
|
1842
1842
|
}
|
|
1843
1843
|
|
|
1844
|
-
if (!
|
|
1844
|
+
if (!useDID) {
|
|
1845
1845
|
authenticateRequest.public_key = publicKeyPem;
|
|
1846
|
-
} else {
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
this._credential.cache.identity_id = `did:volt:${uuid.v4()}`;
|
|
1850
|
-
}
|
|
1846
|
+
} else if (!this._credential.cache.identity_id) {
|
|
1847
|
+
// If we don't have an identity id, then we need to create a DID.
|
|
1848
|
+
this._credential.cache.identity_id = `did:volt:${uuid.v4()}`;
|
|
1851
1849
|
|
|
1852
1850
|
const did = this._credential.cache.identity_id;
|
|
1853
1851
|
|
|
@@ -1903,6 +1901,8 @@ async function authenticateInternal(createDID = true) {
|
|
|
1903
1901
|
|
|
1904
1902
|
log$1("did document is %s", authenticateRequest.did_document);
|
|
1905
1903
|
log$1("did signature is %s", authenticateRequest.did_document_signature);
|
|
1904
|
+
} else {
|
|
1905
|
+
authenticateRequest.did = this._credential.cache.identity_id;
|
|
1906
1906
|
}
|
|
1907
1907
|
|
|
1908
1908
|
log$1("authenticate TTL is ", this._config.bindRequestTTL);
|
package/package.json
CHANGED
|
@@ -91,7 +91,7 @@ function findDIDDocumentService(document, serviceType) {
|
|
|
91
91
|
return matches;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
export async function authenticateInternal(
|
|
94
|
+
export async function authenticateInternal(useDID = true) {
|
|
95
95
|
try {
|
|
96
96
|
// Check if we need to resolve a Relay volt.
|
|
97
97
|
if (
|
|
@@ -157,13 +157,11 @@ export async function authenticateInternal(createDID = true) {
|
|
|
157
157
|
);
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
if (!
|
|
160
|
+
if (!useDID) {
|
|
161
161
|
authenticateRequest.public_key = publicKeyPem;
|
|
162
|
-
} else {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
this._credential.cache.identity_id = `did:volt:${generateId()}`;
|
|
166
|
-
}
|
|
162
|
+
} else if (!this._credential.cache.identity_id) {
|
|
163
|
+
// If we don't have an identity id, then we need to create a DID.
|
|
164
|
+
this._credential.cache.identity_id = `did:volt:${generateId()}`;
|
|
167
165
|
|
|
168
166
|
const did = this._credential.cache.identity_id;
|
|
169
167
|
|
|
@@ -219,6 +217,8 @@ export async function authenticateInternal(createDID = true) {
|
|
|
219
217
|
|
|
220
218
|
log("did document is %s", authenticateRequest.did_document);
|
|
221
219
|
log("did signature is %s", authenticateRequest.did_document_signature);
|
|
220
|
+
} else {
|
|
221
|
+
authenticateRequest.did = this._credential.cache.identity_id;
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
log("authenticate TTL is ", this._config.bindRequestTTL);
|