Skip to content

Batch Requests - Method not allowed for batch request #1885

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

Closed
AlfredoG87 opened this issue Nov 8, 2023 · 1 comment · Fixed by #3497
Closed

Batch Requests - Method not allowed for batch request #1885

AlfredoG87 opened this issue Nov 8, 2023 · 1 comment · Fixed by #3497
Assignees
Labels
enhancement New feature or request Team Promoted Issues to be triaged and discussed by committers, maintainers, to be worked on the following sprint
Milestone

Comments

@AlfredoG87
Copy link
Contributor

Problem

Some methods should not be allowed to be requested as part of a batch.

Debug and Filter APIs to start with, but we might want to leave them in a configurable property that we can extend if needed.

Solution

  • New error
    code: -32007
    message: Method <method> is not permitted as part of batch requests

  • New Configurable property with the list of the methods that are not allowed for batch.

  • Add a validation on each request, right before calling getRequestResult
    Current:

const promises = body.map((item: any) => this.getRequestResult(item, ctx.ip));

Proposed:

    const promises = body.map((item: any) => {
      //validate method is allowed for batch requests
      if(this.methodIsAllowed(item.method)) {
        this.getRequestResult(item, ctx.ip)
      } else {
        return jsonResp(item.id, new MethodNotAllowedForBatch(item.method), undefined);
      }
    });

Alternatives

No response

@AlfredoG87 AlfredoG87 added the enhancement New feature or request label Nov 8, 2023
@Ferparishuertas Ferparishuertas added the Team Promoted Issues to be triaged and discussed by committers, maintainers, to be worked on the following sprint label Feb 12, 2025
@Ferparishuertas
Copy link

Steps for this taks.

  • document, make inventory, of the ones supported on the standard
  • once identified decide whats more efficient whitelist, blacklist or other

@natanasow natanasow self-assigned this Feb 17, 2025
@natanasow natanasow moved this from Backlog to In Review in Smart Contract Sprint Board Feb 17, 2025
@natanasow natanasow moved this from In Review to Tasks In Progress in Smart Contract Sprint Board Feb 17, 2025
@natanasow natanasow added this to the 0.67.0 milestone Feb 19, 2025
@natanasow natanasow moved this from Tasks In Progress to In Review in Smart Contract Sprint Board Feb 19, 2025
@github-project-automation github-project-automation bot moved this from In Review to Done in Smart Contract Sprint Board Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Team Promoted Issues to be triaged and discussed by committers, maintainers, to be worked on the following sprint
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants