@@ -32,7 +32,6 @@ class Security extends AbstractEndpoint
32
32
* Creates or updates the user profile on behalf of another user.
33
33
*
34
34
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-activate-user-profile.html
35
- * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
36
35
*
37
36
* @param array{
38
37
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
@@ -96,6 +95,41 @@ public function authenticate(array $params = [])
96
95
}
97
96
98
97
98
+ /**
99
+ * Updates the attributes of multiple existing API keys.
100
+ *
101
+ * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-update-api-keys.html
102
+ *
103
+ * @param array{
104
+ * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
105
+ * human: boolean, // Return human readable values for statistics. (DEFAULT: true)
106
+ * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
107
+ * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
108
+ * filter_path: list, // A comma-separated list of filters used to reduce the response.
109
+ * body: array, // (REQUIRED) The API key request to update the attributes of multiple API keys.
110
+ * } $params
111
+ *
112
+ * @throws NoNodeAvailableException if all the hosts are offline
113
+ * @throws ClientResponseException if the status code of response is 4xx
114
+ * @throws ServerResponseException if the status code of response is 5xx
115
+ *
116
+ * @return Elasticsearch|Promise
117
+ */
118
+ public function bulkUpdateApiKeys (array $ params = [])
119
+ {
120
+ $ this ->checkRequiredParameters (['body ' ], $ params );
121
+ $ url = '/_security/api_key/_bulk_update ' ;
122
+ $ method = 'POST ' ;
123
+
124
+ $ url = $ this ->addQueryString ($ url , $ params , ['pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
125
+ $ headers = [
126
+ 'Accept ' => 'application/json ' ,
127
+ 'Content-Type ' => 'application/json ' ,
128
+ ];
129
+ return $ this ->client ->sendRequest ($ this ->createRequest ($ method , $ url , $ headers , $ params ['body ' ] ?? null ));
130
+ }
131
+
132
+
99
133
/**
100
134
* Changes the passwords of users in the native realm and built-in users.
101
135
*
@@ -616,7 +650,6 @@ public function disableUser(array $params = [])
616
650
* Disables a user profile so it's not visible in user profile searches.
617
651
*
618
652
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-disable-user-profile.html
619
- * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
620
653
*
621
654
* @param array{
622
655
* uid: string, // (REQUIRED) Unique identifier for the user profile
@@ -689,7 +722,6 @@ public function enableUser(array $params = [])
689
722
* Enables a user profile so it's visible in user profile searches.
690
723
*
691
724
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-enable-user-profile.html
692
- * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
693
725
*
694
726
* @param array{
695
727
* uid: string, // (REQUIRED) An unique identifier of the user profile
@@ -799,6 +831,7 @@ public function enrollNode(array $params = [])
799
831
* username: string, // user name of the user who created this API key to be retrieved
800
832
* realm_name: string, // realm name of the user who created this API key to be retrieved
801
833
* owner: boolean, // flag to query API keys owned by the currently authenticated user
834
+ * with_limited_by: boolean, // flag to show the limited-by role descriptors of API Keys
802
835
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
803
836
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
804
837
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -817,7 +850,7 @@ public function getApiKey(array $params = [])
817
850
$ url = '/_security/api_key ' ;
818
851
$ method = 'GET ' ;
819
852
820
- $ url = $ this ->addQueryString ($ url , $ params , ['id ' ,'name ' ,'username ' ,'realm_name ' ,'owner ' ,'pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
853
+ $ url = $ this ->addQueryString ($ url , $ params , ['id ' ,'name ' ,'username ' ,'realm_name ' ,'owner ' ,'with_limited_by ' , ' pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
821
854
$ headers = [
822
855
'Accept ' => 'application/json ' ,
823
856
];
@@ -1091,6 +1124,7 @@ public function getToken(array $params = [])
1091
1124
*
1092
1125
* @param array{
1093
1126
* username: list, // A comma-separated list of usernames
1127
+ * with_profile_uid: boolean, // flag to retrieve profile uid (if exists) associated to the user
1094
1128
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1095
1129
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1096
1130
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -1113,7 +1147,7 @@ public function getUser(array $params = [])
1113
1147
$ url = '/_security/user ' ;
1114
1148
$ method = 'GET ' ;
1115
1149
}
1116
- $ url = $ this ->addQueryString ($ url , $ params , ['pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
1150
+ $ url = $ this ->addQueryString ($ url , $ params , ['with_profile_uid ' , ' pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
1117
1151
$ headers = [
1118
1152
'Accept ' => 'application/json ' ,
1119
1153
];
@@ -1154,13 +1188,12 @@ public function getUserPrivileges(array $params = [])
1154
1188
1155
1189
1156
1190
/**
1157
- * Retrieves user profile for the given unique ID.
1191
+ * Retrieves user profiles for the given unique ID(s) .
1158
1192
*
1159
1193
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-profile.html
1160
- * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
1161
1194
*
1162
1195
* @param array{
1163
- * uid: string , // (REQUIRED) An unique identifier of the user profile
1196
+ * uid: list , // (REQUIRED) A comma-separated list of unique identifier for user profiles
1164
1197
* data: list, // A comma-separated list of keys for which the corresponding application data are retrieved.
1165
1198
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1166
1199
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
@@ -1270,7 +1303,6 @@ public function hasPrivileges(array $params = [])
1270
1303
* Determines whether the users associated with the specified profile IDs have all the requested privileges.
1271
1304
*
1272
1305
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges-user-profile.html
1273
- * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
1274
1306
*
1275
1307
* @param array{
1276
1308
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
@@ -1633,6 +1665,7 @@ public function putUser(array $params = [])
1633
1665
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html
1634
1666
*
1635
1667
* @param array{
1668
+ * with_limited_by: boolean, // flag to show the limited-by role descriptors of API Keys
1636
1669
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1637
1670
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1638
1671
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -1652,7 +1685,7 @@ public function queryApiKeys(array $params = [])
1652
1685
$ url = '/_security/_query/api_key ' ;
1653
1686
$ method = empty ($ params ['body ' ]) ? 'GET ' : 'POST ' ;
1654
1687
1655
- $ url = $ this ->addQueryString ($ url , $ params , ['pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
1688
+ $ url = $ this ->addQueryString ($ url , $ params , ['with_limited_by ' , ' pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
1656
1689
$ headers = [
1657
1690
'Accept ' => 'application/json ' ,
1658
1691
'Content-Type ' => 'application/json ' ,
@@ -1876,7 +1909,6 @@ public function samlServiceProviderMetadata(array $params = [])
1876
1909
* Get suggestions for user profiles that match specified search criteria.
1877
1910
*
1878
1911
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-suggest-user-profile.html
1879
- * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
1880
1912
*
1881
1913
* @param array{
1882
1914
* data: list, // A comma-separated list of keys for which the corresponding application data are retrieved.
@@ -1949,7 +1981,6 @@ public function updateApiKey(array $params = [])
1949
1981
* Update application specific data for the user profile of the given unique ID.
1950
1982
*
1951
1983
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-user-profile-data.html
1952
- * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
1953
1984
*
1954
1985
* @param array{
1955
1986
* uid: string, // (REQUIRED) An unique identifier of the user profile
0 commit comments