NAME
Search::Elasticsearch::Plugin::XPack::6_0::Security - Plugin providing Security API for Search::Elasticsearch 6.x
VERSION
version 6.00
SYNOPSIS
use Search::Elasticsearch();
my $es = Search::Elasticsearch->new(
nodes => \@nodes,
plugins => ['XPack'],
userinfo => "username:password"
);
my $response = $es->xpack->security->authenticate();
DESCRIPTION
This class extends the Search::Elasticsearch client with a security
namespace, to support the Security APIs. In other words, it can be used as follows:
use Search::Elasticsearch();
my $es = Search::Elasticsearch->new(
nodes => \@nodes,
plugins => ['XPack'],
userinfo => "username:password"
);
my $response = $es->xpack->security->authenticate(...);
The full documentation for the Security feature is available here: https://www.elastic.co/guide/en/x-pack/current/xpack-security.html
GENERAL METHODS
authenticate()
$response = $es->xpack->security->authenticate()
The authenticate()
method checks that the userinfo
is correct and returns a list of which roles are assigned to the user.
See the authenticate docs for more information.
Query string parameters: error_trace
, human
clear_cached_realms()
$response = $es->xpack->security->clear_cached_realms(
realms => $realms # required (comma-separated string)
);
The clear_cached_realms()
method clears the caches for the specified realms
Query string parameters: error_trace
, human
, usernames
See the clear_cached_realms docs for more information.
USER METHODS
put_user()
$response = $es->xpack->security->put_user(
username => $username, # required
body => {...} # required
);
The put_user()
method creates a new user or updates an existing user.
See the User Management docs for more information.
Query string parameters: error_trace
, human
get_user()
$response = $es->xpack->security->get_user(
username => $username | \@usernames # optional
);
The get_user()
method retrieves info for the specified users (or all users).
See the User Management docs for more information.
Query string parameters: error_trace
, human
delete_user()
$response = $es->xpack->security->delete_user(
username => $username # required
);
The delete_user()
method deletes the specified user.
See the User Management docs for more information.
Query string parameters: error_trace
, human
change_password()
$response = $es->xpack->security->change_password(
username => $username # optional
body => {
password => $password # required
}
)
The change_password()
method changes the password for the specified user.
See the User Management docs for more information.
disable_user()
$response = $es->xpack->security->disable_user(
username => $username # required
);
The disable_user()
method disables the specified user.
See the User Management docs for more information.
Query string parameters: error_trace
, human
enable_user()
$response = $es->xpack->security->enable_user(
username => $username # required
);
The enable_user()
method enables the specified user.
See the User Management docs for more information.
Query string parameters: error_trace
, human
ROLE METHODS
put_role()
$response = $es->xpack->security->put_role(
name => $name, # required
body => {...} # required
);
The put_role()
method creates a new role or updates an existing role.
See the Role Management docs for more information.
Query string parameters: error_trace
, human
get_role()
$response = $es->xpack->security->get_role(
name => $name | \@names # optional
);
The get_role()
method retrieves info for the specified roles (or all roles).
See the Role Management docs for more information.
Query string parameters: error_trace
, human
delete_role()
$response = $es->xpack->security->delete_role(
name => $name # required
);
The delete_role()
method deletes the specified role.
See the Role Management docs for more information.
Query string parameters: error_trace
, human
clear_cached_roles()
$response = $es->xpack->security->clear_cached_roles(
names => $names # required (comma-separated string)
);
The clear_cached_roles()
method clears the caches for the specified roles.
See the Role Management docs for more information.
Query string parameters: error_trace
, human
ROLE MAPPING METHODS
put_role_mapping()
$response = $es->xpack->security->put_role_mapping(
name => $name, # required
body => {...} # required
);
The put_role_mapping()
method creates a new role mapping or updates an existing role mapping.
See the Role Mapping docs for more information.
Query string parameters: error_trace
, human
get_role_mapping()
$response = $es->xpack->security->get_role_mapping(
name => $name, # optional
);
The get_role_mapping()
method retrieves one or more role mappings.
See the Role Mapping docs for more information.
Query string parameters: error_trace
, human
delete_role_mapping()
$response = $es->xpack->security->delete_role_mapping(
name => $name, # required
);
The delete_role_mapping()
method deletes a role mapping.
See the Role Mapping docs for more information.
Query string parameters: error_trace
, human
TOKEN METHODS
get_token()
$response = $es->xpack->security->get_token(
body => {...} # required
);
The get_token()
method enables you to create bearer tokens for access without requiring basic authentication.
See the Token Management docs for more information.
Query string parameters: error_trace
, human
invalidate_token()
$response = $es->xpack->security->invalidate_token(
body => {...} # required
);
The invalidate_token()
method enables you to invalidate bearer tokens for access without requiring basic authentication.
See the Token Management docs for more information.
Query string parameters: error_trace
, human
AUTHOR
Clinton Gormley <drtech@cpan.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2017 by Elasticsearch BV.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004