@maka/maka-cli 5.1.34 → 5.1.35
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maka/maka-cli",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.35",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"summary": "A command line tool for scaffolding Meteor 2.x applications using either React.",
|
|
6
6
|
"description": "A command line tool for scaffolding Meteor 2.x applications using React.",
|
|
@@ -7,7 +7,7 @@ import { WebApp } from 'meteor/webapp';
|
|
|
7
7
|
import { expressMiddleware } from '@as-integrations/express5';
|
|
8
8
|
import { buildSubgraphSchema } from '@apollo/subgraph';
|
|
9
9
|
import express from 'express';
|
|
10
|
-
import rateLimit from 'express-rate-limit';
|
|
10
|
+
import { rateLimit, ipKeyGenerator } from 'express-rate-limit';
|
|
11
11
|
|
|
12
12
|
// Create rate limiter middleware
|
|
13
13
|
const limiter = rateLimit({
|
|
@@ -18,7 +18,7 @@ const limiter = rateLimit({
|
|
|
18
18
|
legacyHeaders: false, // Disable the `X-RateLimit-*` headers,
|
|
19
19
|
keyGenerator: (req) => {
|
|
20
20
|
// Trust the 'X-Forwarded-For' header for client IP, but only if it exists
|
|
21
|
-
return req.headers['x-forwarded-for'] || req.ip;
|
|
21
|
+
return req.headers['x-forwarded-for'] || ipKeyGenerator(req.ip);
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
|
|
@@ -7,7 +7,7 @@ import { WebApp } from 'meteor/webapp';
|
|
|
7
7
|
import { expressMiddleware } from '@as-integrations/express5';
|
|
8
8
|
import { buildSubgraphSchema } from '@apollo/subgraph';
|
|
9
9
|
import express, { Request } from 'express';
|
|
10
|
-
import rateLimit from 'express-rate-limit';
|
|
10
|
+
import { rateLimit, ipKeyGenerator } from 'express-rate-limit';
|
|
11
11
|
|
|
12
12
|
// Define the types for the context
|
|
13
13
|
interface Context {
|
|
@@ -23,7 +23,7 @@ const limiter = rateLimit({
|
|
|
23
23
|
legacyHeaders: false, // Disable the `X-RateLimit-*` headers
|
|
24
24
|
keyGenerator: (req: Request) => {
|
|
25
25
|
// Trust the 'X-Forwarded-For' header for client IP, but only if it exists
|
|
26
|
-
return req.headers['x-forwarded-for'] || req.ip;
|
|
26
|
+
return req.headers['x-forwarded-for'] || ipKeyGenerator(req.ip);
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
<% if( withMethods ) { %>import '../../api/<%= apiVersion %><%= optsDir %><%= fileName %>/<%= fileName %>-<%= apiVersion %>-rpc-methods';<% } %>
|
|
2
2
|
<% if( withRest ) { %>import '../../api/<%= apiVersion %><%= optsDir %><%= fileName %>/<%= fileName %>-<%= apiVersion %>-rest-api';<% } %>
|
|
3
|
+
<% if (withGql) { %>import '../../api/<%= apiVersion %><%= optsDir %><%= fileName %>/<%= fileName %>-<%= apiVersion %>-graphql-api';<% } %>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maka/maka-cli",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.35",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"summary": "A command line tool for scaffolding Meteor 2.x applications using either React.",
|
|
6
6
|
"description": "A command line tool for scaffolding Meteor 2.x applications using React.",
|