Skip to content

Commit ad1630f

Browse files
lcawll-trotta
authored andcommitted
Add security.bulk_update_api_keys
1 parent ea0411c commit ad1630f

File tree

7 files changed

+340
-10
lines changed

7 files changed

+340
-10
lines changed

output/openapi/elasticsearch-openapi.json

Lines changed: 76 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

Lines changed: 145 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/validation-errors.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -634,12 +634,6 @@
634634
],
635635
"response": []
636636
},
637-
"security.bulk_update_api_keys": {
638-
"request": [
639-
"Missing request & response"
640-
],
641-
"response": []
642-
},
643637
"security.get_settings": {
644638
"request": [
645639
"Missing request & response"

output/typescript/types.ts

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_doc_ids/table.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,7 @@ searchable-snapshots-apis,https://www.elastic.co/guide/en/elasticsearch/referenc
591591
search-templates,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/search-template.html
592592
secure-settings,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/secure-settings.html
593593
security-api-authenticate,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/security-api-authenticate.html
594+
security-api-bulk-update-key,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/security-api-bulk-update-api-keys.html
594595
security-api-change-password,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/security-api-change-password.html
595596
security-api-clear-api-key-cache,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/security-api-clear-api-key-cache.html
596597
security-api-clear-cache,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/security-api-clear-cache.html
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { RoleDescriptor } from '@security/_types/RoleDescriptor'
21+
import { Dictionary } from '@spec_utils/Dictionary'
22+
import { RequestBase } from '@_types/Base'
23+
import { Metadata } from '@_types/common'
24+
import { Duration } from '@_types/Time'
25+
26+
/**
27+
* Bulk update API keys.
28+
* Update the attributes for multiple API keys.
29+
*
30+
* IMPORTANT: It is not possible to use an API key as the authentication credential for this API. To update API keys, the owner user's credentials are required.
31+
*
32+
* This API is similar to the update API key API but enables you to apply the same update to multiple API keys in one API call. This operation can greatly improve performance over making individual updates.
33+
*
34+
* It is not possible to update expired or invalidated API keys.
35+
*
36+
* This API supports updates to API key access scope, metadata and expiration.
37+
* The access scope of each API key is derived from the `role_descriptors` you specify in the request and a snapshot of the owner user's permissions at the time of the request.
38+
* The snapshot of the owner's permissions is updated automatically on every call.
39+
*
40+
* IMPORTANT: If you don't specify `role_descriptors` in the request, a call to this API might still change an API key's access scope. This change can occur if the owner user's permissions have changed since the API key was created or last modified.
41+
*
42+
* A successful request returns a JSON structure that contains the IDs of all updated API keys, the IDs of API keys that already had the requested changes and did not require an update, and error details for any failed update.
43+
* @rest_spec_name security.bulk_update_api_keys
44+
* @availability stack since=8.5.0 stability=stable visibility=public
45+
* @doc_id security-api-bulk-update-key
46+
* @cluster_privileges manage_own_api_key
47+
*/
48+
export interface Request extends RequestBase {
49+
body: {
50+
/**
51+
* Expiration time for the API keys.
52+
* By default, API keys never expire.
53+
* This property can be omitted to leave the value unchanged.
54+
*/
55+
expiration?: Duration
56+
/**
57+
* The API key identifiers.
58+
*/
59+
ids: string[]
60+
/**
61+
* Arbitrary nested metadata to associate with the API keys.
62+
* Within the `metadata` object, top-level keys beginning with an underscore (`_`) are reserved for system usage.
63+
* Any information specified with this parameter fully replaces metadata previously associated with the API key.
64+
*/
65+
metadata?: Metadata
66+
/**
67+
* The role descriptors to assign to the API keys.
68+
* An API key's effective permissions are an intersection of its assigned privileges and the point-in-time snapshot of permissions of the owner user.
69+
* You can assign new privileges by specifying them in this parameter.
70+
* To remove assigned privileges, supply the `role_descriptors` parameter as an empty object `{}`.
71+
* If an API key has no assigned privileges, it inherits the owner user's full permissions.
72+
* The snapshot of the owner's permissions is always updated, whether you supply the `role_descriptors` parameter.
73+
* The structure of a role descriptor is the same as the request for the create API keys API.
74+
*/
75+
role_descriptors?: Dictionary<string, RoleDescriptor>
76+
}
77+
}

0 commit comments

Comments
 (0)