Skip to content

Commit ee1acff

Browse files
Query API Key Information API support for the typed_keys request parameter (#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
1 parent 891166c commit ee1acff

File tree

6 files changed

+105
-57
lines changed

6 files changed

+105
-57
lines changed

docs/changelog/106873.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 106873
2+
summary: Query API Key Information API support for the `typed_keys` request parameter
3+
area: Security
4+
type: enhancement
5+
issues:
6+
- 106817

docs/reference/rest-api/security/query-api-key.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ its <<api-key-role-descriptors,assigned role descriptors>> and the owner user's
154154
(effectively limited by it). An API key cannot retrieve any API key's limited-by role descriptors
155155
(including itself) unless it has `manage_api_key` or higher privileges.
156156

157+
`typed_keys`::
158+
(Optional, Boolean) If `true`, aggregation names are prefixed by their respective types in the response.
159+
Defaults to `false`.
160+
157161
[[security-api-query-api-key-request-body]]
158162
==== {api-request-body-title}
159163

docs/reference/search/search.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,8 @@ If `true`, the exact number of hits is returned at the cost of some performance.
341341
If `false`, the response does not include the total number of hits matching the query.
342342

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

347347
`version`::
348348
(Optional, Boolean)

rest-api-spec/src/main/resources/rest-api-spec/api/security.query_api_keys.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
"type":"boolean",
2727
"default":false,
2828
"description": "flag to show the limited-by role descriptors of API Keys"
29+
},
30+
"typed_keys":{
31+
"type":"boolean",
32+
"default":false,
33+
"description": "flag to prefix aggregation names by their respective types in the response"
2934
}
3035
},
3136
"body":{

0 commit comments

Comments
 (0)