# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. package Search::Elasticsearch::Client::8_0::Direct::Security; $Search::Elasticsearch::Client::8_0::Direct::Security::VERSION = '8.12'; use Moo; with 'Search::Elasticsearch::Client::8_0::Role::API'; with 'Search::Elasticsearch::Role::Client::Direct'; use namespace::clean; __PACKAGE__->_install_api('security'); 1; =pod =encoding UTF-8 =head1 NAME Search::Elasticsearch::Client::8_0::Direct::Security - Plugin providing Security API for Search::Elasticsearch 8.x =head1 VERSION version 8.12 =head1 SYNOPSIS my $response = $es->security->authenticate(); =head2 DESCRIPTION This class extends the L client with a C namespace, to support the L. The full documentation for the Security feature is available here: L =head1 GENERAL METHODS =head2 C $response = $es->security->authenticate() The C method checks that the C is correct and returns a list of which roles are assigned to the user. See the L for more information. Query string parameters: C, C =head2 C $response = $es->security->clear_cached_realms( realms => $realms # required (comma-separated string) ); The C method clears the caches for the specified realms Query string parameters: C, C, C See the L for more information. =head1 USER METHODS =head2 C $response = $es->security->put_user( username => $username, # required body => {...} # required ); The C method creates a new user or updates an existing user. See the L for more information. Query string parameters: C, C =head2 C $response = $es->security->get_user( username => $username | \@usernames # optional ); The C method retrieves info for the specified users (or all users). See the L for more information. Query string parameters: C, C =head2 C $response = $es->security->delete_user( username => $username # required ); The C method deletes the specified user. See the L for more information. Query string parameters: C, C =head2 C $response = $es->security->change_password( username => $username # optional body => { password => $password # required } ) The C method changes the password for the specified user. See the L for more information. =head2 C $response = $es->security->disable_user( username => $username # required ); The C method disables the specified user. See the L for more information. Query string parameters: C, C =head2 C $response = $es->security->enable_user( username => $username # required ); The C method enables the specified user. See the L for more information. Query string parameters: C, C =head1 ROLE METHODS =head2 C $response = $es->security->put_role( name => $name, # required body => {...} # required ); The C method creates a new role or updates an existing role. See the L for more information. Query string parameters: C, C =head2 C $response = $es->security->get_role( name => $name | \@names # optional ); The C method retrieves info for the specified roles (or all roles). See the L for more information. Query string parameters: C, C =head2 C $response = $es->security->delete_role( name => $name # required ); The C method deletes the specified role. See the L for more information. Query string parameters: C, C =head2 C $response = $es->security->clear_cached_roles( names => $names # required (comma-separated string) ); The C method clears the caches for the specified roles. See the L for more information. Query string parameters: C, C =head1 ROLE MAPPING METHODS =head2 C $response = $es->security->put_role_mapping( name => $name, # required body => {...} # required ); The C method creates a new role mapping or updates an existing role mapping. See the L for more information. Query string parameters: C, C =head2 C $response = $es->security->get_role_mapping( name => $name, # optional ); The C method retrieves one or more role mappings. See the L for more information. Query string parameters: C, C =head2 C $response = $es->security->delete_role_mapping( name => $name, # required ); The C method deletes a role mapping. See the L for more information. Query string parameters: C, C =head1 TOKEN METHODS =head2 C $response = $es->security->get_token( body => {...} # required ); The C method enables you to create bearer tokens for access without requiring basic authentication. See the L for more information. Query string parameters: C, C =head2 C $response = $es->security->invalidate_token( body => {...} # required ); The C method enables you to invalidate bearer tokens for access without requiring basic authentication. See the L for more information. Query string parameters: C, C =head1 API KEY METHODS =head2 C $response = $es->security->create_api_key( body => {...} # required ) The C API is used to create API keys which can be used for access instead of basic authentication. Query string parameters: C, C, C, C See the L for more. =head2 C $response = $es->security->get_api_key( id => $id, # optional name => $name, # optional realm_name => $realm, # optional username => $username # optional ) The C API is used to get information about an API key. Query string parameters: C, C, C, C, C, C, C See the L for more. =head2 C $response = $es->security->invalidate_api_key( id => $id, # optional name => $name, # optional realm_name => $realm, # optional username => $username # optional ) The C API is used to invalidate an API key. Query string parameters: C, C, C, C, C, C, C See the L for more. =head1 USER PRIVILEGE METHODS =head2 C $response = $es->get_user_privileges(); The C method retrieves the privileges granted to the current user. Query string parameters: C, C, C =head2 C $response = $es->has_privileges( user => $user, # optional body => {...} # required ); The C method checks whether the current or specified user has the listed privileges. Query string parameters: C, C, C See the L for more. =head1 APPLICATION PRIVILEGE METHODS =head2 C $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 See the L for more. =head2 C $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 See the L for more. =head2 C $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 See the L for more. =head1 AUTHOR Enrico Zimuel =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2024 by Elasticsearch BV. This is free software, licensed under: The Apache License, Version 2.0, January 2004 =cut __END__ # ABSTRACT: Plugin providing Security API for Search::Elasticsearch 8.x