@libp2p/tls 2.0.10 → 2.0.11
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.
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { serviceCapabilities } from '@libp2p/interface';
|
|
2
|
+
import type { MultiaddrConnection, ConnectionEncrypter, SecuredConnection, SecureConnectionOptions } from '@libp2p/interface';
|
|
3
|
+
import type { Duplex } from 'it-stream-types';
|
|
4
|
+
import type { Uint8ArrayList } from 'uint8arraylist';
|
|
5
|
+
export declare class TLS implements ConnectionEncrypter {
|
|
6
|
+
protocol: string;
|
|
7
|
+
constructor();
|
|
8
|
+
readonly [Symbol.toStringTag] = "@libp2p/tls";
|
|
9
|
+
readonly [serviceCapabilities]: string[];
|
|
10
|
+
secureInbound<Stream extends Duplex<AsyncGenerator<Uint8Array | Uint8ArrayList>> = MultiaddrConnection>(conn: Stream, options?: SecureConnectionOptions): Promise<SecuredConnection<Stream>>;
|
|
11
|
+
secureOutbound<Stream extends Duplex<AsyncGenerator<Uint8Array | Uint8ArrayList>> = MultiaddrConnection>(conn: Stream, options?: SecureConnectionOptions): Promise<SecuredConnection<Stream>>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=tls.browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tls.browser.d.ts","sourceRoot":"","sources":["../../src/tls.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAEvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAC7H,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,qBAAa,GAAI,YAAW,mBAAmB;IACtC,QAAQ,EAAE,MAAM,CAAW;;IAMlC,QAAQ,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,iBAAgB;IAE7C,QAAQ,CAAC,CAAC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAEvC;IAEK,aAAa,CAAE,MAAM,SAAS,MAAM,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,GAAG,mBAAmB,EAAG,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAI9L,cAAc,CAAE,MAAM,SAAS,MAAM,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,GAAG,mBAAmB,EAAG,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;CAGtM"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { serviceCapabilities } from '@libp2p/interface';
|
|
2
|
+
import { PROTOCOL } from './index.js';
|
|
3
|
+
export class TLS {
|
|
4
|
+
protocol = PROTOCOL;
|
|
5
|
+
constructor() {
|
|
6
|
+
throw new Error('TLS encryption is not possible in browsers');
|
|
7
|
+
}
|
|
8
|
+
[Symbol.toStringTag] = '@libp2p/tls';
|
|
9
|
+
[serviceCapabilities] = [
|
|
10
|
+
'@libp2p/connection-encryption'
|
|
11
|
+
];
|
|
12
|
+
async secureInbound(conn, options) {
|
|
13
|
+
throw new Error('TLS encryption is not possible in browsers');
|
|
14
|
+
}
|
|
15
|
+
async secureOutbound(conn, options) {
|
|
16
|
+
throw new Error('TLS encryption is not possible in browsers');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=tls.browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tls.browser.js","sourceRoot":"","sources":["../../src/tls.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAKrC,MAAM,OAAO,GAAG;IACP,QAAQ,GAAW,QAAQ,CAAA;IAElC;QACE,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAA;IAC/D,CAAC;IAEQ,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,aAAa,CAAA;IAEpC,CAAC,mBAAmB,CAAC,GAAa;QACzC,+BAA+B;KAChC,CAAA;IAED,KAAK,CAAC,aAAa,CAA6F,IAAY,EAAE,OAAiC;QAC7J,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAA;IAC/D,CAAC;IAED,KAAK,CAAC,cAAc,CAA6F,IAAY,EAAE,OAAiC;QAC9J,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAA;IAC/D,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/tls",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.11",
|
|
4
4
|
"description": "A connection encrypter that uses TLS 1.3",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/connection-encrypter-tls#readme",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"doc-check": "aegir doc-check"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@libp2p/crypto": "^5.0.
|
|
52
|
-
"@libp2p/interface": "^2.2.
|
|
53
|
-
"@libp2p/peer-id": "^5.0.
|
|
51
|
+
"@libp2p/crypto": "^5.0.7",
|
|
52
|
+
"@libp2p/interface": "^2.2.1",
|
|
53
|
+
"@libp2p/peer-id": "^5.0.8",
|
|
54
54
|
"@peculiar/asn1-schema": "^2.3.8",
|
|
55
55
|
"@peculiar/asn1-x509": "^2.3.8",
|
|
56
56
|
"@peculiar/webcrypto": "^1.4.6",
|
|
@@ -63,12 +63,14 @@
|
|
|
63
63
|
"uint8arrays": "^5.1.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@libp2p/
|
|
67
|
-
"@libp2p/logger": "^5.1.3",
|
|
68
|
-
"@multiformats/multiaddr": "^12.2.3",
|
|
66
|
+
"@libp2p/logger": "^5.1.4",
|
|
69
67
|
"aegir": "^44.0.1",
|
|
68
|
+
"it-pair": "^2.0.6",
|
|
70
69
|
"protons": "^7.5.0",
|
|
71
70
|
"sinon": "^18.0.0"
|
|
72
71
|
},
|
|
72
|
+
"browser": {
|
|
73
|
+
"./dist/src/tls.js": "./dist/src/tls.browser.js"
|
|
74
|
+
},
|
|
73
75
|
"sideEffects": false
|
|
74
76
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { serviceCapabilities } from '@libp2p/interface'
|
|
2
|
+
import { PROTOCOL } from './index.js'
|
|
3
|
+
import type { MultiaddrConnection, ConnectionEncrypter, SecuredConnection, SecureConnectionOptions } from '@libp2p/interface'
|
|
4
|
+
import type { Duplex } from 'it-stream-types'
|
|
5
|
+
import type { Uint8ArrayList } from 'uint8arraylist'
|
|
6
|
+
|
|
7
|
+
export class TLS implements ConnectionEncrypter {
|
|
8
|
+
public protocol: string = PROTOCOL
|
|
9
|
+
|
|
10
|
+
constructor () {
|
|
11
|
+
throw new Error('TLS encryption is not possible in browsers')
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
readonly [Symbol.toStringTag] = '@libp2p/tls'
|
|
15
|
+
|
|
16
|
+
readonly [serviceCapabilities]: string[] = [
|
|
17
|
+
'@libp2p/connection-encryption'
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
async secureInbound <Stream extends Duplex<AsyncGenerator<Uint8Array | Uint8ArrayList>> = MultiaddrConnection> (conn: Stream, options?: SecureConnectionOptions): Promise<SecuredConnection<Stream>> {
|
|
21
|
+
throw new Error('TLS encryption is not possible in browsers')
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async secureOutbound <Stream extends Duplex<AsyncGenerator<Uint8Array | Uint8ArrayList>> = MultiaddrConnection> (conn: Stream, options?: SecureConnectionOptions): Promise<SecuredConnection<Stream>> {
|
|
25
|
+
throw new Error('TLS encryption is not possible in browsers')
|
|
26
|
+
}
|
|
27
|
+
}
|