compare br Master fix work flow non poof jop e2e cypress don't truest google chome & dev google nodejs cloud verify POW POR POA.#37
Conversation
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
…o v23.3.0 (#8) * ops: Add more mempool servers to elements.conf * ops: Bump elements to v23.3.0 --------- Co-authored-by: wiz <j@wiz.biz>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Create static.yml
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
…in permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
…in permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
…gery Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
…in permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Add a CircleCI configuration to run Rust formatting checks and tests via cargo.yml CI: Introduce a build-and-test job using cimg/rust:1.90.0 to run cargo fmt and cargo test Add caching for Cargo dependencies and build artifacts Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
* Update issue templates * Update .github/ISSUE_TEMPLATE/00-bug-issue.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> * Update .github/ISSUE_TEMPLATE/30-feature-request.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> * Update .github/ISSUE_TEMPLATE/custom.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> --------- Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
…gery Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
…scripting Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Reviewer's GuideThis PR hardens service proxy routes with explicit path whitelisting, adjusts GitHub issue templates, fixes a front-end redirect bug, tidies an existing CI config, and adds a suite of CI/CD workflows alongside a new security policy. Sequence diagram for hardened service proxy route with path whitelistingsequenceDiagram
participant Client
participant AccelerationRoutes
participant logger
participant MempoolService
Client->>AccelerationRoutes: Request to /api/v1/services/{path}
AccelerationRoutes->>AccelerationRoutes: Extract userPath
AccelerationRoutes->>AccelerationRoutes: Check allowedPaths whitelist
alt Path allowed
AccelerationRoutes->>MempoolService: Forward request to whitelisted path
MempoolService-->>AccelerationRoutes: Return response
AccelerationRoutes-->>Client: Send response
else Path not allowed
AccelerationRoutes->>logger: Log invalid path
AccelerationRoutes-->>Client: Return 400 error
end
Class diagram for updated AccelerationRoutes service proxy methodsclassDiagram
class AccelerationRoutes {
- $getAcceleratorAccelerationsHistoryAggregated(req, res)
- $getAcceleratorAccelerationsStats(req, res)
- $getAcceleratorEstimate(req, res)
+ allowedPaths: {accelerations, accelerations/history, accelerations/stats, estimate}
}
class logger {
+ err(message, tag)
}
AccelerationRoutes --> logger: logs errors
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary of ChangesHello @Dargon789, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a series of enhancements across the project's infrastructure, documentation, and application code. It establishes continuous integration for Rust components, improves the project's issue management by standardizing GitHub templates, and formalizes the security vulnerability reporting process. Furthermore, it strengthens the backend's resilience against malformed requests through path validation and corrects a minor frontend navigation issue. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `backend/src/api/acceleration/acceleration.routes.ts:42-47` </location>
<code_context>
private async $getAcceleratorAccelerationsHistoryAggregated(req: Request, res: Response): Promise<void> {
- const url = `${config.MEMPOOL_SERVICES.API}/${req.originalUrl.replace('/api/v1/services/', '')}`;
+ const allowedPaths = {
+ 'accelerations': 'accelerations',
+ 'accelerations/history': 'accelerations/history',
+ 'accelerations/stats': 'accelerations/stats',
+ 'estimate': 'estimate',
+ };
+ const userPath = req.originalUrl.replace('/api/v1/services/', '');
+ const safePath = allowedPaths[userPath];
</code_context>
<issue_to_address>
**suggestion:** Consider extracting allowedPaths to a shared constant to avoid repetition.
Since allowedPaths is used in multiple methods, moving it to a shared constant will improve maintainability and reduce code duplication.
Suggested implementation:
```typescript
const ALLOWED_PATHS: Record<string, string> = {
'accelerations': 'accelerations',
'accelerations/history': 'accelerations/history',
'accelerations/stats': 'accelerations/stats',
'estimate': 'estimate',
};
private async $getAcceleratorAccelerationsHistoryAggregated(req: Request, res: Response): Promise<void> {
const userPath = req.originalUrl.replace('/api/v1/services/', '');
const safePath = ALLOWED_PATHS[userPath];
```
If other methods in this file use the same allowed paths logic, update them to use the new `ALLOWED_PATHS` constant instead of their own local copies.
</issue_to_address>
### Comment 2
<location> `backend/src/api/acceleration/acceleration.routes.ts:48` </location>
<code_context>
+ 'accelerations/stats': 'accelerations/stats',
+ 'estimate': 'estimate',
+ };
+ const userPath = req.originalUrl.replace('/api/v1/services/', '');
+ const safePath = allowedPaths[userPath];
+ if (!safePath) {
</code_context>
<issue_to_address>
**issue:** Path extraction logic may be fragile if query parameters or trailing slashes are present.
req.originalUrl.replace may not reliably extract the intended path if query parameters or trailing slashes are present. Use req.path or a URL parser for more accurate path extraction.
</issue_to_address>
### Comment 3
<location> `.github/workflows/google.yml:104-106` </location>
<code_context>
+ docker push "${DOCKER_TAG}"
+
+ # Set up kustomize
+ - name: 'Set up Kustomize'
+ run: |-
+ curl -sfLo kustomize https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.4.3/kustomize_v5.4.3_linux_amd64.tar.gz
+ chmod u+x ./kustomize
+
</code_context>
<issue_to_address>
**issue (bug_risk):** The Kustomize setup downloads a tar.gz but does not extract it, which may cause execution issues.
The downloaded tar.gz should be extracted before applying chmod to ensure the kustomize binary is executable.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Code Review
This pull request introduces several changes, including new CircleCI configurations, updated GitHub issue templates, and a security policy. The security fix in backend/src/api/acceleration/acceleration.routes.ts to prevent path traversal is a crucial improvement. However, this fix introduces significant code duplication across three methods, which should be refactored for better maintainability. Additionally, the CircleCI setup has issues: cargo.yml contains duplicated steps, and the presence of a seemingly redundant config.yml template file is confusing. The other changes to issue templates and the security policy are good additions.
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Summary by Sourcery
Restrict and secure acceleration service endpoints, fix a frontend redirect bug, and introduce a suite of CI/CD workflows along with updated documentation and issue templates.
Bug Fixes:
Enhancements:
CI:
Documentation: