@nmshd/transport 6.32.0 → 6.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/buildInformation.js +5 -5
- package/dist/core/backbone/RESTClient.js +1 -1
- package/dist/modules/accounts/AccountController.js +2 -2
- package/dist/modules/devices/DeviceController.js +1 -1
- package/dist/modules/devices/DeviceSecretController.d.ts +1 -1
- package/dist/modules/devices/DeviceSecretController.js +1 -1
- package/dist/modules/devices/DevicesController.js +1 -1
- package/dist/modules/messages/MessageController.js +1 -1
- package/dist/modules/secrets/SecretController.d.ts +1 -1
- package/dist/modules/secrets/SecretController.js +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@nmshd/transport)
|
|
4
4
|
|
|
5
|
-
The transport library handles
|
|
5
|
+
The transport library handles Backbone communication and content encryption.
|
|
6
6
|
|
|
7
7
|
## Documentation
|
|
8
8
|
|
|
@@ -18,7 +18,7 @@ Share your feedback with the enmeshed team by contributing to the [discussions](
|
|
|
18
18
|
|
|
19
19
|
## Contribute
|
|
20
20
|
|
|
21
|
-
Contribution to this project is highly
|
|
21
|
+
Contribution to this project is highly appreciated. Head over to our [contribution guide](https://github.com/nmshd/.github/blob/main/CONTRIBUTING.md) to learn more.
|
|
22
22
|
|
|
23
23
|
## License
|
|
24
24
|
|
package/dist/buildInformation.js
CHANGED
|
@@ -4,11 +4,11 @@ exports.buildInformation = void 0;
|
|
|
4
4
|
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
5
5
|
const crypto_1 = require("@nmshd/crypto");
|
|
6
6
|
exports.buildInformation = {
|
|
7
|
-
version: "6.
|
|
8
|
-
build: "
|
|
9
|
-
date: "2025-03-
|
|
10
|
-
commit: "
|
|
11
|
-
dependencies: {"@js-soft/docdb-access-abstractions":"1.1.0","@js-soft/logging-abstractions":"^1.0.1","@js-soft/simple-logger":"1.0.5","@js-soft/ts-utils":"^2.3.3","@nmshd/core-types":"*","@nmshd/crypto":"2.1.0","axios":"^1.8.
|
|
7
|
+
version: "6.34.0",
|
|
8
|
+
build: "211",
|
|
9
|
+
date: "2025-03-26T15:48:51+00:00",
|
|
10
|
+
commit: "2291ac77d50440758307339d0c29bbf82081dbe1",
|
|
11
|
+
dependencies: {"@js-soft/docdb-access-abstractions":"1.1.0","@js-soft/logging-abstractions":"^1.0.1","@js-soft/simple-logger":"1.0.5","@js-soft/ts-utils":"^2.3.3","@nmshd/core-types":"*","@nmshd/crypto":"2.1.0","axios":"^1.8.4","fast-json-patch":"^3.1.1","form-data":"^4.0.2","https-proxy-agent":"^7.0.6","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","luxon":"^3.5.0","qs":"^6.14.0","reflect-metadata":"^0.2.2","ts-simple-nameof":"^1.3.1","uuid":"^11.1.0"},
|
|
12
12
|
libraries: {
|
|
13
13
|
crypto: crypto_1.buildInformation,
|
|
14
14
|
serval: ts_serval_1.buildInformation
|
|
@@ -139,7 +139,7 @@ class RESTClient {
|
|
|
139
139
|
getResult(method, path, response, requestId) {
|
|
140
140
|
const platformParameters = this.extractPlatformParameters(response);
|
|
141
141
|
this._logResponse(response, platformParameters, requestId, method, path);
|
|
142
|
-
// Rare case: We receive status 400 JSON error from
|
|
142
|
+
// Rare case: We receive status 400 JSON error from Backbone when downloading a file
|
|
143
143
|
if (response.status === 400 && !response.data?.error && response.headers["content-type"] === "application/json; charset=utf-8") {
|
|
144
144
|
try {
|
|
145
145
|
const errorText = crypto_1.CoreBuffer.from(response.data).toUtf8();
|
|
@@ -217,7 +217,7 @@ class AccountController {
|
|
|
217
217
|
const signedChallenge = await this.challenges.createAccountCreationChallenge(identityKeypair);
|
|
218
218
|
this._log.trace("Challenge signed. Creating device...");
|
|
219
219
|
const [createIdentityResponse, privSync, localAddress, deviceInfo] = await Promise.all([
|
|
220
|
-
// Register first device (and identity) on
|
|
220
|
+
// Register first device (and identity) on Backbone
|
|
221
221
|
this.identityClient.createIdentity({
|
|
222
222
|
devicePassword: devicePwdD1,
|
|
223
223
|
identityPublicKey: identityKeypair.publicKey.toBase64(),
|
|
@@ -241,7 +241,7 @@ class AccountController {
|
|
|
241
241
|
const createdIdentity = createIdentityResponse.value;
|
|
242
242
|
this._log.trace(`Registered identity with address ${createdIdentity.address}, device id is ${createdIdentity.device.id}.`);
|
|
243
243
|
if (!localAddress.equals(createdIdentity.address)) {
|
|
244
|
-
throw new core_1.TransportError(`The
|
|
244
|
+
throw new core_1.TransportError(`The Backbone address '${createdIdentity.address}' does not match the local address '${localAddress.toString()}'.`);
|
|
245
245
|
}
|
|
246
246
|
const identity = Identity_1.Identity.from({
|
|
247
247
|
address: core_types_1.CoreAddress.from(createdIdentity.address),
|
|
@@ -77,7 +77,7 @@ class DeviceController extends core_1.TransportController {
|
|
|
77
77
|
await this.secrets.storeSecret(credentials, DeviceSecretController_1.DeviceSecretType.DeviceCredentials);
|
|
78
78
|
}
|
|
79
79
|
catch (e) {
|
|
80
|
-
this.log.warn(`We've changed the device password on the
|
|
80
|
+
this.log.warn(`We've changed the device password on the Backbone but weren't able to store it to the database. The new password is '${newPassword}'.`);
|
|
81
81
|
throw e;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -16,7 +16,7 @@ export declare enum DeviceSecretType {
|
|
|
16
16
|
DeviceCredentials = "device_credentials"
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* The SecretController which acts as a single touchpoint to access any secret within the
|
|
19
|
+
* The SecretController which acts as a single touchpoint to access any secret within the Runtime.
|
|
20
20
|
* Each access can be audited.
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
@@ -32,7 +32,7 @@ var DeviceSecretType;
|
|
|
32
32
|
DeviceSecretType["DeviceCredentials"] = "device_credentials";
|
|
33
33
|
})(DeviceSecretType || (exports.DeviceSecretType = DeviceSecretType = {}));
|
|
34
34
|
/**
|
|
35
|
-
* The SecretController which acts as a single touchpoint to access any secret within the
|
|
35
|
+
* The SecretController which acts as a single touchpoint to access any secret within the Runtime.
|
|
36
36
|
* Each access can be audited.
|
|
37
37
|
*
|
|
38
38
|
*/
|
|
@@ -42,7 +42,7 @@ class DevicesController extends TransportController_1.TransportController {
|
|
|
42
42
|
}
|
|
43
43
|
async createDevice(params) {
|
|
44
44
|
const [signedChallenge, devicePwdDn] = await Promise.all([this.parent.challenges.createChallenge(Challenge_1.ChallengeType.Identity), util_1.PasswordGenerator.createStrongPassword(45, 50)]);
|
|
45
|
-
this.log.trace("Device Creation Challenge signed. Creating device on
|
|
45
|
+
this.log.trace("Device Creation Challenge signed. Creating device on Backbone...");
|
|
46
46
|
const response = (await this.client.createDevice({
|
|
47
47
|
signedChallenge: signedChallenge.toJSON(),
|
|
48
48
|
devicePassword: devicePwdDn,
|
|
@@ -411,7 +411,7 @@ class MessageController extends TransportController_1.TransportController {
|
|
|
411
411
|
}
|
|
412
412
|
recipients.push(CachedMessageRecipient_1.CachedMessageRecipient.from({
|
|
413
413
|
// make sure to save the pseudonym instead of the real address if the relationship was removed
|
|
414
|
-
// in cases the
|
|
414
|
+
// in cases the Backbone did not already process the relationship termination
|
|
415
415
|
address: relationship ? recipient.address : pseudonym,
|
|
416
416
|
encryptedKey: recipient.encryptedKey,
|
|
417
417
|
receivedAt: recipient.receivedAt,
|
|
@@ -10,7 +10,7 @@ export declare enum SecretBaseKeyType {
|
|
|
10
10
|
External = "external"
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* The SecretController which acts as a single touchpoint to access any secret within the
|
|
13
|
+
* The SecretController which acts as a single touchpoint to access any secret within the Runtime.
|
|
14
14
|
* Each access can be audited.
|
|
15
15
|
*/
|
|
16
16
|
export declare class SecretController extends TransportController {
|
|
@@ -27,7 +27,7 @@ var SecretBaseKeyType;
|
|
|
27
27
|
SecretBaseKeyType["External"] = "external";
|
|
28
28
|
})(SecretBaseKeyType || (exports.SecretBaseKeyType = SecretBaseKeyType = {}));
|
|
29
29
|
/**
|
|
30
|
-
* The SecretController which acts as a single touchpoint to access any secret within the
|
|
30
|
+
* The SecretController which acts as a single touchpoint to access any secret within the Runtime.
|
|
31
31
|
* Each access can be audited.
|
|
32
32
|
*/
|
|
33
33
|
class SecretController extends TransportController_1.TransportController {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nmshd/transport",
|
|
3
|
-
"description": "The transport library handles
|
|
3
|
+
"description": "The transport library handles Backbone communication and content encryption.",
|
|
4
4
|
"homepage": "https://enmeshed.eu",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"@js-soft/logging-abstractions": "^1.0.1",
|
|
71
71
|
"@js-soft/simple-logger": "1.0.5",
|
|
72
72
|
"@js-soft/ts-utils": "^2.3.3",
|
|
73
|
-
"@nmshd/core-types": "6.
|
|
73
|
+
"@nmshd/core-types": "6.34.0",
|
|
74
74
|
"@nmshd/crypto": "2.1.0",
|
|
75
|
-
"axios": "^1.8.
|
|
75
|
+
"axios": "^1.8.4",
|
|
76
76
|
"fast-json-patch": "^3.1.1",
|
|
77
77
|
"form-data": "^4.0.2",
|
|
78
78
|
"https-proxy-agent": "^7.0.6",
|
|
@@ -96,12 +96,12 @@
|
|
|
96
96
|
"@types/uuid": "^10.0.0",
|
|
97
97
|
"correlation-id": "^5.2.0",
|
|
98
98
|
"expect": "^29.7.0",
|
|
99
|
-
"testcontainers": "^10.
|
|
99
|
+
"testcontainers": "^10.22.0",
|
|
100
100
|
"ts-mockito": "^2.6.1"
|
|
101
101
|
},
|
|
102
102
|
"publishConfig": {
|
|
103
103
|
"access": "public",
|
|
104
104
|
"provenance": true
|
|
105
105
|
},
|
|
106
|
-
"version": "6.
|
|
106
|
+
"version": "6.34.0"
|
|
107
107
|
}
|