.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Search::Elasticsearch::Client::8_0::Direct::Security 3pm" .TH Search::Elasticsearch::Client::8_0::Direct::Security 3pm 2024-02-04 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Search::Elasticsearch::Client::8_0::Direct::Security \- Plugin providing Security API for Search::Elasticsearch 8.x .SH VERSION .IX Header "VERSION" version 8.12 .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& my $response = $es\->security\->authenticate(); .Ve .SS DESCRIPTION .IX Subsection "DESCRIPTION" This class extends the Search::Elasticsearch client with a \f(CW\*(C`security\*(C'\fR namespace, to support the Security APIs . .PP The full documentation for the Security feature is available here: .SH "GENERAL METHODS" .IX Header "GENERAL METHODS" .ie n .SS authenticate() .el .SS \f(CWauthenticate()\fP .IX Subsection "authenticate()" .Vb 1 \& $response = $es\->security\->authenticate() .Ve .PP The \f(CWauthenticate()\fR method checks that the \f(CW\*(C`userinfo\*(C'\fR is correct and returns a list of which roles are assigned to the user. .PP See the authenticate docs for more information. .PP Query string parameters: \f(CW\*(C`error_trace\*(C'\fR, \f(CW\*(C`human\*(C'\fR .ie n .SS clear_cached_realms() .el .SS \f(CWclear_cached_realms()\fP .IX Subsection "clear_cached_realms()" .Vb 3 \& $response = $es\->security\->clear_cached_realms( \& realms => $realms # required (comma\-separated string) \& ); .Ve .PP The \f(CWclear_cached_realms()\fR method clears the caches for the specified realms .PP Query string parameters: \f(CW\*(C`error_trace\*(C'\fR, \f(CW\*(C`human\*(C'\fR, \f(CW\*(C`usernames\*(C'\fR .PP See the clear_cached_realms docs for more information. .SH "USER METHODS" .IX Header "USER METHODS" .ie n .SS put_user() .el .SS \f(CWput_user()\fP .IX Subsection "put_user()" .Vb 4 \& $response = $es\->security\->put_user( \& username => $username, # required \& body => {...} # required \& ); .Ve .PP The \f(CWput_user()\fR method creates a new user or updates an existing user. .PP See the User Management docs for more information. .PP Query string parameters: \f(CW\*(C`error_trace\*(C'\fR, \f(CW\*(C`human\*(C'\fR .ie n .SS get_user() .el .SS \f(CWget_user()\fP .IX Subsection "get_user()" .Vb 3 \& $response = $es\->security\->get_user( \& username => $username | \e@usernames # optional \& ); .Ve .PP The \f(CWget_user()\fR method retrieves info for the specified users (or all users). .PP See the User Management docs for more information. .PP Query string parameters: \f(CW\*(C`error_trace\*(C'\fR, \f(CW\*(C`human\*(C'\fR .ie n .SS delete_user() .el .SS \f(CWdelete_user()\fP .IX Subsection "delete_user()" .Vb 3 \& $response = $es\->security\->delete_user( \& username => $username # required \& ); .Ve .PP The \f(CWdelete_user()\fR method deletes the specified user. .PP See the User Management docs for more information. .PP Query string parameters: \f(CW\*(C`error_trace\*(C'\fR, \f(CW\*(C`human\*(C'\fR .ie n .SS change_password() .el .SS \f(CWchange_password()\fP .IX Subsection "change_password()" .Vb 6 \& $response = $es\->security\->change_password( \& username => $username # optional \& body => { \& password => $password # required \& } \& ) .Ve .PP The \f(CWchange_password()\fR method changes the password for the specified user. .PP See the User Management docs for more information. .ie n .SS disable_user() .el .SS \f(CWdisable_user()\fP .IX Subsection "disable_user()" .Vb 3 \& $response = $es\->security\->disable_user( \& username => $username # required \& ); .Ve .PP The \f(CWdisable_user()\fR method disables the specified user. .PP See the User Management docs for more information. .PP Query string parameters: \f(CW\*(C`error_trace\*(C'\fR, \f(CW\*(C`human\*(C'\fR .ie n .SS enable_user() .el .SS \f(CWenable_user()\fP .IX Subsection "enable_user()" .Vb 3 \& $response = $es\->security\->enable_user( \& username => $username # required \& ); .Ve .PP The \f(CWenable_user()\fR method enables the specified user. .PP See the User Management docs for more information. .PP Query string parameters: \f(CW\*(C`error_trace\*(C'\fR, \f(CW\*(C`human\*(C'\fR .SH "ROLE METHODS" .IX Header "ROLE METHODS" .ie n .SS put_role() .el .SS \f(CWput_role()\fP .IX Subsection "put_role()" .Vb 4 \& $response = $es\->security\->put_role( \& name => $name, # required \& body => {...} # required \& ); .Ve .PP The \f(CWput_role()\fR method creates a new role or updates an existing role. .PP See the Role Management docs for more information. .PP Query string parameters: \f(CW\*(C`error_trace\*(C'\fR, \f(CW\*(C`human\*(C'\fR .ie n .SS get_role() .el .SS \f(CWget_role()\fP .IX Subsection "get_role()" .Vb 3 \& $response = $es\->security\->get_role( \& name => $name | \e@names # optional \& ); .Ve .PP The \f(CWget_role()\fR method retrieves info for the specified roles (or all roles). .PP See the Role Management docs for more information. .PP Query string parameters: \f(CW\*(C`error_trace\*(C'\fR, \f(CW\*(C`human\*(C'\fR .ie n .SS delete_role() .el .SS \f(CWdelete_role()\fP .IX Subsection "delete_role()" .Vb 3 \& $response = $es\->security\->delete_role( \& name => $name # required \& ); .Ve .PP The \f(CWdelete_role()\fR method deletes the specified role. .PP See the Role Management docs for more information. .PP Query string parameters: \f(CW\*(C`error_trace\*(C'\fR, \f(CW\*(C`human\*(C'\fR .ie n .SS clear_cached_roles() .el .SS \f(CWclear_cached_roles()\fP .IX Subsection "clear_cached_roles()" .Vb 3 \& $response = $es\->security\->clear_cached_roles( \& names => $names # required (comma\-separated string) \& ); .Ve .PP The \f(CWclear_cached_roles()\fR method clears the caches for the specified roles. .PP See the Role Management docs for more information. .PP Query string parameters: \f(CW\*(C`error_trace\*(C'\fR, \f(CW\*(C`human\*(C'\fR .SH "ROLE MAPPING METHODS" .IX Header "ROLE MAPPING METHODS" .ie n .SS put_role_mapping() .el .SS \f(CWput_role_mapping()\fP .IX Subsection "put_role_mapping()" .Vb 4 \& $response = $es\->security\->put_role_mapping( \& name => $name, # required \& body => {...} # required \& ); .Ve .PP The \f(CWput_role_mapping()\fR method creates a new role mapping or updates an existing role mapping. .PP See the Role Mapping docs for more information. .PP Query string parameters: \f(CW\*(C`error_trace\*(C'\fR, \f(CW\*(C`human\*(C'\fR .ie n .SS get_role_mapping() .el .SS \f(CWget_role_mapping()\fP .IX Subsection "get_role_mapping()" .Vb 3 \& $response = $es\->security\->get_role_mapping( \& name => $name, # optional \& ); .Ve .PP The \f(CWget_role_mapping()\fR method retrieves one or more role mappings. .PP See the Role Mapping docs for more information. .PP Query string parameters: \f(CW\*(C`error_trace\*(C'\fR, \f(CW\*(C`human\*(C'\fR .ie n .SS delete_role_mapping() .el .SS \f(CWdelete_role_mapping()\fP .IX Subsection "delete_role_mapping()" .Vb 3 \& $response = $es\->security\->delete_role_mapping( \& name => $name, # required \& ); .Ve .PP The \f(CWdelete_role_mapping()\fR method deletes a role mapping. .PP See the Role Mapping docs for more information. .PP Query string parameters: \f(CW\*(C`error_trace\*(C'\fR, \f(CW\*(C`human\*(C'\fR .SH "TOKEN METHODS" .IX Header "TOKEN METHODS" .ie n .SS get_token() .el .SS \f(CWget_token()\fP .IX Subsection "get_token()" .Vb 3 \& $response = $es\->security\->get_token( \& body => {...} # required \& ); .Ve .PP The \f(CWget_token()\fR method enables you to create bearer tokens for access without requiring basic authentication. .PP See the Token Management docs for more information. .PP Query string parameters: \f(CW\*(C`error_trace\*(C'\fR, \f(CW\*(C`human\*(C'\fR .ie n .SS invalidate_token() .el .SS \f(CWinvalidate_token()\fP .IX Subsection "invalidate_token()" .Vb 3 \& $response = $es\->security\->invalidate_token( \& body => {...} # required \& ); .Ve .PP The \f(CWinvalidate_token()\fR method enables you to invalidate bearer tokens for access without requiring basic authentication. .PP See the Token Management docs for more information. .PP Query string parameters: \f(CW\*(C`error_trace\*(C'\fR, \f(CW\*(C`human\*(C'\fR .SH "API KEY METHODS" .IX Header "API KEY METHODS" .ie n .SS create_api_key() .el .SS \f(CWcreate_api_key()\fP .IX Subsection "create_api_key()" .Vb 3 \& $response = $es\->security\->create_api_key( \& body => {...} # required \& ) .Ve .PP The \f(CWcreate_api_key()\fR API is used to create API keys which can be used for access instead of basic authentication. .PP Query string parameters: \f(CW\*(C`error_trace\*(C'\fR, \f(CW\*(C`filter_path\*(C'\fR, \f(CW\*(C`human\*(C'\fR, \f(CW\*(C`refresh\*(C'\fR .PP See the Create API Key docs for more. .ie n .SS get_api_key() .el .SS \f(CWget_api_key()\fP .IX Subsection "get_api_key()" .Vb 6 \& $response = $es\->security\->get_api_key( \& id => $id, # optional \& name => $name, # optional \& realm_name => $realm, # optional \& username => $username # optional \& ) .Ve .PP The \f(CWget_api_key()\fR API is used to get information about an API key. .PP Query string parameters: \f(CW\*(C`error_trace\*(C'\fR, \f(CW\*(C`filter_path\*(C'\fR, \f(CW\*(C`human\*(C'\fR, \f(CW\*(C`id\*(C'\fR, \f(CW\*(C`name\*(C'\fR, \f(CW\*(C`realm_name\*(C'\fR, \f(CW\*(C`username\*(C'\fR .PP See the Get API Key docs for more. .ie n .SS invalidate_api_key() .el .SS \f(CWinvalidate_api_key()\fP .IX Subsection "invalidate_api_key()" .Vb 6 \& $response = $es\->security\->invalidate_api_key( \& id => $id, # optional \& name => $name, # optional \& realm_name => $realm, # optional \& username => $username # optional \& ) .Ve .PP The \f(CWinvalidate_api_key()\fR API is used to invalidate an API key. .PP Query string parameters: \f(CW\*(C`error_trace\*(C'\fR, \f(CW\*(C`filter_path\*(C'\fR, \f(CW\*(C`human\*(C'\fR, \f(CW\*(C`id\*(C'\fR, \f(CW\*(C`name\*(C'\fR, \f(CW\*(C`realm_name\*(C'\fR, \f(CW\*(C`username\*(C'\fR .PP See the Invalidate API Key docs for more. .SH "USER PRIVILEGE METHODS" .IX Header "USER PRIVILEGE METHODS" .ie n .SS get_user_privileges() .el .SS \f(CWget_user_privileges()\fP .IX Subsection "get_user_privileges()" .Vb 1 \& $response = $es\->get_user_privileges(); \& \& The C method retrieves the privileges granted to the current user. \& \& Query string parameters: \& C, \& C, \& C .Ve .ie n .SS "has_privileges() $response = $es\->has_privileges( user => $user, # optional body => {...} # required );" .el .SS "\f(CWhas_privileges()\fP \f(CW$response\fP = \f(CW$es\fP\->has_privileges( user => \f(CW$user\fP, # optional body => {...} # required );" .IX Subsection "has_privileges() $response = $es->has_privileges( user => $user, # optional body => {...} # required );" .Vb 1 \& The C method checks whether the current or specified user has the listed privileges. \& \& Query string parameters: \& C, \& C, \& C .Ve .PP See the Has Privileges docs for more. .SH "APPLICATION PRIVILEGE METHODS" .IX Header "APPLICATION PRIVILEGE METHODS" .ie n .SS put_privileges() .el .SS \f(CWput_privileges()\fP .IX Subsection "put_privileges()" .Vb 5 \& $response = $es\->put_privileges( \& application => $application, # required \& name => $name, # required \& body => {...} # required \& ); \& \& The C method creates or updates the named privilege for a particular application. \& \& Query string parameters: \& C, \& C, \& C, \& C .Ve .PP See the Create or Update Application Privileges docs for more. .ie n .SS get_privileges() .el .SS \f(CWget_privileges()\fP .IX Subsection "get_privileges()" .Vb 4 \& $response = $es\->get_privileges( \& application => $application, # required \& name => $name, # required \& ); \& \& The C method retrieves the named privilege for a particular application. \& \& Query string parameters: \& C, \& C, \& C .Ve .PP See the Get Application Privileges docs for more. .ie n .SS delete_privileges() .el .SS \f(CWdelete_privileges()\fP .IX Subsection "delete_privileges()" .Vb 4 \& $response = $es\->delete_privileges( \& application => $application, # required \& name => $name, # required \& ); \& \& The C method deletes the named privilege for a particular application. \& \& Query string parameters: \& C, \& C, \& C, \& C .Ve .PP See the Delete Application Privileges docs for more. .SH AUTHOR .IX Header "AUTHOR" Enrico Zimuel .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2024 by Elasticsearch BV. .PP This is free software, licensed under: .PP .Vb 1 \& The Apache License, Version 2.0, January 2004 .Ve