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

Forbid consumption of unsupported query params #113854

Closed
DaveCTurner opened this issue Oct 1, 2024 · 1 comment · Fixed by #113933 or #114040
Closed

Forbid consumption of unsupported query params #113854

DaveCTurner opened this issue Oct 1, 2024 · 1 comment · Fixed by #113933 or #114040
Labels
>bug :Core/Infra/REST API REST infrastructure and utilities Team:Core/Infra Meta label for core/infra team

Comments

@DaveCTurner
Copy link
Contributor

#112478 accidentally dropped support for the ?timeout param, reinstated in #113852. I think we could have detected this sooner: it should be an error for prepareRequest to attempt to consume a parameter that isn't in the set returned from supportedQueryParameters(), regardless of whether this parameter is supplied in the request or not.

@DaveCTurner DaveCTurner added :Core/Infra/REST API REST infrastructure and utilities >bug labels Oct 1, 2024
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Oct 1, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this issue Oct 2, 2024
REST APIs which declare their supported parameters must consume exactly
those parameters: consuming an unsupported parameter means that requests
including that parameter will be rejected, whereas failing to consume a
supported parameter means that this parameter has no effect and should
be removed.

This commit adds an assertion to verify that we are consuming the
correct parameters.

Closes elastic#113854
DaveCTurner added a commit that referenced this issue Oct 3, 2024
REST APIs which declare their supported parameters must consume exactly
those parameters: consuming an unsupported parameter means that requests
including that parameter will be rejected, whereas failing to consume a
supported parameter means that this parameter has no effect and should
be removed.

This commit adds an assertion to verify that we are consuming the
correct parameters.

Closes #113854
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this issue Oct 3, 2024
REST APIs which declare their supported parameters must consume exactly
those parameters: consuming an unsupported parameter means that requests
including that parameter will be rejected, whereas failing to consume a
supported parameter means that this parameter has no effect and should
be removed.

This commit adds an assertion to verify that we are consuming the
correct parameters.

Closes elastic#113854
Backport of elastic#113933 to `8.x`
gmarouli pushed a commit to gmarouli/elasticsearch that referenced this issue Oct 3, 2024
REST APIs which declare their supported parameters must consume exactly
those parameters: consuming an unsupported parameter means that requests
including that parameter will be rejected, whereas failing to consume a
supported parameter means that this parameter has no effect and should
be removed.

This commit adds an assertion to verify that we are consuming the
correct parameters.

Closes elastic#113854
@DaveCTurner DaveCTurner reopened this Oct 3, 2024
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this issue Oct 3, 2024
REST APIs which declare their supported parameters must consume exactly
those parameters: consuming an unsupported parameter means that requests
including that parameter will be rejected, whereas failing to consume a
supported parameter means that this parameter has no effect and should
be removed.

This commit adds an assertion to verify that we are consuming the
correct parameters.

Closes elastic#113854
DaveCTurner added a commit that referenced this issue Oct 4, 2024
REST APIs which declare their supported parameters must consume exactly
those parameters: consuming an unsupported parameter means that requests
including that parameter will be rejected, whereas failing to consume a
supported parameter means that this parameter has no effect and should
be removed.

This commit adds an assertion to verify that we are consuming the
correct parameters.

Closes #113854
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this issue Oct 4, 2024
REST APIs which declare their supported parameters must consume exactly
those parameters: consuming an unsupported parameter means that requests
including that parameter will be rejected, whereas failing to consume a
supported parameter means that this parameter has no effect and should
be removed.

This commit adds an assertion to verify that we are consuming the
correct parameters.

Closes elastic#113854
elasticsearchmachine pushed a commit that referenced this issue Oct 4, 2024
…114087)

* Assert that REST params are consumed iff supported (#114040)

REST APIs which declare their supported parameters must consume exactly
those parameters: consuming an unsupported parameter means that requests
including that parameter will be rejected, whereas failing to consume a
supported parameter means that this parameter has no effect and should
be removed.

This commit adds an assertion to verify that we are consuming the
correct parameters.

Closes #113854

* CI poke
matthewabbott pushed a commit to matthewabbott/elasticsearch that referenced this issue Oct 4, 2024
REST APIs which declare their supported parameters must consume exactly
those parameters: consuming an unsupported parameter means that requests
including that parameter will be rejected, whereas failing to consume a
supported parameter means that this parameter has no effect and should
be removed.

This commit adds an assertion to verify that we are consuming the
correct parameters.

Closes elastic#113854
matthewabbott pushed a commit to matthewabbott/elasticsearch that referenced this issue Oct 10, 2024
REST APIs which declare their supported parameters must consume exactly
those parameters: consuming an unsupported parameter means that requests
including that parameter will be rejected, whereas failing to consume a
supported parameter means that this parameter has no effect and should
be removed.

This commit adds an assertion to verify that we are consuming the
correct parameters.

Closes elastic#113854
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Core/Infra/REST API REST infrastructure and utilities Team:Core/Infra Meta label for core/infra team
Projects
None yet
2 participants