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)

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
  • Loading branch information
albertzaharovits committed Mar 29, 2024
1 parent f7fedb4 commit b4938e1
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ its <<api-key-role-descriptors,assigned role descriptors>> and the owner user's
If it exists, the profile uid is returned under the `profile_uid` response field for each API key.
Defaults to `false`.

`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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
"type":"boolean",
"default":false,
"description": "flag to also retrieve the API Key's owner profile uid, if it exists"
},
"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 b4938e1

Please sign in to comment.