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

RestQueryApiKeyAction is missing the "typed_keys" parameter #106817

Closed
swallez opened this issue Mar 27, 2024 · 1 comment · Fixed by #106873
Closed

RestQueryApiKeyAction is missing the "typed_keys" parameter #106817

swallez opened this issue Mar 27, 2024 · 1 comment · Fixed by #106873
Labels
>bug :Security/Security Security issues without another label Team:Security Meta label for security team

Comments

@swallez
Copy link
Member

swallez commented Mar 27, 2024

PR #104895 introduced aggregations in the API key query endpoint. However, it did not add the typed_keys parameter that provides type information in aggregation results.

This information is necessary for client libraries in strongly typed languages to identify the aggregate type and instantiate the corresponding class or type. Without it, Elastic client libraries in Java, Go and .Net will fail to deserialize results of API key queries that contain aggregations. There's no workaround.

The fix should boil down to providing an implementation of responseParams() like in RestSearchAction. It may be worth also evaluating whether other response parameters in RestSearchAction would be useful in the context of API key queries.

/cc @albertzaharovits who authored the PR for awareness.

@swallez swallez added >bug :Security/Security Security issues without another label labels Mar 27, 2024
@elasticsearchmachine elasticsearchmachine added the Team:Security Meta label for security team label Mar 27, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-security (Team:Security)

albertzaharovits added a commit that referenced this issue Mar 29, 2024
…rameter (#106873)

The typed_keys request parameter is the canonical parameter,
that's also used in the regular index _search enpoint, in order to
return the types of aggregations in the response.
This is required by typed language clients of the _security/_query/api_key
endpoint that are using aggregations.

Closes #106817
albertzaharovits added a commit to albertzaharovits/elasticsearch that referenced this issue Apr 4, 2024
…rameter (elastic#106873)

The typed_keys request parameter is the canonical parameter,
that's also used in the regular index _search enpoint, in order to
return the types of aggregations in the response.
This is required by typed language clients of the _security/_query/api_key
endpoint that are using aggregations.

Closes elastic#106817
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Security/Security Security issues without another label Team:Security Meta label for security team
Projects
None yet
2 participants