Skip to content
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

Misp2 looses all query parameters of a REST service while proxying requests #7

Open
aasaru opened this issue Nov 8, 2022 · 1 comment

Comments

@aasaru
Copy link

aasaru commented Nov 8, 2022

I have a REST service and I try to call it using the latest MISP2 (I'm using the Docker version found in docker-dev).
My OpenAPI based service has defined some optional query paramters like this:

        - in: query
          name: myParam
          description: myParam
          required: false
          schema:
            type: string

I have generated a form in Misp2 and I can fill in the value of "myParam"
However when I submit the form all the values (that had in:query in the yaml) are lost by MISP2.

It seems this code lacks copying over the query params:
https://github.com/nordic-institute/misp2/blob/develop/web-app/src/main/java/ee/aktors/misp2/action/RestMediatorAction.java#L235-L289

How to test:

  1. import this OpenAPI yaml into Misp2 and generate forms
    https://x-tee.ee/catalogue-data/ee-dev/ee-dev/COM/11333578/rest-service-01/petstore_1.yaml
  2. Open the service "Get pets from store"

As you can see from the yaml it has a query parameter "name":

paths:
  /pets:
    get:
      tags:
        - pet
      summary: Get pets from store
      description: Search pets
      operationId: getPets
      parameters:
        - name: name
          in: query
          description: Pet name search
          required: false
          schema:
            type: string
  1. When you fill in the form and set name to value "doggy" and submit you will notice that MISP2 hits URL "/pets" (without any query parameters) but it should try to open "/pets?name=doggy"
@raits
Copy link
Contributor

raits commented Nov 16, 2022

Thank you for reporting this problem to us. It does indeed seem that MISP2 does not currently support using query parameters for REST services.

I have created a backlog item in our JIRA to tackle this: https://nordic-institute.atlassian.net/browse/MISPDEV-84

Unfortunately, I can not offer a timeline for when we can introduce this improvement to MISP2 at this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants