Skip to content

Commit

Permalink
Query API Key Information API support for the typed_keys request pa…
Browse files Browse the repository at this point in the history
…rameter (#106873) (#107110)

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.

Backport of #106873
  • Loading branch information
albertzaharovits committed Apr 5, 2024
1 parent 891166c commit ee1acff
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 57 deletions.
6 changes: 6 additions & 0 deletions docs/changelog/106873.yaml
@@ -0,0 +1,6 @@
pr: 106873
summary: Query API Key Information API support for the `typed_keys` request parameter
area: Security
type: enhancement
issues:
- 106817
4 changes: 4 additions & 0 deletions docs/reference/rest-api/security/query-api-key.asciidoc
Expand Up @@ -154,6 +154,10 @@ its <<api-key-role-descriptors,assigned role descriptors>> and the owner user's
(effectively limited by it). An API key cannot retrieve any API key's limited-by role descriptors
(including itself) unless it has `manage_api_key` or higher privileges.

`typed_keys`::
(Optional, Boolean) If `true`, aggregation names are prefixed by their respective types in the response.
Defaults to `false`.

[[security-api-query-api-key-request-body]]
==== {api-request-body-title}

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/search/search.asciidoc
Expand Up @@ -341,8 +341,8 @@ If `true`, the exact number of hits is returned at the cost of some performance.
If `false`, the response does not include the total number of hits matching the query.

`typed_keys`::
(Optional, Boolean) If `true`, aggregation and suggester names are be prefixed
by their respective types in the response. Defaults to `true`.
(Optional, Boolean) If `true`, aggregation and suggester names are prefixed
by their respective types in the response. Defaults to `false`.

`version`::
(Optional, Boolean)
Expand Down
Expand Up @@ -26,6 +26,11 @@
"type":"boolean",
"default":false,
"description": "flag to show the limited-by role descriptors of API Keys"
},
"typed_keys":{
"type":"boolean",
"default":false,
"description": "flag to prefix aggregation names by their respective types in the response"
}
},
"body":{
Expand Down

0 comments on commit ee1acff

Please sign in to comment.