@riocrypto/common-server 1.0.1040 → 1.0.1042

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.
@@ -18,6 +18,7 @@ declare global {
18
18
  currentAdminAuth?: AdminAuthPayload;
19
19
  user?: UserDoc;
20
20
  validAdminApiKey?: boolean;
21
+ validClusterApiKey?: boolean;
21
22
  session?: any;
22
23
  }
23
24
  }
@@ -33,6 +33,16 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
33
33
  req.validAdminApiKey = true;
34
34
  }
35
35
  }
36
+ if (authorizationTypes.includes(common_1.AuthorizationType.Cluster)) {
37
+ let apiKey = req.header("x-api-key");
38
+ const CLUSTER_API_KEY = yield secret_manager_client_1.secretManagerClient.getSecretValue("CLUSTER_API_KEY");
39
+ if (!CLUSTER_API_KEY) {
40
+ throw new common_1.SecretManagerError();
41
+ }
42
+ if (apiKey === CLUSTER_API_KEY) {
43
+ req.validClusterApiKey = true;
44
+ }
45
+ }
36
46
  if (authorizationTypes.includes(common_1.AuthorizationType.Auth) ||
37
47
  authorizationTypes.includes(common_1.AuthorizationType.UserNoKYC) ||
38
48
  authorizationTypes.includes(common_1.AuthorizationType.User) ||
@@ -172,11 +182,13 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
172
182
  !req.currentAuth &&
173
183
  !req.user &&
174
184
  !req.validAdminApiKey &&
185
+ !req.validClusterApiKey &&
175
186
  !authorizationTypes.includes(common_1.AuthorizationType.Public)) ||
176
187
  (!req.currentAuth &&
177
188
  !authorizationTypes.includes(common_1.AuthorizationType.Auth) &&
178
189
  !req.user &&
179
190
  !req.validAdminApiKey &&
191
+ !req.validClusterApiKey &&
180
192
  !authorizationTypes.includes(common_1.AuthorizationType.Public))) {
181
193
  if (!req.user &&
182
194
  authorizationTypes.includes(common_1.AuthorizationType.UserOptional)) {
@@ -19,6 +19,7 @@ interface QuoteAttrs {
19
19
  createdAt: Date;
20
20
  noMarkups: boolean;
21
21
  quoteInCrypto: boolean;
22
+ reissueAfterExpiration: boolean;
22
23
  depositAddress?: string;
23
24
  brokerId?: string;
24
25
  conversionRateUSD: number;
@@ -45,6 +46,7 @@ interface QuoteDoc extends Document {
45
46
  price: number;
46
47
  quoteInCrypto: boolean;
47
48
  noMarkups: boolean;
49
+ reissueAfterExpiration: boolean;
48
50
  depositAddress?: string;
49
51
  brokerId?: string;
50
52
  conversionRateUSD: number;
@@ -103,6 +103,9 @@ const buildQuote = (mongoose) => {
103
103
  quoteInCrypto: {
104
104
  type: Boolean,
105
105
  },
106
+ reissueAfterExpiration: {
107
+ type: Boolean,
108
+ },
106
109
  }, {
107
110
  toJSON: {
108
111
  transform(doc, ret) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1040",
3
+ "version": "1.0.1042",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "@aws-sdk/client-s3": "^3.297.0",
25
25
  "@everapi/currencyapi-js": "^1.0.6",
26
26
  "@google-cloud/storage": "^6.9.5",
27
- "@riocrypto/common": "^1.0.896",
27
+ "@riocrypto/common": "^1.0.902",
28
28
  "@types/express": "^4.17.13",
29
29
  "axios": "^0.27.2",
30
30
  "ccxt": "^3.0.30",