elasticsearch 8.16.0__py3-none-any.whl → 8.17.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- elasticsearch/_async/client/__init__.py +234 -96
- elasticsearch/_async/client/async_search.py +12 -22
- elasticsearch/_async/client/autoscaling.py +39 -4
- elasticsearch/_async/client/cat.py +90 -221
- elasticsearch/_async/client/ccr.py +85 -35
- elasticsearch/_async/client/cluster.py +160 -68
- elasticsearch/_async/client/connector.py +362 -25
- elasticsearch/_async/client/dangling_indices.py +3 -3
- elasticsearch/_async/client/enrich.py +6 -6
- elasticsearch/_async/client/eql.py +13 -11
- elasticsearch/_async/client/esql.py +3 -2
- elasticsearch/_async/client/features.py +27 -5
- elasticsearch/_async/client/fleet.py +1 -1
- elasticsearch/_async/client/graph.py +9 -3
- elasticsearch/_async/client/ilm.py +74 -39
- elasticsearch/_async/client/indices.py +633 -152
- elasticsearch/_async/client/inference.py +99 -16
- elasticsearch/_async/client/ingest.py +201 -23
- elasticsearch/_async/client/license.py +38 -22
- elasticsearch/_async/client/logstash.py +12 -9
- elasticsearch/_async/client/migration.py +17 -8
- elasticsearch/_async/client/ml.py +137 -79
- elasticsearch/_async/client/monitoring.py +3 -2
- elasticsearch/_async/client/nodes.py +37 -23
- elasticsearch/_async/client/query_rules.py +47 -25
- elasticsearch/_async/client/rollup.py +96 -21
- elasticsearch/_async/client/search_application.py +138 -9
- elasticsearch/_async/client/searchable_snapshots.py +33 -24
- elasticsearch/_async/client/security.py +751 -123
- elasticsearch/_async/client/shutdown.py +38 -15
- elasticsearch/_async/client/simulate.py +151 -0
- elasticsearch/_async/client/slm.py +147 -28
- elasticsearch/_async/client/snapshot.py +309 -25
- elasticsearch/_async/client/sql.py +79 -58
- elasticsearch/_async/client/ssl.py +1 -1
- elasticsearch/_async/client/synonyms.py +52 -29
- elasticsearch/_async/client/tasks.py +71 -31
- elasticsearch/_async/client/text_structure.py +468 -48
- elasticsearch/_async/client/transform.py +21 -14
- elasticsearch/_async/client/watcher.py +226 -60
- elasticsearch/_async/client/xpack.py +13 -8
- elasticsearch/_sync/client/__init__.py +234 -96
- elasticsearch/_sync/client/async_search.py +12 -22
- elasticsearch/_sync/client/autoscaling.py +39 -4
- elasticsearch/_sync/client/cat.py +90 -221
- elasticsearch/_sync/client/ccr.py +85 -35
- elasticsearch/_sync/client/cluster.py +160 -68
- elasticsearch/_sync/client/connector.py +362 -25
- elasticsearch/_sync/client/dangling_indices.py +3 -3
- elasticsearch/_sync/client/enrich.py +6 -6
- elasticsearch/_sync/client/eql.py +13 -11
- elasticsearch/_sync/client/esql.py +3 -2
- elasticsearch/_sync/client/features.py +27 -5
- elasticsearch/_sync/client/fleet.py +1 -1
- elasticsearch/_sync/client/graph.py +9 -3
- elasticsearch/_sync/client/ilm.py +74 -39
- elasticsearch/_sync/client/indices.py +633 -152
- elasticsearch/_sync/client/inference.py +99 -16
- elasticsearch/_sync/client/ingest.py +201 -23
- elasticsearch/_sync/client/license.py +38 -22
- elasticsearch/_sync/client/logstash.py +12 -9
- elasticsearch/_sync/client/migration.py +17 -8
- elasticsearch/_sync/client/ml.py +137 -79
- elasticsearch/_sync/client/monitoring.py +3 -2
- elasticsearch/_sync/client/nodes.py +37 -23
- elasticsearch/_sync/client/query_rules.py +47 -25
- elasticsearch/_sync/client/rollup.py +96 -21
- elasticsearch/_sync/client/search_application.py +138 -9
- elasticsearch/_sync/client/searchable_snapshots.py +33 -24
- elasticsearch/_sync/client/security.py +751 -123
- elasticsearch/_sync/client/shutdown.py +38 -15
- elasticsearch/_sync/client/simulate.py +151 -0
- elasticsearch/_sync/client/slm.py +147 -28
- elasticsearch/_sync/client/snapshot.py +309 -25
- elasticsearch/_sync/client/sql.py +79 -58
- elasticsearch/_sync/client/ssl.py +1 -1
- elasticsearch/_sync/client/synonyms.py +52 -29
- elasticsearch/_sync/client/tasks.py +71 -31
- elasticsearch/_sync/client/text_structure.py +468 -48
- elasticsearch/_sync/client/transform.py +21 -14
- elasticsearch/_sync/client/watcher.py +226 -60
- elasticsearch/_sync/client/xpack.py +13 -8
- elasticsearch/_version.py +1 -1
- elasticsearch/client.py +2 -0
- {elasticsearch-8.16.0.dist-info → elasticsearch-8.17.1.dist-info}/METADATA +6 -4
- elasticsearch-8.17.1.dist-info/RECORD +119 -0
- {elasticsearch-8.16.0.dist-info → elasticsearch-8.17.1.dist-info}/WHEEL +1 -1
- elasticsearch-8.16.0.dist-info/RECORD +0 -117
- {elasticsearch-8.16.0.dist-info → elasticsearch-8.17.1.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.16.0.dist-info → elasticsearch-8.17.1.dist-info}/licenses/NOTICE +0 -0
|
@@ -45,14 +45,33 @@ class SecurityClient(NamespacedClient):
|
|
|
45
45
|
) -> ObjectApiResponse[t.Any]:
|
|
46
46
|
"""
|
|
47
47
|
Activate a user profile. Create or update a user profile on behalf of another
|
|
48
|
-
user.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
user. NOTE: The user profile feature is designed only for use by Kibana and Elastic's
|
|
49
|
+
Observability, Enterprise Search, and Elastic Security solutions. Individual
|
|
50
|
+
users and external applications should not call this API directly. The calling
|
|
51
|
+
application must have either an `access_token` or a combination of `username`
|
|
52
|
+
and `password` for the user that the profile document is intended for. Elastic
|
|
53
|
+
reserves the right to change or remove this feature in future releases without
|
|
54
|
+
prior notice. This API creates or updates a profile document for end users with
|
|
55
|
+
information that is extracted from the user's authentication object including
|
|
56
|
+
`username`, `full_name,` `roles`, and the authentication realm. For example,
|
|
57
|
+
in the JWT `access_token` case, the profile user's `username` is extracted from
|
|
58
|
+
the JWT token claim pointed to by the `claims.principal` setting of the JWT realm
|
|
59
|
+
that authenticated the token. When updating a profile document, the API enables
|
|
60
|
+
the document if it was disabled. Any updates do not change existing content for
|
|
61
|
+
either the `labels` or `data` fields.
|
|
62
|
+
|
|
63
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-activate-user-profile.html>`_
|
|
64
|
+
|
|
65
|
+
:param grant_type: The type of grant.
|
|
66
|
+
:param access_token: The user's Elasticsearch access token or JWT. Both `access`
|
|
67
|
+
and `id` JWT token types are supported and they depend on the underlying
|
|
68
|
+
JWT realm configuration. If you specify the `access_token` grant type, this
|
|
69
|
+
parameter is required. It is not valid with other grant types.
|
|
70
|
+
:param password: The user's password. If you specify the `password` grant type,
|
|
71
|
+
this parameter is required. It is not valid with other grant types.
|
|
72
|
+
:param username: The username that identifies the user. If you specify the `password`
|
|
73
|
+
grant type, this parameter is required. It is not valid with other grant
|
|
74
|
+
types.
|
|
56
75
|
"""
|
|
57
76
|
if grant_type is None and body is None:
|
|
58
77
|
raise ValueError("Empty value passed for parameter 'grant_type'")
|
|
@@ -105,7 +124,7 @@ class SecurityClient(NamespacedClient):
|
|
|
105
124
|
and information about the realms that authenticated and authorized the user.
|
|
106
125
|
If the user cannot be authenticated, this API returns a 401 status code.
|
|
107
126
|
|
|
108
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
127
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-authenticate.html>`_
|
|
109
128
|
"""
|
|
110
129
|
__path_parts: t.Dict[str, str] = {}
|
|
111
130
|
__path = "/_security/_authenticate"
|
|
@@ -149,7 +168,7 @@ class SecurityClient(NamespacedClient):
|
|
|
149
168
|
manage roles, rather than using file-based role management. The bulk delete roles
|
|
150
169
|
API cannot delete roles that are defined in roles files.
|
|
151
170
|
|
|
152
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
171
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-bulk-delete-role.html>`_
|
|
153
172
|
|
|
154
173
|
:param names: An array of role names to delete
|
|
155
174
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -207,7 +226,7 @@ class SecurityClient(NamespacedClient):
|
|
|
207
226
|
way to manage roles, rather than using file-based role management. The bulk create
|
|
208
227
|
or update roles API cannot update roles that are defined in roles files.
|
|
209
228
|
|
|
210
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
229
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-bulk-put-role.html>`_
|
|
211
230
|
|
|
212
231
|
:param roles: A dictionary of role name to RoleDescriptor objects to add or update
|
|
213
232
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -244,6 +263,94 @@ class SecurityClient(NamespacedClient):
|
|
|
244
263
|
path_parts=__path_parts,
|
|
245
264
|
)
|
|
246
265
|
|
|
266
|
+
@_rewrite_parameters(
|
|
267
|
+
body_fields=("ids", "expiration", "metadata", "role_descriptors"),
|
|
268
|
+
)
|
|
269
|
+
def bulk_update_api_keys(
|
|
270
|
+
self,
|
|
271
|
+
*,
|
|
272
|
+
ids: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
273
|
+
error_trace: t.Optional[bool] = None,
|
|
274
|
+
expiration: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
275
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
276
|
+
human: t.Optional[bool] = None,
|
|
277
|
+
metadata: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
278
|
+
pretty: t.Optional[bool] = None,
|
|
279
|
+
role_descriptors: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
|
|
280
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
281
|
+
) -> ObjectApiResponse[t.Any]:
|
|
282
|
+
"""
|
|
283
|
+
Bulk update API keys. Update the attributes for multiple API keys. IMPORTANT:
|
|
284
|
+
It is not possible to use an API key as the authentication credential for this
|
|
285
|
+
API. To update API keys, the owner user's credentials are required. This API
|
|
286
|
+
is similar to the update API key API but enables you to apply the same update
|
|
287
|
+
to multiple API keys in one API call. This operation can greatly improve performance
|
|
288
|
+
over making individual updates. It is not possible to update expired or invalidated
|
|
289
|
+
API keys. This API supports updates to API key access scope, metadata and expiration.
|
|
290
|
+
The access scope of each API key is derived from the `role_descriptors` you specify
|
|
291
|
+
in the request and a snapshot of the owner user's permissions at the time of
|
|
292
|
+
the request. The snapshot of the owner's permissions is updated automatically
|
|
293
|
+
on every call. IMPORTANT: If you don't specify `role_descriptors` in the request,
|
|
294
|
+
a call to this API might still change an API key's access scope. This change
|
|
295
|
+
can occur if the owner user's permissions have changed since the API key was
|
|
296
|
+
created or last modified. A successful request returns a JSON structure that
|
|
297
|
+
contains the IDs of all updated API keys, the IDs of API keys that already had
|
|
298
|
+
the requested changes and did not require an update, and error details for any
|
|
299
|
+
failed update.
|
|
300
|
+
|
|
301
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-bulk-update-api-keys.html>`_
|
|
302
|
+
|
|
303
|
+
:param ids: The API key identifiers.
|
|
304
|
+
:param expiration: Expiration time for the API keys. By default, API keys never
|
|
305
|
+
expire. This property can be omitted to leave the value unchanged.
|
|
306
|
+
:param metadata: Arbitrary nested metadata to associate with the API keys. Within
|
|
307
|
+
the `metadata` object, top-level keys beginning with an underscore (`_`)
|
|
308
|
+
are reserved for system usage. Any information specified with this parameter
|
|
309
|
+
fully replaces metadata previously associated with the API key.
|
|
310
|
+
:param role_descriptors: The role descriptors to assign to the API keys. An API
|
|
311
|
+
key's effective permissions are an intersection of its assigned privileges
|
|
312
|
+
and the point-in-time snapshot of permissions of the owner user. You can
|
|
313
|
+
assign new privileges by specifying them in this parameter. To remove assigned
|
|
314
|
+
privileges, supply the `role_descriptors` parameter as an empty object `{}`.
|
|
315
|
+
If an API key has no assigned privileges, it inherits the owner user's full
|
|
316
|
+
permissions. The snapshot of the owner's permissions is always updated, whether
|
|
317
|
+
you supply the `role_descriptors` parameter. The structure of a role descriptor
|
|
318
|
+
is the same as the request for the create API keys API.
|
|
319
|
+
"""
|
|
320
|
+
if ids is None and body is None:
|
|
321
|
+
raise ValueError("Empty value passed for parameter 'ids'")
|
|
322
|
+
__path_parts: t.Dict[str, str] = {}
|
|
323
|
+
__path = "/_security/api_key/_bulk_update"
|
|
324
|
+
__query: t.Dict[str, t.Any] = {}
|
|
325
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
326
|
+
if error_trace is not None:
|
|
327
|
+
__query["error_trace"] = error_trace
|
|
328
|
+
if filter_path is not None:
|
|
329
|
+
__query["filter_path"] = filter_path
|
|
330
|
+
if human is not None:
|
|
331
|
+
__query["human"] = human
|
|
332
|
+
if pretty is not None:
|
|
333
|
+
__query["pretty"] = pretty
|
|
334
|
+
if not __body:
|
|
335
|
+
if ids is not None:
|
|
336
|
+
__body["ids"] = ids
|
|
337
|
+
if expiration is not None:
|
|
338
|
+
__body["expiration"] = expiration
|
|
339
|
+
if metadata is not None:
|
|
340
|
+
__body["metadata"] = metadata
|
|
341
|
+
if role_descriptors is not None:
|
|
342
|
+
__body["role_descriptors"] = role_descriptors
|
|
343
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
344
|
+
return self.perform_request( # type: ignore[return-value]
|
|
345
|
+
"POST",
|
|
346
|
+
__path,
|
|
347
|
+
params=__query,
|
|
348
|
+
headers=__headers,
|
|
349
|
+
body=__body,
|
|
350
|
+
endpoint_id="security.bulk_update_api_keys",
|
|
351
|
+
path_parts=__path_parts,
|
|
352
|
+
)
|
|
353
|
+
|
|
247
354
|
@_rewrite_parameters(
|
|
248
355
|
body_fields=("password", "password_hash"),
|
|
249
356
|
)
|
|
@@ -266,7 +373,7 @@ class SecurityClient(NamespacedClient):
|
|
|
266
373
|
Change passwords. Change the passwords of users in the native realm and built-in
|
|
267
374
|
users.
|
|
268
375
|
|
|
269
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
376
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-change-password.html>`_
|
|
270
377
|
|
|
271
378
|
:param username: The user whose password you want to change. If you do not specify
|
|
272
379
|
this parameter, the password is changed for the current user.
|
|
@@ -329,7 +436,7 @@ class SecurityClient(NamespacedClient):
|
|
|
329
436
|
Clear the API key cache. Evict a subset of all entries from the API key cache.
|
|
330
437
|
The cache is also automatically cleared on state changes of the security index.
|
|
331
438
|
|
|
332
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
439
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-clear-api-key-cache.html>`_
|
|
333
440
|
|
|
334
441
|
:param ids: Comma-separated list of API key IDs to evict from the API key cache.
|
|
335
442
|
To evict all API keys, use `*`. Does not support other wildcard patterns.
|
|
@@ -372,7 +479,7 @@ class SecurityClient(NamespacedClient):
|
|
|
372
479
|
cache. The cache is also automatically cleared for applications that have their
|
|
373
480
|
privileges updated.
|
|
374
481
|
|
|
375
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
482
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-clear-privilege-cache.html>`_
|
|
376
483
|
|
|
377
484
|
:param application: A comma-separated list of application names
|
|
378
485
|
"""
|
|
@@ -414,7 +521,7 @@ class SecurityClient(NamespacedClient):
|
|
|
414
521
|
Clear the user cache. Evict users from the user cache. You can completely clear
|
|
415
522
|
the cache or evict specific users.
|
|
416
523
|
|
|
417
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
524
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-clear-cache.html>`_
|
|
418
525
|
|
|
419
526
|
:param realms: Comma-separated list of realms to clear
|
|
420
527
|
:param usernames: Comma-separated list of usernames to clear from the cache
|
|
@@ -457,7 +564,7 @@ class SecurityClient(NamespacedClient):
|
|
|
457
564
|
"""
|
|
458
565
|
Clear the roles cache. Evict roles from the native role cache.
|
|
459
566
|
|
|
460
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
567
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-clear-role-cache.html>`_
|
|
461
568
|
|
|
462
569
|
:param name: Role name
|
|
463
570
|
"""
|
|
@@ -500,7 +607,7 @@ class SecurityClient(NamespacedClient):
|
|
|
500
607
|
Clear service account token caches. Evict a subset of all entries from the service
|
|
501
608
|
account token caches.
|
|
502
609
|
|
|
503
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
610
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-clear-service-token-caches.html>`_
|
|
504
611
|
|
|
505
612
|
:param namespace: An identifier for the namespace
|
|
506
613
|
:param service: An identifier for the service name
|
|
@@ -563,7 +670,7 @@ class SecurityClient(NamespacedClient):
|
|
|
563
670
|
for the API key in milliseconds. NOTE: By default, API keys never expire. You
|
|
564
671
|
can specify expiration information when you create the API keys.
|
|
565
672
|
|
|
566
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
673
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-create-api-key.html>`_
|
|
567
674
|
|
|
568
675
|
:param expiration: Expiration time for the API key. By default, API keys never
|
|
569
676
|
expire.
|
|
@@ -650,7 +757,7 @@ class SecurityClient(NamespacedClient):
|
|
|
650
757
|
API key API. Attempting to update them with the update REST API key API or the
|
|
651
758
|
bulk update REST API keys API will result in an error.
|
|
652
759
|
|
|
653
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
760
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-create-cross-cluster-api-key.html>`_
|
|
654
761
|
|
|
655
762
|
:param access: The access to be granted to this API key. The access is composed
|
|
656
763
|
of permissions for cross-cluster search and cross-cluster replication. At
|
|
@@ -720,7 +827,7 @@ class SecurityClient(NamespacedClient):
|
|
|
720
827
|
Create a service account token. Create a service accounts token for access without
|
|
721
828
|
requiring basic authentication.
|
|
722
829
|
|
|
723
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
830
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-create-service-token.html>`_
|
|
724
831
|
|
|
725
832
|
:param namespace: An identifier for the namespace
|
|
726
833
|
:param service: An identifier for the service name
|
|
@@ -773,6 +880,74 @@ class SecurityClient(NamespacedClient):
|
|
|
773
880
|
path_parts=__path_parts,
|
|
774
881
|
)
|
|
775
882
|
|
|
883
|
+
@_rewrite_parameters(
|
|
884
|
+
body_fields=("x509_certificate_chain",),
|
|
885
|
+
)
|
|
886
|
+
def delegate_pki(
|
|
887
|
+
self,
|
|
888
|
+
*,
|
|
889
|
+
x509_certificate_chain: t.Optional[t.Sequence[str]] = None,
|
|
890
|
+
error_trace: t.Optional[bool] = None,
|
|
891
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
892
|
+
human: t.Optional[bool] = None,
|
|
893
|
+
pretty: t.Optional[bool] = None,
|
|
894
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
895
|
+
) -> ObjectApiResponse[t.Any]:
|
|
896
|
+
"""
|
|
897
|
+
Delegate PKI authentication. This API implements the exchange of an X509Certificate
|
|
898
|
+
chain for an Elasticsearch access token. The certificate chain is validated,
|
|
899
|
+
according to RFC 5280, by sequentially considering the trust configuration of
|
|
900
|
+
every installed PKI realm that has `delegation.enabled` set to `true`. A successfully
|
|
901
|
+
trusted client certificate is also subject to the validation of the subject distinguished
|
|
902
|
+
name according to thw `username_pattern` of the respective realm. This API is
|
|
903
|
+
called by smart and trusted proxies, such as Kibana, which terminate the user's
|
|
904
|
+
TLS session but still want to authenticate the user by using a PKI realm—-as
|
|
905
|
+
if the user connected directly to Elasticsearch. IMPORTANT: The association between
|
|
906
|
+
the subject public key in the target certificate and the corresponding private
|
|
907
|
+
key is not validated. This is part of the TLS authentication process and it is
|
|
908
|
+
delegated to the proxy that calls this API. The proxy is trusted to have performed
|
|
909
|
+
the TLS authentication and this API translates that authentication into an Elasticsearch
|
|
910
|
+
access token.
|
|
911
|
+
|
|
912
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-delegate-pki-authentication.html>`_
|
|
913
|
+
|
|
914
|
+
:param x509_certificate_chain: The X509Certificate chain, which is represented
|
|
915
|
+
as an ordered string array. Each string in the array is a base64-encoded
|
|
916
|
+
(Section 4 of RFC4648 - not base64url-encoded) of the certificate's DER encoding.
|
|
917
|
+
The first element is the target certificate that contains the subject distinguished
|
|
918
|
+
name that is requesting access. This may be followed by additional certificates;
|
|
919
|
+
each subsequent certificate is used to certify the previous one.
|
|
920
|
+
"""
|
|
921
|
+
if x509_certificate_chain is None and body is None:
|
|
922
|
+
raise ValueError(
|
|
923
|
+
"Empty value passed for parameter 'x509_certificate_chain'"
|
|
924
|
+
)
|
|
925
|
+
__path_parts: t.Dict[str, str] = {}
|
|
926
|
+
__path = "/_security/delegate_pki"
|
|
927
|
+
__query: t.Dict[str, t.Any] = {}
|
|
928
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
929
|
+
if error_trace is not None:
|
|
930
|
+
__query["error_trace"] = error_trace
|
|
931
|
+
if filter_path is not None:
|
|
932
|
+
__query["filter_path"] = filter_path
|
|
933
|
+
if human is not None:
|
|
934
|
+
__query["human"] = human
|
|
935
|
+
if pretty is not None:
|
|
936
|
+
__query["pretty"] = pretty
|
|
937
|
+
if not __body:
|
|
938
|
+
if x509_certificate_chain is not None:
|
|
939
|
+
__body["x509_certificate_chain"] = x509_certificate_chain
|
|
940
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
941
|
+
return self.perform_request( # type: ignore[return-value]
|
|
942
|
+
"POST",
|
|
943
|
+
__path,
|
|
944
|
+
params=__query,
|
|
945
|
+
headers=__headers,
|
|
946
|
+
body=__body,
|
|
947
|
+
endpoint_id="security.delegate_pki",
|
|
948
|
+
path_parts=__path_parts,
|
|
949
|
+
)
|
|
950
|
+
|
|
776
951
|
@_rewrite_parameters()
|
|
777
952
|
def delete_privileges(
|
|
778
953
|
self,
|
|
@@ -790,7 +965,7 @@ class SecurityClient(NamespacedClient):
|
|
|
790
965
|
"""
|
|
791
966
|
Delete application privileges.
|
|
792
967
|
|
|
793
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
968
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-delete-privilege.html>`_
|
|
794
969
|
|
|
795
970
|
:param application: Application name
|
|
796
971
|
:param name: Privilege name
|
|
@@ -846,7 +1021,7 @@ class SecurityClient(NamespacedClient):
|
|
|
846
1021
|
"""
|
|
847
1022
|
Delete roles. Delete roles in the native realm.
|
|
848
1023
|
|
|
849
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1024
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-delete-role.html>`_
|
|
850
1025
|
|
|
851
1026
|
:param name: Role name
|
|
852
1027
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -894,7 +1069,7 @@ class SecurityClient(NamespacedClient):
|
|
|
894
1069
|
"""
|
|
895
1070
|
Delete role mappings.
|
|
896
1071
|
|
|
897
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1072
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-delete-role-mapping.html>`_
|
|
898
1073
|
|
|
899
1074
|
:param name: Role-mapping name
|
|
900
1075
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -945,7 +1120,7 @@ class SecurityClient(NamespacedClient):
|
|
|
945
1120
|
Delete service account tokens. Delete service account tokens for a service in
|
|
946
1121
|
a specified namespace.
|
|
947
1122
|
|
|
948
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1123
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-delete-service-token.html>`_
|
|
949
1124
|
|
|
950
1125
|
:param namespace: An identifier for the namespace
|
|
951
1126
|
:param service: An identifier for the service name
|
|
@@ -1003,7 +1178,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1003
1178
|
"""
|
|
1004
1179
|
Delete users. Delete users from the native realm.
|
|
1005
1180
|
|
|
1006
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1181
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-delete-user.html>`_
|
|
1007
1182
|
|
|
1008
1183
|
:param username: username
|
|
1009
1184
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -1051,7 +1226,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1051
1226
|
"""
|
|
1052
1227
|
Disable users. Disable users in the native realm.
|
|
1053
1228
|
|
|
1054
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1229
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-disable-user.html>`_
|
|
1055
1230
|
|
|
1056
1231
|
:param username: The username of the user to disable
|
|
1057
1232
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -1098,14 +1273,21 @@ class SecurityClient(NamespacedClient):
|
|
|
1098
1273
|
) -> ObjectApiResponse[t.Any]:
|
|
1099
1274
|
"""
|
|
1100
1275
|
Disable a user profile. Disable user profiles so that they are not visible in
|
|
1101
|
-
user profile searches.
|
|
1276
|
+
user profile searches. NOTE: The user profile feature is designed only for use
|
|
1277
|
+
by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security
|
|
1278
|
+
solutions. Individual users and external applications should not call this API
|
|
1279
|
+
directly. Elastic reserves the right to change or remove this feature in future
|
|
1280
|
+
releases without prior notice. When you activate a user profile, its automatically
|
|
1281
|
+
enabled and visible in user profile searches. You can use the disable user profile
|
|
1282
|
+
API to disable a user profile so it’s not visible in these searches. To re-enable
|
|
1283
|
+
a disabled user profile, use the enable user profile API .
|
|
1102
1284
|
|
|
1103
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1285
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-disable-user-profile.html>`_
|
|
1104
1286
|
|
|
1105
1287
|
:param uid: Unique identifier for the user profile.
|
|
1106
1288
|
:param refresh: If 'true', Elasticsearch refreshes the affected shards to make
|
|
1107
|
-
this operation visible to search
|
|
1108
|
-
make this operation visible to search
|
|
1289
|
+
this operation visible to search. If 'wait_for', it waits for a refresh to
|
|
1290
|
+
make this operation visible to search. If 'false', it does nothing with refreshes.
|
|
1109
1291
|
"""
|
|
1110
1292
|
if uid in SKIP_IN_PATH:
|
|
1111
1293
|
raise ValueError("Empty value passed for parameter 'uid'")
|
|
@@ -1148,7 +1330,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1148
1330
|
"""
|
|
1149
1331
|
Enable users. Enable users in the native realm.
|
|
1150
1332
|
|
|
1151
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1333
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-enable-user.html>`_
|
|
1152
1334
|
|
|
1153
1335
|
:param username: The username of the user to enable
|
|
1154
1336
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -1195,14 +1377,20 @@ class SecurityClient(NamespacedClient):
|
|
|
1195
1377
|
) -> ObjectApiResponse[t.Any]:
|
|
1196
1378
|
"""
|
|
1197
1379
|
Enable a user profile. Enable user profiles to make them visible in user profile
|
|
1198
|
-
searches.
|
|
1380
|
+
searches. NOTE: The user profile feature is designed only for use by Kibana and
|
|
1381
|
+
Elastic's Observability, Enterprise Search, and Elastic Security solutions. Individual
|
|
1382
|
+
users and external applications should not call this API directly. Elastic reserves
|
|
1383
|
+
the right to change or remove this feature in future releases without prior notice.
|
|
1384
|
+
When you activate a user profile, it's automatically enabled and visible in user
|
|
1385
|
+
profile searches. If you later disable the user profile, you can use the enable
|
|
1386
|
+
user profile API to make the profile visible in these searches again.
|
|
1199
1387
|
|
|
1200
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1388
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-enable-user-profile.html>`_
|
|
1201
1389
|
|
|
1202
|
-
:param uid:
|
|
1390
|
+
:param uid: A unique identifier for the user profile.
|
|
1203
1391
|
:param refresh: If 'true', Elasticsearch refreshes the affected shards to make
|
|
1204
|
-
this operation visible to search
|
|
1205
|
-
make this operation visible to search
|
|
1392
|
+
this operation visible to search. If 'wait_for', it waits for a refresh to
|
|
1393
|
+
make this operation visible to search. If 'false', nothing is done with refreshes.
|
|
1206
1394
|
"""
|
|
1207
1395
|
if uid in SKIP_IN_PATH:
|
|
1208
1396
|
raise ValueError("Empty value passed for parameter 'uid'")
|
|
@@ -1242,7 +1430,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1242
1430
|
Enroll Kibana. Enable a Kibana instance to configure itself for communication
|
|
1243
1431
|
with a secured Elasticsearch cluster.
|
|
1244
1432
|
|
|
1245
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1433
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-kibana-enrollment.html>`_
|
|
1246
1434
|
"""
|
|
1247
1435
|
__path_parts: t.Dict[str, str] = {}
|
|
1248
1436
|
__path = "/_security/enroll/kibana"
|
|
@@ -1278,7 +1466,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1278
1466
|
Enroll a node. Enroll a new node to allow it to join an existing cluster with
|
|
1279
1467
|
security features enabled.
|
|
1280
1468
|
|
|
1281
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1469
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-node-enrollment.html>`_
|
|
1282
1470
|
"""
|
|
1283
1471
|
__path_parts: t.Dict[str, str] = {}
|
|
1284
1472
|
__path = "/_security/enroll/node"
|
|
@@ -1325,7 +1513,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1325
1513
|
privileges (including `manage_security`), this API returns all API keys regardless
|
|
1326
1514
|
of ownership.
|
|
1327
1515
|
|
|
1328
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1516
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-api-key.html>`_
|
|
1329
1517
|
|
|
1330
1518
|
:param active_only: A boolean flag that can be used to query API keys that are
|
|
1331
1519
|
currently active. An API key is considered active if it is neither invalidated,
|
|
@@ -1400,7 +1588,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1400
1588
|
Get builtin privileges. Get the list of cluster privileges and index privileges
|
|
1401
1589
|
that are available in this version of Elasticsearch.
|
|
1402
1590
|
|
|
1403
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1591
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-builtin-privileges.html>`_
|
|
1404
1592
|
"""
|
|
1405
1593
|
__path_parts: t.Dict[str, str] = {}
|
|
1406
1594
|
__path = "/_security/privilege/_builtin"
|
|
@@ -1437,7 +1625,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1437
1625
|
"""
|
|
1438
1626
|
Get application privileges.
|
|
1439
1627
|
|
|
1440
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1628
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-privileges.html>`_
|
|
1441
1629
|
|
|
1442
1630
|
:param application: Application name
|
|
1443
1631
|
:param name: Privilege name
|
|
@@ -1486,7 +1674,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1486
1674
|
the preferred way to manage roles, rather than using file-based role management.
|
|
1487
1675
|
The get roles API cannot retrieve roles that are defined in roles files.
|
|
1488
1676
|
|
|
1489
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1677
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-role.html>`_
|
|
1490
1678
|
|
|
1491
1679
|
:param name: The name of the role. You can specify multiple roles as a comma-separated
|
|
1492
1680
|
list. If you do not specify this parameter, the API returns information about
|
|
@@ -1534,7 +1722,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1534
1722
|
rather than using role mapping files. The get role mappings API cannot retrieve
|
|
1535
1723
|
role mappings that are defined in role mapping files.
|
|
1536
1724
|
|
|
1537
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1725
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-role-mapping.html>`_
|
|
1538
1726
|
|
|
1539
1727
|
:param name: The distinct name that identifies the role mapping. The name is
|
|
1540
1728
|
used solely as an identifier to facilitate interaction via the API; it does
|
|
@@ -1583,7 +1771,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1583
1771
|
Get service accounts. Get a list of service accounts that match the provided
|
|
1584
1772
|
path parameters.
|
|
1585
1773
|
|
|
1586
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1774
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-service-accounts.html>`_
|
|
1587
1775
|
|
|
1588
1776
|
:param namespace: Name of the namespace. Omit this parameter to retrieve information
|
|
1589
1777
|
about all service accounts. If you omit this parameter, you must also omit
|
|
@@ -1634,7 +1822,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1634
1822
|
"""
|
|
1635
1823
|
Get service account credentials.
|
|
1636
1824
|
|
|
1637
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1825
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-service-credentials.html>`_
|
|
1638
1826
|
|
|
1639
1827
|
:param namespace: Name of the namespace.
|
|
1640
1828
|
:param service: Name of the service name.
|
|
@@ -1667,6 +1855,49 @@ class SecurityClient(NamespacedClient):
|
|
|
1667
1855
|
path_parts=__path_parts,
|
|
1668
1856
|
)
|
|
1669
1857
|
|
|
1858
|
+
@_rewrite_parameters()
|
|
1859
|
+
def get_settings(
|
|
1860
|
+
self,
|
|
1861
|
+
*,
|
|
1862
|
+
error_trace: t.Optional[bool] = None,
|
|
1863
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
1864
|
+
human: t.Optional[bool] = None,
|
|
1865
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
1866
|
+
pretty: t.Optional[bool] = None,
|
|
1867
|
+
) -> ObjectApiResponse[t.Any]:
|
|
1868
|
+
"""
|
|
1869
|
+
Get security index settings. Get the user-configurable settings for the security
|
|
1870
|
+
internal index (`.security` and associated indices).
|
|
1871
|
+
|
|
1872
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-settings.html>`_
|
|
1873
|
+
|
|
1874
|
+
:param master_timeout: Period to wait for a connection to the master node. If
|
|
1875
|
+
no response is received before the timeout expires, the request fails and
|
|
1876
|
+
returns an error.
|
|
1877
|
+
"""
|
|
1878
|
+
__path_parts: t.Dict[str, str] = {}
|
|
1879
|
+
__path = "/_security/settings"
|
|
1880
|
+
__query: t.Dict[str, t.Any] = {}
|
|
1881
|
+
if error_trace is not None:
|
|
1882
|
+
__query["error_trace"] = error_trace
|
|
1883
|
+
if filter_path is not None:
|
|
1884
|
+
__query["filter_path"] = filter_path
|
|
1885
|
+
if human is not None:
|
|
1886
|
+
__query["human"] = human
|
|
1887
|
+
if master_timeout is not None:
|
|
1888
|
+
__query["master_timeout"] = master_timeout
|
|
1889
|
+
if pretty is not None:
|
|
1890
|
+
__query["pretty"] = pretty
|
|
1891
|
+
__headers = {"accept": "application/json"}
|
|
1892
|
+
return self.perform_request( # type: ignore[return-value]
|
|
1893
|
+
"GET",
|
|
1894
|
+
__path,
|
|
1895
|
+
params=__query,
|
|
1896
|
+
headers=__headers,
|
|
1897
|
+
endpoint_id="security.get_settings",
|
|
1898
|
+
path_parts=__path_parts,
|
|
1899
|
+
)
|
|
1900
|
+
|
|
1670
1901
|
@_rewrite_parameters(
|
|
1671
1902
|
body_fields=(
|
|
1672
1903
|
"grant_type",
|
|
@@ -1702,7 +1933,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1702
1933
|
"""
|
|
1703
1934
|
Get a token. Create a bearer token for access without requiring basic authentication.
|
|
1704
1935
|
|
|
1705
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1936
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-token.html>`_
|
|
1706
1937
|
|
|
1707
1938
|
:param grant_type:
|
|
1708
1939
|
:param kerberos_ticket:
|
|
@@ -1761,7 +1992,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1761
1992
|
"""
|
|
1762
1993
|
Get users. Get information about users in the native realm and built-in users.
|
|
1763
1994
|
|
|
1764
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1995
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-user.html>`_
|
|
1765
1996
|
|
|
1766
1997
|
:param username: An identifier for the user. You can specify multiple usernames
|
|
1767
1998
|
as a comma-separated list. If you omit this parameter, the API retrieves
|
|
@@ -1812,7 +2043,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1812
2043
|
"""
|
|
1813
2044
|
Get user privileges.
|
|
1814
2045
|
|
|
1815
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2046
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-user-privileges.html>`_
|
|
1816
2047
|
|
|
1817
2048
|
:param application: The name of the application. Application privileges are always
|
|
1818
2049
|
associated with exactly one application. If you do not specify this parameter,
|
|
@@ -1860,15 +2091,19 @@ class SecurityClient(NamespacedClient):
|
|
|
1860
2091
|
pretty: t.Optional[bool] = None,
|
|
1861
2092
|
) -> ObjectApiResponse[t.Any]:
|
|
1862
2093
|
"""
|
|
1863
|
-
Get a user profile. Get a user's profile using the unique profile ID.
|
|
2094
|
+
Get a user profile. Get a user's profile using the unique profile ID. NOTE: The
|
|
2095
|
+
user profile feature is designed only for use by Kibana and Elastic's Observability,
|
|
2096
|
+
Enterprise Search, and Elastic Security solutions. Individual users and external
|
|
2097
|
+
applications should not call this API directly. Elastic reserves the right to
|
|
2098
|
+
change or remove this feature in future releases without prior notice.
|
|
1864
2099
|
|
|
1865
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2100
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-user-profile.html>`_
|
|
1866
2101
|
|
|
1867
2102
|
:param uid: A unique identifier for the user profile.
|
|
1868
|
-
:param data:
|
|
1869
|
-
return all content use `data=*`. To return a subset of content
|
|
1870
|
-
to retrieve content nested under the specified `<key>`.
|
|
1871
|
-
no `data` content.
|
|
2103
|
+
:param data: A comma-separated list of filters for the `data` field of the profile
|
|
2104
|
+
document. To return all content use `data=*`. To return a subset of content
|
|
2105
|
+
use `data=<key>` to retrieve content nested under the specified `<key>`.
|
|
2106
|
+
By default returns no `data` content.
|
|
1872
2107
|
"""
|
|
1873
2108
|
if uid in SKIP_IN_PATH:
|
|
1874
2109
|
raise ValueError("Empty value passed for parameter 'uid'")
|
|
@@ -1940,7 +2175,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1940
2175
|
API keys never expire. You can specify expiration information when you create
|
|
1941
2176
|
the API keys.
|
|
1942
2177
|
|
|
1943
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2178
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-grant-api-key.html>`_
|
|
1944
2179
|
|
|
1945
2180
|
:param api_key: Defines the API key.
|
|
1946
2181
|
:param grant_type: The type of grant. Supported grant types are: `access_token`,
|
|
@@ -2052,6 +2287,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2052
2287
|
"monitor_ml",
|
|
2053
2288
|
"monitor_rollup",
|
|
2054
2289
|
"monitor_snapshot",
|
|
2290
|
+
"monitor_stats",
|
|
2055
2291
|
"monitor_text_structure",
|
|
2056
2292
|
"monitor_transform",
|
|
2057
2293
|
"monitor_watcher",
|
|
@@ -2081,7 +2317,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2081
2317
|
Check user privileges. Determine whether the specified user has a specified list
|
|
2082
2318
|
of privileges.
|
|
2083
2319
|
|
|
2084
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2320
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-has-privileges.html>`_
|
|
2085
2321
|
|
|
2086
2322
|
:param user: Username
|
|
2087
2323
|
:param application:
|
|
@@ -2139,11 +2375,15 @@ class SecurityClient(NamespacedClient):
|
|
|
2139
2375
|
) -> ObjectApiResponse[t.Any]:
|
|
2140
2376
|
"""
|
|
2141
2377
|
Check user profile privileges. Determine whether the users associated with the
|
|
2142
|
-
specified user profile IDs have all the requested privileges.
|
|
2378
|
+
specified user profile IDs have all the requested privileges. NOTE: The user
|
|
2379
|
+
profile feature is designed only for use by Kibana and Elastic's Observability,
|
|
2380
|
+
Enterprise Search, and Elastic Security solutions. Individual users and external
|
|
2381
|
+
applications should not call this API directly. Elastic reserves the right to
|
|
2382
|
+
change or remove this feature in future releases without prior notice.
|
|
2143
2383
|
|
|
2144
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2384
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-has-privileges-user-profile.html>`_
|
|
2145
2385
|
|
|
2146
|
-
:param privileges:
|
|
2386
|
+
:param privileges: An object containing all the privileges to be checked.
|
|
2147
2387
|
:param uids: A list of profile IDs. The privileges are checked for associated
|
|
2148
2388
|
users of the profiles.
|
|
2149
2389
|
"""
|
|
@@ -2210,7 +2450,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2210
2450
|
by an API key, that is to say an API key invalidates itself, specify its ID in
|
|
2211
2451
|
the `ids` field.
|
|
2212
2452
|
|
|
2213
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2453
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-invalidate-api-key.html>`_
|
|
2214
2454
|
|
|
2215
2455
|
:param id:
|
|
2216
2456
|
:param ids: A list of API key ids. This parameter cannot be used with any of
|
|
@@ -2286,7 +2526,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2286
2526
|
24 hours. They can also be used exactly once. If you want to invalidate one or
|
|
2287
2527
|
more access or refresh tokens immediately, use this invalidate token API.
|
|
2288
2528
|
|
|
2289
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2529
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-invalidate-token.html>`_
|
|
2290
2530
|
|
|
2291
2531
|
:param realm_name:
|
|
2292
2532
|
:param refresh_token:
|
|
@@ -2325,6 +2565,230 @@ class SecurityClient(NamespacedClient):
|
|
|
2325
2565
|
path_parts=__path_parts,
|
|
2326
2566
|
)
|
|
2327
2567
|
|
|
2568
|
+
@_rewrite_parameters(
|
|
2569
|
+
body_fields=("nonce", "redirect_uri", "state", "realm"),
|
|
2570
|
+
)
|
|
2571
|
+
def oidc_authenticate(
|
|
2572
|
+
self,
|
|
2573
|
+
*,
|
|
2574
|
+
nonce: t.Optional[str] = None,
|
|
2575
|
+
redirect_uri: t.Optional[str] = None,
|
|
2576
|
+
state: t.Optional[str] = None,
|
|
2577
|
+
error_trace: t.Optional[bool] = None,
|
|
2578
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
2579
|
+
human: t.Optional[bool] = None,
|
|
2580
|
+
pretty: t.Optional[bool] = None,
|
|
2581
|
+
realm: t.Optional[str] = None,
|
|
2582
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2583
|
+
) -> ObjectApiResponse[t.Any]:
|
|
2584
|
+
"""
|
|
2585
|
+
Authenticate OpenID Connect. Exchange an OpenID Connect authentication response
|
|
2586
|
+
message for an Elasticsearch internal access token and refresh token that can
|
|
2587
|
+
be subsequently used for authentication. Elasticsearch exposes all the necessary
|
|
2588
|
+
OpenID Connect related functionality with the OpenID Connect APIs. These APIs
|
|
2589
|
+
are used internally by Kibana in order to provide OpenID Connect based authentication,
|
|
2590
|
+
but can also be used by other, custom web applications or other clients.
|
|
2591
|
+
|
|
2592
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-oidc-authenticate.html>`_
|
|
2593
|
+
|
|
2594
|
+
:param nonce: Associate a client session with an ID token and mitigate replay
|
|
2595
|
+
attacks. This value needs to be the same as the one that was provided to
|
|
2596
|
+
the `/_security/oidc/prepare` API or the one that was generated by Elasticsearch
|
|
2597
|
+
and included in the response to that call.
|
|
2598
|
+
:param redirect_uri: The URL to which the OpenID Connect Provider redirected
|
|
2599
|
+
the User Agent in response to an authentication request after a successful
|
|
2600
|
+
authentication. This URL must be provided as-is (URL encoded), taken from
|
|
2601
|
+
the body of the response or as the value of a location header in the response
|
|
2602
|
+
from the OpenID Connect Provider.
|
|
2603
|
+
:param state: Maintain state between the authentication request and the response.
|
|
2604
|
+
This value needs to be the same as the one that was provided to the `/_security/oidc/prepare`
|
|
2605
|
+
API or the one that was generated by Elasticsearch and included in the response
|
|
2606
|
+
to that call.
|
|
2607
|
+
:param realm: The name of the OpenID Connect realm. This property is useful in
|
|
2608
|
+
cases where multiple realms are defined.
|
|
2609
|
+
"""
|
|
2610
|
+
if nonce is None and body is None:
|
|
2611
|
+
raise ValueError("Empty value passed for parameter 'nonce'")
|
|
2612
|
+
if redirect_uri is None and body is None:
|
|
2613
|
+
raise ValueError("Empty value passed for parameter 'redirect_uri'")
|
|
2614
|
+
if state is None and body is None:
|
|
2615
|
+
raise ValueError("Empty value passed for parameter 'state'")
|
|
2616
|
+
__path_parts: t.Dict[str, str] = {}
|
|
2617
|
+
__path = "/_security/oidc/authenticate"
|
|
2618
|
+
__query: t.Dict[str, t.Any] = {}
|
|
2619
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
2620
|
+
if error_trace is not None:
|
|
2621
|
+
__query["error_trace"] = error_trace
|
|
2622
|
+
if filter_path is not None:
|
|
2623
|
+
__query["filter_path"] = filter_path
|
|
2624
|
+
if human is not None:
|
|
2625
|
+
__query["human"] = human
|
|
2626
|
+
if pretty is not None:
|
|
2627
|
+
__query["pretty"] = pretty
|
|
2628
|
+
if not __body:
|
|
2629
|
+
if nonce is not None:
|
|
2630
|
+
__body["nonce"] = nonce
|
|
2631
|
+
if redirect_uri is not None:
|
|
2632
|
+
__body["redirect_uri"] = redirect_uri
|
|
2633
|
+
if state is not None:
|
|
2634
|
+
__body["state"] = state
|
|
2635
|
+
if realm is not None:
|
|
2636
|
+
__body["realm"] = realm
|
|
2637
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
2638
|
+
return self.perform_request( # type: ignore[return-value]
|
|
2639
|
+
"POST",
|
|
2640
|
+
__path,
|
|
2641
|
+
params=__query,
|
|
2642
|
+
headers=__headers,
|
|
2643
|
+
body=__body,
|
|
2644
|
+
endpoint_id="security.oidc_authenticate",
|
|
2645
|
+
path_parts=__path_parts,
|
|
2646
|
+
)
|
|
2647
|
+
|
|
2648
|
+
@_rewrite_parameters(
|
|
2649
|
+
body_fields=("access_token", "refresh_token"),
|
|
2650
|
+
)
|
|
2651
|
+
def oidc_logout(
|
|
2652
|
+
self,
|
|
2653
|
+
*,
|
|
2654
|
+
access_token: t.Optional[str] = None,
|
|
2655
|
+
error_trace: t.Optional[bool] = None,
|
|
2656
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
2657
|
+
human: t.Optional[bool] = None,
|
|
2658
|
+
pretty: t.Optional[bool] = None,
|
|
2659
|
+
refresh_token: t.Optional[str] = None,
|
|
2660
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2661
|
+
) -> ObjectApiResponse[t.Any]:
|
|
2662
|
+
"""
|
|
2663
|
+
Logout of OpenID Connect. Invalidate an access token and a refresh token that
|
|
2664
|
+
were generated as a response to the `/_security/oidc/authenticate` API. If the
|
|
2665
|
+
OpenID Connect authentication realm in Elasticsearch is accordingly configured,
|
|
2666
|
+
the response to this call will contain a URI pointing to the end session endpoint
|
|
2667
|
+
of the OpenID Connect Provider in order to perform single logout. Elasticsearch
|
|
2668
|
+
exposes all the necessary OpenID Connect related functionality with the OpenID
|
|
2669
|
+
Connect APIs. These APIs are used internally by Kibana in order to provide OpenID
|
|
2670
|
+
Connect based authentication, but can also be used by other, custom web applications
|
|
2671
|
+
or other clients.
|
|
2672
|
+
|
|
2673
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-oidc-logout.html>`_
|
|
2674
|
+
|
|
2675
|
+
:param access_token: The access token to be invalidated.
|
|
2676
|
+
:param refresh_token: The refresh token to be invalidated.
|
|
2677
|
+
"""
|
|
2678
|
+
if access_token is None and body is None:
|
|
2679
|
+
raise ValueError("Empty value passed for parameter 'access_token'")
|
|
2680
|
+
__path_parts: t.Dict[str, str] = {}
|
|
2681
|
+
__path = "/_security/oidc/logout"
|
|
2682
|
+
__query: t.Dict[str, t.Any] = {}
|
|
2683
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
2684
|
+
if error_trace is not None:
|
|
2685
|
+
__query["error_trace"] = error_trace
|
|
2686
|
+
if filter_path is not None:
|
|
2687
|
+
__query["filter_path"] = filter_path
|
|
2688
|
+
if human is not None:
|
|
2689
|
+
__query["human"] = human
|
|
2690
|
+
if pretty is not None:
|
|
2691
|
+
__query["pretty"] = pretty
|
|
2692
|
+
if not __body:
|
|
2693
|
+
if access_token is not None:
|
|
2694
|
+
__body["access_token"] = access_token
|
|
2695
|
+
if refresh_token is not None:
|
|
2696
|
+
__body["refresh_token"] = refresh_token
|
|
2697
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
2698
|
+
return self.perform_request( # type: ignore[return-value]
|
|
2699
|
+
"POST",
|
|
2700
|
+
__path,
|
|
2701
|
+
params=__query,
|
|
2702
|
+
headers=__headers,
|
|
2703
|
+
body=__body,
|
|
2704
|
+
endpoint_id="security.oidc_logout",
|
|
2705
|
+
path_parts=__path_parts,
|
|
2706
|
+
)
|
|
2707
|
+
|
|
2708
|
+
@_rewrite_parameters(
|
|
2709
|
+
body_fields=("iss", "login_hint", "nonce", "realm", "state"),
|
|
2710
|
+
)
|
|
2711
|
+
def oidc_prepare_authentication(
|
|
2712
|
+
self,
|
|
2713
|
+
*,
|
|
2714
|
+
error_trace: t.Optional[bool] = None,
|
|
2715
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
2716
|
+
human: t.Optional[bool] = None,
|
|
2717
|
+
iss: t.Optional[str] = None,
|
|
2718
|
+
login_hint: t.Optional[str] = None,
|
|
2719
|
+
nonce: t.Optional[str] = None,
|
|
2720
|
+
pretty: t.Optional[bool] = None,
|
|
2721
|
+
realm: t.Optional[str] = None,
|
|
2722
|
+
state: t.Optional[str] = None,
|
|
2723
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2724
|
+
) -> ObjectApiResponse[t.Any]:
|
|
2725
|
+
"""
|
|
2726
|
+
Prepare OpenID connect authentication. Create an oAuth 2.0 authentication request
|
|
2727
|
+
as a URL string based on the configuration of the OpenID Connect authentication
|
|
2728
|
+
realm in Elasticsearch. The response of this API is a URL pointing to the Authorization
|
|
2729
|
+
Endpoint of the configured OpenID Connect Provider, which can be used to redirect
|
|
2730
|
+
the browser of the user in order to continue the authentication process. Elasticsearch
|
|
2731
|
+
exposes all the necessary OpenID Connect related functionality with the OpenID
|
|
2732
|
+
Connect APIs. These APIs are used internally by Kibana in order to provide OpenID
|
|
2733
|
+
Connect based authentication, but can also be used by other, custom web applications
|
|
2734
|
+
or other clients.
|
|
2735
|
+
|
|
2736
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-oidc-prepare-authentication.html>`_
|
|
2737
|
+
|
|
2738
|
+
:param iss: In the case of a third party initiated single sign on, this is the
|
|
2739
|
+
issuer identifier for the OP that the RP is to send the authentication request
|
|
2740
|
+
to. It cannot be specified when *realm* is specified. One of *realm* or *iss*
|
|
2741
|
+
is required.
|
|
2742
|
+
:param login_hint: In the case of a third party initiated single sign on, it
|
|
2743
|
+
is a string value that is included in the authentication request as the *login_hint*
|
|
2744
|
+
parameter. This parameter is not valid when *realm* is specified.
|
|
2745
|
+
:param nonce: The value used to associate a client session with an ID token and
|
|
2746
|
+
to mitigate replay attacks. If the caller of the API does not provide a value,
|
|
2747
|
+
Elasticsearch will generate one with sufficient entropy and return it in
|
|
2748
|
+
the response.
|
|
2749
|
+
:param realm: The name of the OpenID Connect realm in Elasticsearch the configuration
|
|
2750
|
+
of which should be used in order to generate the authentication request.
|
|
2751
|
+
It cannot be specified when *iss* is specified. One of *realm* or *iss* is
|
|
2752
|
+
required.
|
|
2753
|
+
:param state: The value used to maintain state between the authentication request
|
|
2754
|
+
and the response, typically used as a Cross-Site Request Forgery mitigation.
|
|
2755
|
+
If the caller of the API does not provide a value, Elasticsearch will generate
|
|
2756
|
+
one with sufficient entropy and return it in the response.
|
|
2757
|
+
"""
|
|
2758
|
+
__path_parts: t.Dict[str, str] = {}
|
|
2759
|
+
__path = "/_security/oidc/prepare"
|
|
2760
|
+
__query: t.Dict[str, t.Any] = {}
|
|
2761
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
2762
|
+
if error_trace is not None:
|
|
2763
|
+
__query["error_trace"] = error_trace
|
|
2764
|
+
if filter_path is not None:
|
|
2765
|
+
__query["filter_path"] = filter_path
|
|
2766
|
+
if human is not None:
|
|
2767
|
+
__query["human"] = human
|
|
2768
|
+
if pretty is not None:
|
|
2769
|
+
__query["pretty"] = pretty
|
|
2770
|
+
if not __body:
|
|
2771
|
+
if iss is not None:
|
|
2772
|
+
__body["iss"] = iss
|
|
2773
|
+
if login_hint is not None:
|
|
2774
|
+
__body["login_hint"] = login_hint
|
|
2775
|
+
if nonce is not None:
|
|
2776
|
+
__body["nonce"] = nonce
|
|
2777
|
+
if realm is not None:
|
|
2778
|
+
__body["realm"] = realm
|
|
2779
|
+
if state is not None:
|
|
2780
|
+
__body["state"] = state
|
|
2781
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
2782
|
+
return self.perform_request( # type: ignore[return-value]
|
|
2783
|
+
"POST",
|
|
2784
|
+
__path,
|
|
2785
|
+
params=__query,
|
|
2786
|
+
headers=__headers,
|
|
2787
|
+
body=__body,
|
|
2788
|
+
endpoint_id="security.oidc_prepare_authentication",
|
|
2789
|
+
path_parts=__path_parts,
|
|
2790
|
+
)
|
|
2791
|
+
|
|
2328
2792
|
@_rewrite_parameters(
|
|
2329
2793
|
body_name="privileges",
|
|
2330
2794
|
)
|
|
@@ -2346,7 +2810,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2346
2810
|
"""
|
|
2347
2811
|
Create or update application privileges.
|
|
2348
2812
|
|
|
2349
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2813
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-put-privileges.html>`_
|
|
2350
2814
|
|
|
2351
2815
|
:param privileges:
|
|
2352
2816
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -2392,6 +2856,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2392
2856
|
"global_",
|
|
2393
2857
|
"indices",
|
|
2394
2858
|
"metadata",
|
|
2859
|
+
"remote_cluster",
|
|
2395
2860
|
"remote_indices",
|
|
2396
2861
|
"run_as",
|
|
2397
2862
|
"transient_metadata",
|
|
@@ -2452,6 +2917,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2452
2917
|
"monitor_ml",
|
|
2453
2918
|
"monitor_rollup",
|
|
2454
2919
|
"monitor_snapshot",
|
|
2920
|
+
"monitor_stats",
|
|
2455
2921
|
"monitor_text_structure",
|
|
2456
2922
|
"monitor_transform",
|
|
2457
2923
|
"monitor_watcher",
|
|
@@ -2481,6 +2947,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2481
2947
|
refresh: t.Optional[
|
|
2482
2948
|
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
2483
2949
|
] = None,
|
|
2950
|
+
remote_cluster: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
|
|
2484
2951
|
remote_indices: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
|
|
2485
2952
|
run_as: t.Optional[t.Sequence[str]] = None,
|
|
2486
2953
|
transient_metadata: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
@@ -2492,7 +2959,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2492
2959
|
The create or update roles API cannot update roles that are defined in roles
|
|
2493
2960
|
files. File-based role management is not available in Elastic Serverless.
|
|
2494
2961
|
|
|
2495
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2962
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-put-role.html>`_
|
|
2496
2963
|
|
|
2497
2964
|
:param name: The name of the role.
|
|
2498
2965
|
:param applications: A list of application privilege entries.
|
|
@@ -2508,6 +2975,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2508
2975
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
2509
2976
|
this operation visible to search, if `wait_for` then wait for a refresh to
|
|
2510
2977
|
make this operation visible to search, if `false` then do nothing with refreshes.
|
|
2978
|
+
:param remote_cluster: A list of remote cluster permissions entries.
|
|
2511
2979
|
:param remote_indices: A list of remote indices permissions entries.
|
|
2512
2980
|
:param run_as: A list of users that the owners of this role can impersonate.
|
|
2513
2981
|
*Note*: in Serverless, the run-as feature is disabled. For API compatibility,
|
|
@@ -2549,6 +3017,8 @@ class SecurityClient(NamespacedClient):
|
|
|
2549
3017
|
__body["indices"] = indices
|
|
2550
3018
|
if metadata is not None:
|
|
2551
3019
|
__body["metadata"] = metadata
|
|
3020
|
+
if remote_cluster is not None:
|
|
3021
|
+
__body["remote_cluster"] = remote_cluster
|
|
2552
3022
|
if remote_indices is not None:
|
|
2553
3023
|
__body["remote_indices"] = remote_indices
|
|
2554
3024
|
if run_as is not None:
|
|
@@ -2605,7 +3075,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2605
3075
|
roles. Roles can be created by using the create or update roles API or roles
|
|
2606
3076
|
files.
|
|
2607
3077
|
|
|
2608
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3078
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-put-role-mapping.html>`_
|
|
2609
3079
|
|
|
2610
3080
|
:param name: Role-mapping name
|
|
2611
3081
|
:param enabled:
|
|
@@ -2694,7 +3164,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2694
3164
|
when updating an existing user. To change a user’s password without updating
|
|
2695
3165
|
any other fields, use the change password API.
|
|
2696
3166
|
|
|
2697
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3167
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-put-user.html>`_
|
|
2698
3168
|
|
|
2699
3169
|
:param username: The username of the User
|
|
2700
3170
|
:param email:
|
|
@@ -2792,7 +3262,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2792
3262
|
Find API keys with a query. Get a paginated list of API keys and their information.
|
|
2793
3263
|
You can optionally filter the results with a query.
|
|
2794
3264
|
|
|
2795
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3265
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-query-api-key.html>`_
|
|
2796
3266
|
|
|
2797
3267
|
:param aggregations: Any aggregations to run over the corpus of returned API
|
|
2798
3268
|
keys. Aggregations and queries work together. Aggregations are computed only
|
|
@@ -2919,7 +3389,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2919
3389
|
Find roles with a query. Get roles in a paginated manner. You can optionally
|
|
2920
3390
|
filter the results with a query.
|
|
2921
3391
|
|
|
2922
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3392
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-query-role.html>`_
|
|
2923
3393
|
|
|
2924
3394
|
:param from_: Starting document offset. By default, you cannot page through more
|
|
2925
3395
|
than 10,000 hits using the from and size parameters. To page through more
|
|
@@ -3005,7 +3475,7 @@ class SecurityClient(NamespacedClient):
|
|
|
3005
3475
|
Find users with a query. Get information for users in a paginated manner. You
|
|
3006
3476
|
can optionally filter the results with a query.
|
|
3007
3477
|
|
|
3008
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3478
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-query-user.html>`_
|
|
3009
3479
|
|
|
3010
3480
|
:param from_: Starting document offset. By default, you cannot page through more
|
|
3011
3481
|
than 10,000 hits using the from and size parameters. To page through more
|
|
@@ -3081,13 +3551,25 @@ class SecurityClient(NamespacedClient):
|
|
|
3081
3551
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3082
3552
|
) -> ObjectApiResponse[t.Any]:
|
|
3083
3553
|
"""
|
|
3084
|
-
Authenticate SAML.
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3554
|
+
Authenticate SAML. Submit a SAML response message to Elasticsearch for consumption.
|
|
3555
|
+
NOTE: This API is intended for use by custom web applications other than Kibana.
|
|
3556
|
+
If you are using Kibana, refer to the documentation for configuring SAML single-sign-on
|
|
3557
|
+
on the Elastic Stack. The SAML message that is submitted can be: * A response
|
|
3558
|
+
to a SAML authentication request that was previously created using the SAML prepare
|
|
3559
|
+
authentication API. * An unsolicited SAML message in the case of an IdP-initiated
|
|
3560
|
+
single sign-on (SSO) flow. In either case, the SAML message needs to be a base64
|
|
3561
|
+
encoded XML document with a root element of `<Response>`. After successful validation,
|
|
3562
|
+
Elasticsearch responds with an Elasticsearch internal access token and refresh
|
|
3563
|
+
token that can be subsequently used for authentication. This API endpoint essentially
|
|
3564
|
+
exchanges SAML responses that indicate successful authentication in the IdP for
|
|
3565
|
+
Elasticsearch access and refresh tokens, which can be used for authentication
|
|
3566
|
+
against Elasticsearch.
|
|
3567
|
+
|
|
3568
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-saml-authenticate.html>`_
|
|
3569
|
+
|
|
3570
|
+
:param content: The SAML response as it was sent by the user's browser, usually
|
|
3089
3571
|
a Base64 encoded XML document.
|
|
3090
|
-
:param ids: A
|
|
3572
|
+
:param ids: A JSON array with all the valid SAML Request Ids that the caller
|
|
3091
3573
|
of the API has for the current user.
|
|
3092
3574
|
:param realm: The name of the realm that should authenticate the SAML response.
|
|
3093
3575
|
Useful in cases where many SAML realms are defined.
|
|
@@ -3144,10 +3626,19 @@ class SecurityClient(NamespacedClient):
|
|
|
3144
3626
|
) -> ObjectApiResponse[t.Any]:
|
|
3145
3627
|
"""
|
|
3146
3628
|
Logout of SAML completely. Verifies the logout response sent from the SAML IdP.
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3629
|
+
NOTE: This API is intended for use by custom web applications other than Kibana.
|
|
3630
|
+
If you are using Kibana, refer to the documentation for configuring SAML single-sign-on
|
|
3631
|
+
on the Elastic Stack. The SAML IdP may send a logout response back to the SP
|
|
3632
|
+
after handling the SP-initiated SAML Single Logout. This API verifies the response
|
|
3633
|
+
by ensuring the content is relevant and validating its signature. An empty response
|
|
3634
|
+
is returned if the verification process is successful. The response can be sent
|
|
3635
|
+
by the IdP with either the HTTP-Redirect or the HTTP-Post binding. The caller
|
|
3636
|
+
of this API must prepare the request accordingly so that this API can handle
|
|
3637
|
+
either of them.
|
|
3638
|
+
|
|
3639
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-saml-complete-logout.html>`_
|
|
3640
|
+
|
|
3641
|
+
:param ids: A JSON array with all the valid SAML Request Ids that the caller
|
|
3151
3642
|
of the API has for the current user.
|
|
3152
3643
|
:param realm: The name of the SAML realm in Elasticsearch for which the configuration
|
|
3153
3644
|
is used to verify the logout response.
|
|
@@ -3209,25 +3700,33 @@ class SecurityClient(NamespacedClient):
|
|
|
3209
3700
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3210
3701
|
) -> ObjectApiResponse[t.Any]:
|
|
3211
3702
|
"""
|
|
3212
|
-
Invalidate SAML.
|
|
3213
|
-
|
|
3214
|
-
|
|
3703
|
+
Invalidate SAML. Submit a SAML LogoutRequest message to Elasticsearch for consumption.
|
|
3704
|
+
NOTE: This API is intended for use by custom web applications other than Kibana.
|
|
3705
|
+
If you are using Kibana, refer to the documentation for configuring SAML single-sign-on
|
|
3706
|
+
on the Elastic Stack. The logout request comes from the SAML IdP during an IdP
|
|
3707
|
+
initiated Single Logout. The custom web application can use this API to have
|
|
3708
|
+
Elasticsearch process the `LogoutRequest`. After successful validation of the
|
|
3709
|
+
request, Elasticsearch invalidates the access token and refresh token that corresponds
|
|
3710
|
+
to that specific SAML principal and provides a URL that contains a SAML LogoutResponse
|
|
3711
|
+
message. Thus the user can be redirected back to their IdP.
|
|
3712
|
+
|
|
3713
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-saml-invalidate.html>`_
|
|
3215
3714
|
|
|
3216
3715
|
:param query_string: The query part of the URL that the user was redirected to
|
|
3217
3716
|
by the SAML IdP to initiate the Single Logout. This query should include
|
|
3218
|
-
a single parameter named SAMLRequest that contains a SAML logout request
|
|
3717
|
+
a single parameter named `SAMLRequest` that contains a SAML logout request
|
|
3219
3718
|
that is deflated and Base64 encoded. If the SAML IdP has signed the logout
|
|
3220
|
-
request, the URL should include two extra parameters named SigAlg and Signature
|
|
3719
|
+
request, the URL should include two extra parameters named `SigAlg` and `Signature`
|
|
3221
3720
|
that contain the algorithm used for the signature and the signature value
|
|
3222
|
-
itself. In order for Elasticsearch to be able to verify the IdP
|
|
3223
|
-
the value of the query_string field must be an exact match to the string
|
|
3721
|
+
itself. In order for Elasticsearch to be able to verify the IdP's signature,
|
|
3722
|
+
the value of the `query_string` field must be an exact match to the string
|
|
3224
3723
|
provided by the browser. The client application must not attempt to parse
|
|
3225
3724
|
or process the string in any way.
|
|
3226
3725
|
:param acs: The Assertion Consumer Service URL that matches the one of the SAML
|
|
3227
3726
|
realm in Elasticsearch that should be used. You must specify either this
|
|
3228
|
-
parameter or the realm parameter.
|
|
3727
|
+
parameter or the `realm` parameter.
|
|
3229
3728
|
:param realm: The name of the SAML realm in Elasticsearch the configuration.
|
|
3230
|
-
You must specify either this parameter or the acs parameter.
|
|
3729
|
+
You must specify either this parameter or the `acs` parameter.
|
|
3231
3730
|
"""
|
|
3232
3731
|
if query_string is None and body is None:
|
|
3233
3732
|
raise ValueError("Empty value passed for parameter 'query_string'")
|
|
@@ -3277,12 +3776,19 @@ class SecurityClient(NamespacedClient):
|
|
|
3277
3776
|
) -> ObjectApiResponse[t.Any]:
|
|
3278
3777
|
"""
|
|
3279
3778
|
Logout of SAML. Submits a request to invalidate an access token and refresh token.
|
|
3779
|
+
NOTE: This API is intended for use by custom web applications other than Kibana.
|
|
3780
|
+
If you are using Kibana, refer to the documentation for configuring SAML single-sign-on
|
|
3781
|
+
on the Elastic Stack. This API invalidates the tokens that were generated for
|
|
3782
|
+
a user by the SAML authenticate API. If the SAML realm in Elasticsearch is configured
|
|
3783
|
+
accordingly and the SAML IdP supports this, the Elasticsearch response contains
|
|
3784
|
+
a URL to redirect the user to the IdP that contains a SAML logout request (starting
|
|
3785
|
+
an SP-initiated SAML Single Logout).
|
|
3280
3786
|
|
|
3281
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3787
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-saml-logout.html>`_
|
|
3282
3788
|
|
|
3283
3789
|
:param token: The access token that was returned as a response to calling the
|
|
3284
3790
|
SAML authenticate API. Alternatively, the most recent token that was received
|
|
3285
|
-
after refreshing the original one by using a refresh_token
|
|
3791
|
+
after refreshing the original one by using a `refresh_token`.
|
|
3286
3792
|
:param refresh_token: The refresh token that was returned as a response to calling
|
|
3287
3793
|
the SAML authenticate API. Alternatively, the most recent refresh token that
|
|
3288
3794
|
was received after refreshing the original access token.
|
|
@@ -3333,19 +3839,31 @@ class SecurityClient(NamespacedClient):
|
|
|
3333
3839
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3334
3840
|
) -> ObjectApiResponse[t.Any]:
|
|
3335
3841
|
"""
|
|
3336
|
-
Prepare SAML authentication.
|
|
3337
|
-
as a URL string
|
|
3338
|
-
|
|
3339
|
-
|
|
3842
|
+
Prepare SAML authentication. Create a SAML authentication request (`<AuthnRequest>`)
|
|
3843
|
+
as a URL string based on the configuration of the respective SAML realm in Elasticsearch.
|
|
3844
|
+
NOTE: This API is intended for use by custom web applications other than Kibana.
|
|
3845
|
+
If you are using Kibana, refer to the documentation for configuring SAML single-sign-on
|
|
3846
|
+
on the Elastic Stack. This API returns a URL pointing to the SAML Identity Provider.
|
|
3847
|
+
You can use the URL to redirect the browser of the user in order to continue
|
|
3848
|
+
the authentication process. The URL includes a single parameter named `SAMLRequest`,
|
|
3849
|
+
which contains a SAML Authentication request that is deflated and Base64 encoded.
|
|
3850
|
+
If the configuration dictates that SAML authentication requests should be signed,
|
|
3851
|
+
the URL has two extra parameters named `SigAlg` and `Signature`. These parameters
|
|
3852
|
+
contain the algorithm used for the signature and the signature value itself.
|
|
3853
|
+
It also returns a random string that uniquely identifies this SAML Authentication
|
|
3854
|
+
request. The caller of this API needs to store this identifier as it needs to
|
|
3855
|
+
be used in a following step of the authentication process.
|
|
3856
|
+
|
|
3857
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-saml-prepare-authentication.html>`_
|
|
3340
3858
|
|
|
3341
3859
|
:param acs: The Assertion Consumer Service URL that matches the one of the SAML
|
|
3342
3860
|
realms in Elasticsearch. The realm is used to generate the authentication
|
|
3343
|
-
request. You must specify either this parameter or the realm parameter.
|
|
3861
|
+
request. You must specify either this parameter or the `realm` parameter.
|
|
3344
3862
|
:param realm: The name of the SAML realm in Elasticsearch for which the configuration
|
|
3345
3863
|
is used to generate the authentication request. You must specify either this
|
|
3346
|
-
parameter or the acs parameter.
|
|
3864
|
+
parameter or the `acs` parameter.
|
|
3347
3865
|
:param relay_state: A string that will be included in the redirect URL that this
|
|
3348
|
-
API returns as the RelayState query parameter. If the Authentication Request
|
|
3866
|
+
API returns as the `RelayState` query parameter. If the Authentication Request
|
|
3349
3867
|
is signed, this value is used as part of the signature computation.
|
|
3350
3868
|
"""
|
|
3351
3869
|
__path_parts: t.Dict[str, str] = {}
|
|
@@ -3390,9 +3908,12 @@ class SecurityClient(NamespacedClient):
|
|
|
3390
3908
|
) -> ObjectApiResponse[t.Any]:
|
|
3391
3909
|
"""
|
|
3392
3910
|
Create SAML service provider metadata. Generate SAML metadata for a SAML 2.0
|
|
3393
|
-
Service Provider.
|
|
3911
|
+
Service Provider. The SAML 2.0 specification provides a mechanism for Service
|
|
3912
|
+
Providers to describe their capabilities and configuration using a metadata file.
|
|
3913
|
+
This API generates Service Provider metadata based on the configuration of a
|
|
3914
|
+
SAML realm in Elasticsearch.
|
|
3394
3915
|
|
|
3395
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3916
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-saml-sp-metadata.html>`_
|
|
3396
3917
|
|
|
3397
3918
|
:param realm_name: The name of the SAML realm in Elasticsearch.
|
|
3398
3919
|
"""
|
|
@@ -3437,21 +3958,27 @@ class SecurityClient(NamespacedClient):
|
|
|
3437
3958
|
) -> ObjectApiResponse[t.Any]:
|
|
3438
3959
|
"""
|
|
3439
3960
|
Suggest a user profile. Get suggestions for user profiles that match specified
|
|
3440
|
-
search criteria.
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3961
|
+
search criteria. NOTE: The user profile feature is designed only for use by Kibana
|
|
3962
|
+
and Elastic's Observability, Enterprise Search, and Elastic Security solutions.
|
|
3963
|
+
Individual users and external applications should not call this API directly.
|
|
3964
|
+
Elastic reserves the right to change or remove this feature in future releases
|
|
3965
|
+
without prior notice.
|
|
3966
|
+
|
|
3967
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-suggest-user-profile.html>`_
|
|
3968
|
+
|
|
3969
|
+
:param data: A comma-separated list of filters for the `data` field of the profile
|
|
3970
|
+
document. To return all content use `data=*`. To return a subset of content,
|
|
3971
|
+
use `data=<key>` to retrieve content nested under the specified `<key>`.
|
|
3972
|
+
By default, the API returns no `data` content. It is an error to specify
|
|
3973
|
+
`data` as both the query parameter and the request body field.
|
|
3448
3974
|
:param hint: Extra search criteria to improve relevance of the suggestion result.
|
|
3449
3975
|
Profiles matching the spcified hint are ranked higher in the response. Profiles
|
|
3450
|
-
not matching the hint
|
|
3451
|
-
|
|
3452
|
-
:param name:
|
|
3453
|
-
Name-related fields are the user's `username`, `full_name`, and
|
|
3454
|
-
|
|
3976
|
+
not matching the hint aren't excluded from the response as long as the profile
|
|
3977
|
+
matches the `name` field query.
|
|
3978
|
+
:param name: A query string used to match name-related fields in user profile
|
|
3979
|
+
documents. Name-related fields are the user's `username`, `full_name`, and
|
|
3980
|
+
`email`.
|
|
3981
|
+
:param size: The number of profiles to return.
|
|
3455
3982
|
"""
|
|
3456
3983
|
__path_parts: t.Dict[str, str] = {}
|
|
3457
3984
|
__path = "/_security/profile/_suggest"
|
|
@@ -3523,7 +4050,7 @@ class SecurityClient(NamespacedClient):
|
|
|
3523
4050
|
not possible to use an API key as the authentication credential for this API.
|
|
3524
4051
|
To update an API key, the owner user’s credentials are required.
|
|
3525
4052
|
|
|
3526
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4053
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-update-api-key.html>`_
|
|
3527
4054
|
|
|
3528
4055
|
:param id: The ID of the API key to update.
|
|
3529
4056
|
:param expiration: Expiration time for the API key.
|
|
@@ -3593,17 +4120,28 @@ class SecurityClient(NamespacedClient):
|
|
|
3593
4120
|
) -> ObjectApiResponse[t.Any]:
|
|
3594
4121
|
"""
|
|
3595
4122
|
Update a cross-cluster API key. Update the attributes of an existing cross-cluster
|
|
3596
|
-
API key, which is used for API key based remote cluster access.
|
|
4123
|
+
API key, which is used for API key based remote cluster access. To use this API,
|
|
4124
|
+
you must have at least the `manage_security` cluster privilege. Users can only
|
|
4125
|
+
update API keys that they created. To update another user's API key, use the
|
|
4126
|
+
`run_as` feature to submit a request on behalf of another user. IMPORTANT: It's
|
|
4127
|
+
not possible to use an API key as the authentication credential for this API.
|
|
4128
|
+
To update an API key, the owner user's credentials are required. It's not possible
|
|
4129
|
+
to update expired API keys, or API keys that have been invalidated by the invalidate
|
|
4130
|
+
API key API. This API supports updates to an API key's access scope, metadata,
|
|
4131
|
+
and expiration. The owner user's information, such as the `username` and `realm`,
|
|
4132
|
+
is also updated automatically on every call. NOTE: This API cannot update REST
|
|
4133
|
+
API keys, which should be updated by either the update API key or bulk update
|
|
4134
|
+
API keys API.
|
|
3597
4135
|
|
|
3598
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4136
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-update-cross-cluster-api-key.html>`_
|
|
3599
4137
|
|
|
3600
4138
|
:param id: The ID of the cross-cluster API key to update.
|
|
3601
4139
|
:param access: The access to be granted to this API key. The access is composed
|
|
3602
4140
|
of permissions for cross cluster search and cross cluster replication. At
|
|
3603
4141
|
least one of them must be specified. When specified, the new access assignment
|
|
3604
4142
|
fully replaces the previously assigned access.
|
|
3605
|
-
:param expiration:
|
|
3606
|
-
expire. This property can be omitted to leave the value unchanged.
|
|
4143
|
+
:param expiration: The expiration time for the API key. By default, API keys
|
|
4144
|
+
never expire. This property can be omitted to leave the value unchanged.
|
|
3607
4145
|
:param metadata: Arbitrary metadata that you want to associate with the API key.
|
|
3608
4146
|
It supports nested data structure. Within the metadata object, keys beginning
|
|
3609
4147
|
with `_` are reserved for system usage. When specified, this information
|
|
@@ -3643,6 +4181,81 @@ class SecurityClient(NamespacedClient):
|
|
|
3643
4181
|
path_parts=__path_parts,
|
|
3644
4182
|
)
|
|
3645
4183
|
|
|
4184
|
+
@_rewrite_parameters(
|
|
4185
|
+
body_fields=("security", "security_profile", "security_tokens"),
|
|
4186
|
+
parameter_aliases={
|
|
4187
|
+
"security-profile": "security_profile",
|
|
4188
|
+
"security-tokens": "security_tokens",
|
|
4189
|
+
},
|
|
4190
|
+
)
|
|
4191
|
+
def update_settings(
|
|
4192
|
+
self,
|
|
4193
|
+
*,
|
|
4194
|
+
error_trace: t.Optional[bool] = None,
|
|
4195
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
4196
|
+
human: t.Optional[bool] = None,
|
|
4197
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
4198
|
+
pretty: t.Optional[bool] = None,
|
|
4199
|
+
security: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
4200
|
+
security_profile: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
4201
|
+
security_tokens: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
4202
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
4203
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4204
|
+
) -> ObjectApiResponse[t.Any]:
|
|
4205
|
+
"""
|
|
4206
|
+
Update security index settings. Update the user-configurable settings for the
|
|
4207
|
+
security internal index (`.security` and associated indices). Only a subset of
|
|
4208
|
+
settings are allowed to be modified, for example `index.auto_expand_replicas`
|
|
4209
|
+
and `index.number_of_replicas`. If a specific index is not in use on the system
|
|
4210
|
+
and settings are provided for it, the request will be rejected. This API does
|
|
4211
|
+
not yet support configuring the settings for indices before they are in use.
|
|
4212
|
+
|
|
4213
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-update-settings.html>`_
|
|
4214
|
+
|
|
4215
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
4216
|
+
If no response is received before the timeout expires, the request fails
|
|
4217
|
+
and returns an error.
|
|
4218
|
+
:param security: Settings for the index used for most security configuration,
|
|
4219
|
+
including native realm users and roles configured with the API.
|
|
4220
|
+
:param security_profile: Settings for the index used to store profile information.
|
|
4221
|
+
:param security_tokens: Settings for the index used to store tokens.
|
|
4222
|
+
:param timeout: The period to wait for a response. If no response is received
|
|
4223
|
+
before the timeout expires, the request fails and returns an error.
|
|
4224
|
+
"""
|
|
4225
|
+
__path_parts: t.Dict[str, str] = {}
|
|
4226
|
+
__path = "/_security/settings"
|
|
4227
|
+
__query: t.Dict[str, t.Any] = {}
|
|
4228
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
4229
|
+
if error_trace is not None:
|
|
4230
|
+
__query["error_trace"] = error_trace
|
|
4231
|
+
if filter_path is not None:
|
|
4232
|
+
__query["filter_path"] = filter_path
|
|
4233
|
+
if human is not None:
|
|
4234
|
+
__query["human"] = human
|
|
4235
|
+
if master_timeout is not None:
|
|
4236
|
+
__query["master_timeout"] = master_timeout
|
|
4237
|
+
if pretty is not None:
|
|
4238
|
+
__query["pretty"] = pretty
|
|
4239
|
+
if timeout is not None:
|
|
4240
|
+
__query["timeout"] = timeout
|
|
4241
|
+
if not __body:
|
|
4242
|
+
if security is not None:
|
|
4243
|
+
__body["security"] = security
|
|
4244
|
+
if security_profile is not None:
|
|
4245
|
+
__body["security-profile"] = security_profile
|
|
4246
|
+
if security_tokens is not None:
|
|
4247
|
+
__body["security-tokens"] = security_tokens
|
|
4248
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
4249
|
+
return self.perform_request( # type: ignore[return-value]
|
|
4250
|
+
"PUT",
|
|
4251
|
+
__path,
|
|
4252
|
+
params=__query,
|
|
4253
|
+
headers=__headers,
|
|
4254
|
+
body=__body,
|
|
4255
|
+
endpoint_id="security.update_settings",
|
|
4256
|
+
path_parts=__path_parts,
|
|
4257
|
+
)
|
|
4258
|
+
|
|
3646
4259
|
@_rewrite_parameters(
|
|
3647
4260
|
body_fields=("data", "labels"),
|
|
3648
4261
|
)
|
|
@@ -3665,22 +4278,37 @@ class SecurityClient(NamespacedClient):
|
|
|
3665
4278
|
) -> ObjectApiResponse[t.Any]:
|
|
3666
4279
|
"""
|
|
3667
4280
|
Update user profile data. Update specific data for the user profile that is associated
|
|
3668
|
-
with a unique ID.
|
|
3669
|
-
|
|
3670
|
-
|
|
4281
|
+
with a unique ID. NOTE: The user profile feature is designed only for use by
|
|
4282
|
+
Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.
|
|
4283
|
+
Individual users and external applications should not call this API directly.
|
|
4284
|
+
Elastic reserves the right to change or remove this feature in future releases
|
|
4285
|
+
without prior notice. To use this API, you must have one of the following privileges:
|
|
4286
|
+
* The `manage_user_profile` cluster privilege. * The `update_profile_data` global
|
|
4287
|
+
privilege for the namespaces that are referenced in the request. This API updates
|
|
4288
|
+
the `labels` and `data` fields of an existing user profile document with JSON
|
|
4289
|
+
objects. New keys and their values are added to the profile document and conflicting
|
|
4290
|
+
keys are replaced by data that's included in the request. For both labels and
|
|
4291
|
+
data, content is namespaced by the top-level fields. The `update_profile_data`
|
|
4292
|
+
global privilege grants privileges for updating only the allowed namespaces.
|
|
4293
|
+
|
|
4294
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-update-user-profile-data.html>`_
|
|
3671
4295
|
|
|
3672
4296
|
:param uid: A unique identifier for the user profile.
|
|
3673
4297
|
:param data: Non-searchable data that you want to associate with the user profile.
|
|
3674
|
-
This field supports a nested data structure.
|
|
4298
|
+
This field supports a nested data structure. Within the `data` object, top-level
|
|
4299
|
+
keys cannot begin with an underscore (`_`) or contain a period (`.`). The
|
|
4300
|
+
data object is not searchable, but can be retrieved with the get user profile
|
|
4301
|
+
API.
|
|
3675
4302
|
:param if_primary_term: Only perform the operation if the document has this primary
|
|
3676
4303
|
term.
|
|
3677
4304
|
:param if_seq_no: Only perform the operation if the document has this sequence
|
|
3678
4305
|
number.
|
|
3679
4306
|
:param labels: Searchable data that you want to associate with the user profile.
|
|
3680
|
-
This field supports a nested data structure.
|
|
4307
|
+
This field supports a nested data structure. Within the labels object, top-level
|
|
4308
|
+
keys cannot begin with an underscore (`_`) or contain a period (`.`).
|
|
3681
4309
|
:param refresh: If 'true', Elasticsearch refreshes the affected shards to make
|
|
3682
|
-
this operation visible to search
|
|
3683
|
-
make this operation visible to search
|
|
4310
|
+
this operation visible to search. If 'wait_for', it waits for a refresh to
|
|
4311
|
+
make this operation visible to search. If 'false', nothing is done with refreshes.
|
|
3684
4312
|
"""
|
|
3685
4313
|
if uid in SKIP_IN_PATH:
|
|
3686
4314
|
raise ValueError("Empty value passed for parameter 'uid'")
|