Skip to content

Commit

Permalink
remove rate limits (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
franzns authored Mar 11, 2024
1 parent 88b3f07 commit 265da76
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 38 deletions.
12 changes: 0 additions & 12 deletions stellate/api/stellate.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,6 @@ const config = {
],
name: 'api-v3',
originUrl: 'https://api-v3-origin.balancer.fi/graphql',
getConsumerIdentifiers:
"(() => {\n function getIp(req) {\n const { ip } = req;\n // const allowedIps = []\n // if (allowedIps.includes(ip)) {\n // return null\n // }\n if (req.headers['X-Forwarded-For']) {\n return req.headers['X-Forwarded-For'].split(',')[0];\n }\n return ip;\n}\n return (req) => ({\n ip: getIp(req),\n})\n})()",
rateLimit: {
name: 'IP Limit',
consumerIdentifier: 'ip',
allowList: [],
limit: {
type: 'QueryComplexity',
budget: 5000,
window: '5m',
},
},
},
};

Expand Down
2 changes: 0 additions & 2 deletions stellate/backend-canary/stellate.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ const config = {
enabled: false,
auth: false,
},
rateLimits:
"(req) => {\n if (req.headers['stellate-api-token'] &&\n req.headers['stellate-api-token'] ===\n 'stl8_bcebb2b60910a55e58a82c8e83825034dc763e294582447118fab0a6a1225ebb') {\n return [\n {\n name: 'Specific API Token based limits',\n state: 'dryRun',\n group: req.headers['stellate-api-token'],\n limit: {\n type: 'RequestCount',\n budget: 20,\n window: '1m',\n },\n },\n ];\n }\n if (req.headers['stellate-api-token']) {\n return [\n {\n name: 'General API Token based limits',\n state: 'dryRun',\n group: req.headers['stellate-api-token'],\n limit: {\n type: 'RequestCount',\n budget: 10,\n window: '1m',\n },\n },\n ];\n }\n const xForwardedFor = Array.isArray(req.headers['x-forwarded-for'])\n ? req.headers['x-forwarded-for'][0]\n : req.headers['x-forwarded-for'];\n return [\n {\n name: 'IP based limits',\n state: 'dryRun',\n group: xForwardedFor ? xForwardedFor.split(',')[0] : req.ip,\n limit: {\n type: 'RequestCount',\n budget: 5,\n window: '1m',\n },\n },\n ];\n}",
},
};

Expand Down
12 changes: 0 additions & 12 deletions stellate/backend/stellate.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,6 @@ const config = {
],
name: 'backend-v3',
originUrl: 'https://backend-v3-origin.beets-ftm-node.com/graphql',
getConsumerIdentifiers:
"(() => {\n function getIp(req) {\n const { ip } = req;\n // const allowedIps = []\n // if (allowedIps.includes(ip)) {\n // return null\n // }\n if (req.headers['X-Forwarded-For']) {\n return req.headers['X-Forwarded-For'].split(',')[0];\n }\n return ip;\n}\n return (req) => ({\n ip: getIp(req),\n})\n})()",
rateLimit: {
name: 'IP Limit',
consumerIdentifier: 'ip',
allowList: [],
limit: {
type: 'QueryComplexity',
budget: 5000,
window: '5m',
},
},
},
};

Expand Down
12 changes: 0 additions & 12 deletions stellate/test-api/stellate.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,6 @@ const config = {
],
name: 'test-api-v3',
originUrl: 'https://test-api-v3-origin.balancer.fi/graphql',
getConsumerIdentifiers:
"(() => {\n function getIp(req) {\n const { ip } = req;\n // const allowedIps = []\n // if (allowedIps.includes(ip)) {\n // return null\n // }\n if (req.headers['X-Forwarded-For']) {\n return req.headers['X-Forwarded-For'].split(',')[0];\n }\n return ip;\n}\n return (req) => ({\n ip: getIp(req),\n})\n})()",
rateLimit: {
name: 'IP Limit',
consumerIdentifier: 'ip',
allowList: [],
limit: {
type: 'QueryComplexity',
budget: 5000,
window: '5m',
},
},
},
};

Expand Down

0 comments on commit 265da76

Please sign in to comment.