godprotocol 2.2.55 → 2.2.57
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/package.json
CHANGED
|
@@ -7,9 +7,9 @@ class DB {
|
|
|
7
7
|
|
|
8
8
|
let conf = {
|
|
9
9
|
db_url: config.db_url,
|
|
10
|
-
db_name: router?.gp?.platform_uri.replace(/\./g, "-"),
|
|
10
|
+
db_name: config.db_name || router?.gp?.platform_uri.replace(/\./g, "-"),
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
this.db = new Mongo(conf);
|
|
14
14
|
|
|
15
15
|
this.folders = {};
|
|
@@ -204,7 +204,7 @@ class Headers extends Services {
|
|
|
204
204
|
|
|
205
205
|
let checks = {
|
|
206
206
|
api_key: () => !!headers["x-api-key"],
|
|
207
|
-
|
|
207
|
+
auth_token: () => !!headers["authorization"],
|
|
208
208
|
xplatform: () => !!headers["x-platform"],
|
|
209
209
|
};
|
|
210
210
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import Headers from "./Header.js";
|
|
2
2
|
|
|
3
3
|
let securities = {
|
|
4
|
-
both: ["api_key", "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
all: ["api_key", "
|
|
4
|
+
both: ["api_key", "auth_token"],
|
|
5
|
+
api_key: ["api_key"],
|
|
6
|
+
auth_token: ["auth_token"],
|
|
7
|
+
all: ["api_key", "auth_token", "xplatform"],
|
|
8
8
|
none: [],
|
|
9
9
|
};
|
|
10
10
|
|
|
@@ -15,6 +15,7 @@ class Route_table extends Headers {
|
|
|
15
15
|
this.gp = gp;
|
|
16
16
|
this.db_config = gp.db_config;
|
|
17
17
|
this.api_key = gp.api_key;
|
|
18
|
+
this.platform_uri = gp.platform_uri;
|
|
18
19
|
this.versions = {};
|
|
19
20
|
this.validators = {};
|
|
20
21
|
}
|