libp2p 1.2.0 → 1.2.1-0321812e7
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/dist/index.min.js +13 -24
- package/dist/src/config/connection-gater.browser.js +2 -2
- package/dist/src/config/connection-gater.browser.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.d.ts.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/package.json +30 -31
- package/src/config/connection-gater.browser.ts +2 -2
- package/src/version.ts +1 -1
- package/dist/typedoc-urls.json +0 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { isPrivateIp } from '@libp2p/utils/private-ip';
|
|
2
2
|
/**
|
|
3
3
|
* Returns a connection gater that disallows dialling private addresses by
|
|
4
4
|
* default. Browsers are severely limited in their resource usage so don't
|
|
@@ -10,7 +10,7 @@ export function connectionGater(gater = {}) {
|
|
|
10
10
|
denyDialMultiaddr: async (multiaddr) => {
|
|
11
11
|
const tuples = multiaddr.stringTuples();
|
|
12
12
|
if (tuples[0][0] === 4 || tuples[0][0] === 41) {
|
|
13
|
-
return Boolean(
|
|
13
|
+
return Boolean(isPrivateIp(`${tuples[0][1]}`));
|
|
14
14
|
}
|
|
15
15
|
return false;
|
|
16
16
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-gater.browser.js","sourceRoot":"","sources":["../../../src/config/connection-gater.browser.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"connection-gater.browser.js","sourceRoot":"","sources":["../../../src/config/connection-gater.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAItD;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAE,QAAyB,EAAE;IAC1D,OAAO;QACL,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAC/B,iBAAiB,EAAE,KAAK,EAAE,SAAoB,EAAE,EAAE;YAChD,MAAM,MAAM,GAAG,SAAS,CAAC,YAAY,EAAE,CAAA;YAEvC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;gBAC9C,OAAO,OAAO,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;YAChD,CAAC;YAED,OAAO,KAAK,CAAA;QACd,CAAC;QACD,qBAAqB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACxC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACzC,8BAA8B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACjD,+BAA+B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAClD,6BAA6B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAChD,8BAA8B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACjD,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,IAAI;QACxC,GAAG,KAAK;KACT,CAAA;AACH,CAAC"}
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,oBAAoB,CAAA;AACxC,eAAO,MAAM,IAAI,WAAW,CAAA"}
|
package/dist/src/version.js
CHANGED
package/dist/src/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,iBAAiB,CAAA;AACxC,MAAM,CAAC,MAAM,IAAI,GAAG,QAAQ,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libp2p",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1-0321812e7",
|
|
4
4
|
"description": "JavaScript implementation of libp2p, a modular peer to peer network stack",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/libp2p#readme",
|
|
@@ -84,52 +84,51 @@
|
|
|
84
84
|
"test:webkit": "aegir test -t browser -f \"./dist/test/**/*.spec.js\" -- --browser webkit"
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@libp2p/crypto": "
|
|
88
|
-
"@libp2p/interface": "
|
|
89
|
-
"@libp2p/interface-internal": "
|
|
90
|
-
"@libp2p/logger": "
|
|
91
|
-
"@libp2p/multistream-select": "
|
|
92
|
-
"@libp2p/peer-collections": "
|
|
93
|
-
"@libp2p/peer-id": "
|
|
94
|
-
"@libp2p/peer-id-factory": "
|
|
95
|
-
"@libp2p/peer-store": "
|
|
96
|
-
"@libp2p/utils": "
|
|
97
|
-
"@multiformats/multiaddr": "^12.1.
|
|
87
|
+
"@libp2p/crypto": "4.0.1-0321812e7",
|
|
88
|
+
"@libp2p/interface": "1.1.2-0321812e7",
|
|
89
|
+
"@libp2p/interface-internal": "1.0.7-0321812e7",
|
|
90
|
+
"@libp2p/logger": "4.0.5-0321812e7",
|
|
91
|
+
"@libp2p/multistream-select": "5.1.2-0321812e7",
|
|
92
|
+
"@libp2p/peer-collections": "5.1.5-0321812e7",
|
|
93
|
+
"@libp2p/peer-id": "4.0.5-0321812e7",
|
|
94
|
+
"@libp2p/peer-id-factory": "4.0.5-0321812e7",
|
|
95
|
+
"@libp2p/peer-store": "10.0.8-0321812e7",
|
|
96
|
+
"@libp2p/utils": "5.2.3-0321812e7",
|
|
97
|
+
"@multiformats/multiaddr": "^12.1.14",
|
|
98
98
|
"any-signal": "^4.1.1",
|
|
99
|
-
"datastore-core": "^9.
|
|
100
|
-
"interface-datastore": "^8.2.
|
|
101
|
-
"it-merge": "^3.0.
|
|
99
|
+
"datastore-core": "^9.2.7",
|
|
100
|
+
"interface-datastore": "^8.2.10",
|
|
101
|
+
"it-merge": "^3.0.3",
|
|
102
102
|
"it-parallel": "^3.0.6",
|
|
103
103
|
"merge-options": "^3.0.4",
|
|
104
|
-
"multiformats": "^13.0.
|
|
105
|
-
"
|
|
106
|
-
"uint8arrays": "^5.0.0"
|
|
104
|
+
"multiformats": "^13.0.1",
|
|
105
|
+
"uint8arrays": "^5.0.1"
|
|
107
106
|
},
|
|
108
107
|
"devDependencies": {
|
|
109
108
|
"@chainsafe/libp2p-yamux": "^6.0.1",
|
|
110
|
-
"@libp2p/circuit-relay-v2": "
|
|
111
|
-
"@libp2p/identify": "
|
|
112
|
-
"@libp2p/interface-compliance-tests": "
|
|
113
|
-
"@libp2p/mplex": "
|
|
114
|
-
"@libp2p/plaintext": "
|
|
115
|
-
"@libp2p/tcp": "
|
|
116
|
-
"@libp2p/websockets": "
|
|
109
|
+
"@libp2p/circuit-relay-v2": "1.0.13-0321812e7",
|
|
110
|
+
"@libp2p/identify": "1.0.12-0321812e7",
|
|
111
|
+
"@libp2p/interface-compliance-tests": "5.2.0-0321812e7",
|
|
112
|
+
"@libp2p/mplex": "10.0.13-0321812e7",
|
|
113
|
+
"@libp2p/plaintext": "1.0.13-0321812e7",
|
|
114
|
+
"@libp2p/tcp": "9.0.13-0321812e7",
|
|
115
|
+
"@libp2p/websockets": "8.0.13-0321812e7",
|
|
117
116
|
"@multiformats/mafmt": "^12.1.6",
|
|
118
|
-
"@multiformats/multiaddr-matcher": "^1.1.
|
|
119
|
-
"aegir": "^42.
|
|
117
|
+
"@multiformats/multiaddr-matcher": "^1.1.2",
|
|
118
|
+
"aegir": "^42.2.3",
|
|
120
119
|
"delay": "^6.0.0",
|
|
121
|
-
"it-all": "^3.0.
|
|
120
|
+
"it-all": "^3.0.4",
|
|
122
121
|
"it-drain": "^3.0.5",
|
|
123
|
-
"it-map": "^3.0.
|
|
122
|
+
"it-map": "^3.0.5",
|
|
124
123
|
"it-pipe": "^3.0.1",
|
|
125
|
-
"it-pushable": "^3.2.
|
|
124
|
+
"it-pushable": "^3.2.3",
|
|
126
125
|
"it-stream-types": "^2.0.1",
|
|
127
126
|
"p-defer": "^4.0.0",
|
|
128
127
|
"p-event": "^6.0.0",
|
|
129
128
|
"p-wait-for": "^5.0.2",
|
|
130
129
|
"sinon": "^17.0.1",
|
|
131
130
|
"sinon-ts": "^2.0.0",
|
|
132
|
-
"uint8arraylist": "^2.4.
|
|
131
|
+
"uint8arraylist": "^2.4.8"
|
|
133
132
|
},
|
|
134
133
|
"browser": {
|
|
135
134
|
"./dist/src/connection-manager/constants.js": "./dist/src/connection-manager/constants.browser.js",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { isPrivateIp } from '@libp2p/utils/private-ip'
|
|
2
2
|
import type { ConnectionGater } from '@libp2p/interface'
|
|
3
3
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
4
4
|
|
|
@@ -14,7 +14,7 @@ export function connectionGater (gater: ConnectionGater = {}): ConnectionGater {
|
|
|
14
14
|
const tuples = multiaddr.stringTuples()
|
|
15
15
|
|
|
16
16
|
if (tuples[0][0] === 4 || tuples[0][0] === 41) {
|
|
17
|
-
return Boolean(
|
|
17
|
+
return Boolean(isPrivateIp(`${tuples[0][1]}`))
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
return false
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '1.2.
|
|
1
|
+
export const version = '1.2.1-0321812e7'
|
|
2
2
|
export const name = 'libp2p'
|
package/dist/typedoc-urls.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Libp2pInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.Libp2pInit.html",
|
|
3
|
-
".:Libp2pInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.Libp2pInit.html",
|
|
4
|
-
"Libp2pOptions": "https://libp2p.github.io/js-libp2p/types/libp2p.index.Libp2pOptions.html",
|
|
5
|
-
".:Libp2pOptions": "https://libp2p.github.io/js-libp2p/types/libp2p.index.Libp2pOptions.html",
|
|
6
|
-
"ServiceFactoryMap": "https://libp2p.github.io/js-libp2p/types/libp2p.index.ServiceFactoryMap.html",
|
|
7
|
-
".:ServiceFactoryMap": "https://libp2p.github.io/js-libp2p/types/libp2p.index.ServiceFactoryMap.html",
|
|
8
|
-
"createLibp2p": "https://libp2p.github.io/js-libp2p/functions/libp2p.index.createLibp2p.html",
|
|
9
|
-
".:createLibp2p": "https://libp2p.github.io/js-libp2p/functions/libp2p.index.createLibp2p.html",
|
|
10
|
-
"name": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.name.html",
|
|
11
|
-
"./version:name": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.name.html",
|
|
12
|
-
"version": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.version.html",
|
|
13
|
-
"./version:version": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.version.html"
|
|
14
|
-
}
|