-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Filters, Template Manager, Dynamic chaarcters list #38
Conversation
Deploying prosper-docs with
|
Latest commit: |
0d66c7c
|
Status: | ✅ Deploy successful! |
Preview URL: | https://461fc3be.realityspiral-dgb.pages.dev |
Branch Preview URL: | https://filterandtemplate.realityspiral-dgb.pages.dev |
Deploying agents-docs with
|
Latest commit: |
0d66c7c
|
Status: | ✅ Deploy successful! |
Preview URL: | https://f1856aac.realityspiral.pages.dev |
Branch Preview URL: | https://filterandtemplate.realityspiral.pages.dev |
Deploying prosper-docs with
|
Latest commit: |
3f5d39f
|
Status: | ✅ Deploy successful! |
Preview URL: | https://697a5d15.realityspiral-dgb.pages.dev |
Branch Preview URL: | https://filterandtemplate.realityspiral-dgb.pages.dev |
Deploying agents-docs with
|
Latest commit: |
3f5d39f
|
Status: | ✅ Deploy successful! |
Preview URL: | https://f21bffd1.realityspiral.pages.dev |
Branch Preview URL: | https://filterandtemplate.realityspiral.pages.dev |
router.get("/traces/unique-runs", async (req, res) => { | ||
getUniqueRuns(req, res); | ||
}); |
Check failure
Code scanning / CodeQL
Missing rate limiting High
a database access
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 7 days ago
To fix the problem, we need to introduce rate limiting to the Express application. The best way to do this is by using the express-rate-limit
package, which allows us to set up a rate limiter and apply it to the routes that perform expensive operations.
- Install the
express-rate-limit
package. - Import the
express-rate-limit
package in the file. - Set up a rate limiter with appropriate configuration (e.g., maximum of 100 requests per 15 minutes).
- Apply the rate limiter to the routes that perform expensive operations, such as the route handler on line 1005.
-
Copy modified line R6 -
Copy modified lines R44-R48 -
Copy modified line R1011
@@ -5,2 +5,3 @@ | ||
import express from "express"; | ||
import rateLimit from "express-rate-limit"; | ||
import type { Router } from "express"; | ||
@@ -42,2 +43,7 @@ | ||
|
||
const limiter = rateLimit({ | ||
windowMs: 15 * 60 * 1000, // 15 minutes | ||
max: 100, // limit each IP to 100 requests per windowMs | ||
}); | ||
|
||
interface UUIDParams { | ||
@@ -1004,3 +1010,3 @@ | ||
*/ | ||
router.get("/traces/unique-runs", async (req, res) => { | ||
router.get("/traces/unique-runs", limiter, async (req, res) => { | ||
getUniqueRuns(req, res); |
-
Copy modified lines R18-R54
@@ -17,36 +17,39 @@ | ||
}, | ||
"files": ["dist"], | ||
"dependencies": { | ||
"@elizaos/core": "^0.1.9", | ||
"@elizaos/plugin-image-generation": "^0.1.9", | ||
"@elizaos/plugin-tee-log": "^0.1.9", | ||
"@elizaos/plugin-tee-verifiable-log": "^0.1.9", | ||
"@realityspiral/client-coinbase": "workspace:*", | ||
"@types/body-parser": "1.19.5", | ||
"@types/cors": "2.8.17", | ||
"@types/express": "5.0.0", | ||
"body-parser": "1.20.3", | ||
"cors": "2.8.5", | ||
"discord.js": "14.16.3", | ||
"express": "4.21.1", | ||
"multer": "1.4.5-lts.1", | ||
"openai": "4.73.0", | ||
"pg": "^8.13.3", | ||
"swagger-jsdoc": "^6.2.8", | ||
"swagger-ui-express": "^5.0.1", | ||
"zod": "3.23.8" | ||
}, | ||
"devDependencies": { | ||
"@types/multer": "^1.4.12", | ||
"@types/node": "^22.13.4", | ||
"@types/pg": "^8.11.11", | ||
"tsup": "8.3.5" | ||
}, | ||
"scripts": { | ||
"build": "tsup --format esm --dts", | ||
"dev": "tsup --format esm --dts --watch" | ||
}, | ||
"peerDependencies": { | ||
"whatwg-url": "7.1.0" | ||
} | ||
"files": [ | ||
"dist" | ||
], | ||
"dependencies": { | ||
"@elizaos/core": "^0.1.9", | ||
"@elizaos/plugin-image-generation": "^0.1.9", | ||
"@elizaos/plugin-tee-log": "^0.1.9", | ||
"@elizaos/plugin-tee-verifiable-log": "^0.1.9", | ||
"@realityspiral/client-coinbase": "workspace:*", | ||
"@types/body-parser": "1.19.5", | ||
"@types/cors": "2.8.17", | ||
"@types/express": "5.0.0", | ||
"body-parser": "1.20.3", | ||
"cors": "2.8.5", | ||
"discord.js": "14.16.3", | ||
"express": "4.21.1", | ||
"multer": "1.4.5-lts.1", | ||
"openai": "4.73.0", | ||
"pg": "^8.13.3", | ||
"swagger-jsdoc": "^6.2.8", | ||
"swagger-ui-express": "^5.0.1", | ||
"zod": "3.23.8", | ||
"express-rate-limit": "^7.5.0" | ||
}, | ||
"devDependencies": { | ||
"@types/multer": "^1.4.12", | ||
"@types/node": "^22.13.4", | ||
"@types/pg": "^8.11.11", | ||
"tsup": "8.3.5" | ||
}, | ||
"scripts": { | ||
"build": "tsup --format esm --dts", | ||
"dev": "tsup --format esm --dts --watch" | ||
}, | ||
"peerDependencies": { | ||
"whatwg-url": "7.1.0" | ||
} | ||
} |
Package | Version | Security advisories |
express-rate-limit (npm) | 7.5.0 | None |
router.get("/templates/characters", async (req, res) => { | ||
getCharacters(req, res); | ||
}); |
Check failure
Code scanning / CodeQL
Missing rate limiting High
a file system access
* Filters, Template Manager, Dynamic chaarcters list * fix(tracer): fix swagger not diplaying endpoints, removed duplicated routes --------- Co-authored-by: Snobbish Bee <125891987+snobbee@users.noreply.github.com>
) * only sell what you have bought * add trade specific pnl * chore: add pre commit auto formatting (#37) * docs: Update TG on website (#39) Update TG on website * feat: Add provider for token address + staking instructions (#40) * token address + staking instructions * 2 * address comments * comments * docs: Update PROSPER token README.md (#43) * Update README.md * Add files via upload * Update Prosper token README.md Added image from staking website. * Update PROSPER token README.md described option for RSP holders to get PROSPER thotugh staking RSP/ETH * docs: Link to Prosper website from main RS website (#42) Link to Prosper website from main RS website * docs: Add stakeprosper.com link in coverpage (#41) Update _coverpage.md * chore: fix biome errors (#45) * fix: Filters, Template Manager, Dynamic chaarcters list (#38) * Filters, Template Manager, Dynamic chaarcters list * fix(tracer): fix swagger not diplaying endpoints, removed duplicated routes --------- Co-authored-by: Snobbish Bee <125891987+snobbee@users.noreply.github.com> * Update index.ts with bridging instructions (#46) * only sell what you have bought * add trade specific pnl * clean up * add wiining streak * formatting --------- Co-authored-by: Snobbish Bee <125891987+snobbee@users.noreply.github.com> Co-authored-by: Tim <70578108+TimKozak@users.noreply.github.com> Co-authored-by: mihai169 <42907887+mihai169@users.noreply.github.com> Co-authored-by: Master X <sohaibanwaar36@gmail.com>
Risks
Low – Changes are scoped to filtering, template management, and character listing.
Potential risk: UI regressions in template selection.
Mitigation: Manual and automated testing conducted.
Background
What does this PR do?
Fixes the filter issue and Template Manager.
Improves the dynamic character list retrieval from the API.
Ensures smooth selection and updates of templates for characters.
What kind of change is this?
✅ Bug Fix (resolves filtering issue)
✅ Improvement (better character management)
✅ Feature (dynamic character selection)
Documentation changes needed?
✅ No documentation changes required.