All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
as_admin.h File Reference
#include <aerospike/aerospike.h>
#include <aerospike/as_config.h>
#include <aerospike/as_key.h>
#include <aerospike/as_socket.h>
+ Include dependency graph for as_admin.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  as_privilege
 
struct  as_role
 
struct  as_user
 

Macros

#define AS_ROLE_SIZE   32
 

Enumerations

enum  as_privilege_code {
  AS_PRIVILEGE_USER_ADMIN = 0, AS_PRIVILEGE_SYS_ADMIN = 1, AS_PRIVILEGE_DATA_ADMIN = 2, AS_PRIVILEGE_READ = 10,
  AS_PRIVILEGE_READ_WRITE = 11, AS_PRIVILEGE_READ_WRITE_UDF = 12
}
 

Functions

as_status aerospike_change_password (aerospike *as, as_error *err, const as_policy_admin *policy, const char *user_name, const char *password)
 
as_status aerospike_create_role (aerospike *as, as_error *err, const as_policy_admin *policy, const char *role, as_privilege **privileges, int privileges_size)
 
as_status aerospike_create_user (aerospike *as, as_error *err, const as_policy_admin *policy, const char *user_name, const char *password, const char **roles, int roles_size)
 
as_status aerospike_drop_role (aerospike *as, as_error *err, const as_policy_admin *policy, const char *role)
 
as_status aerospike_drop_user (aerospike *as, as_error *err, const as_policy_admin *policy, const char *user_name)
 
as_status aerospike_grant_privileges (aerospike *as, as_error *err, const as_policy_admin *policy, const char *role, as_privilege **privileges, int privileges_size)
 
as_status aerospike_grant_roles (aerospike *as, as_error *err, const as_policy_admin *policy, const char *user_name, const char **roles, int roles_size)
 
as_status aerospike_query_role (aerospike *as, as_error *err, const as_policy_admin *policy, const char *role_name, as_role **role)
 
as_status aerospike_query_roles (aerospike *as, as_error *err, const as_policy_admin *policy, as_role ***roles, int *roles_size)
 
as_status aerospike_query_user (aerospike *as, as_error *err, const as_policy_admin *policy, const char *user_name, as_user **user)
 
as_status aerospike_query_users (aerospike *as, as_error *err, const as_policy_admin *policy, as_user ***users, int *users_size)
 
as_status aerospike_revoke_privileges (aerospike *as, as_error *err, const as_policy_admin *policy, const char *role, as_privilege **privileges, int privileges_size)
 
as_status aerospike_revoke_roles (aerospike *as, as_error *err, const as_policy_admin *policy, const char *user_name, const char **roles, int roles_size)
 
as_status aerospike_set_password (aerospike *as, as_error *err, const as_policy_admin *policy, const char *user_name, const char *password)
 
as_status as_authenticate (as_error *err, as_socket *sock, struct as_node_s *node, const char *user, const char *credential, uint32_t socket_timeout, uint64_t deadline_ms)
 
uint32_t as_authenticate_set (const char *user, const char *credential, uint8_t *buffer)
 
void as_role_destroy (as_role *role)
 
void as_roles_destroy (as_role **roles, int roles_size)
 
void as_user_destroy (as_user *user)
 
void as_users_destroy (as_user **users, int users_size)
 

Macro Definition Documentation

#define AS_ROLE_SIZE   32

Maximum size of role string including null byte.

Definition at line 35 of file as_admin.h.

Enumeration Type Documentation

Permission codes define the type of permission granted for a user's role.

Enumerator
AS_PRIVILEGE_USER_ADMIN 

User can edit/remove other users. Global scope only.

AS_PRIVILEGE_SYS_ADMIN 

User can perform systems administration functions on a database that do not involve user administration. Examples include setting dynamic server configuration. Global scope only.

AS_PRIVILEGE_DATA_ADMIN 

User can perform data administration functions on a database that do not involve user administration. Examples include create/drop index and user defined functions. Global scope only.

AS_PRIVILEGE_READ 

User can read data only.

AS_PRIVILEGE_READ_WRITE 

User can read and write data.

AS_PRIVILEGE_READ_WRITE_UDF 

User can read and write data through user defined functions.

Definition at line 44 of file as_admin.h.

Function Documentation

as_status aerospike_change_password ( aerospike as,
as_error err,
const as_policy_admin policy,
const char *  user_name,
const char *  password 
)

Change user's password by user. Clear-text password will be hashed using bcrypt before sending to server.

as_status aerospike_create_role ( aerospike as,
as_error err,
const as_policy_admin policy,
const char *  role,
as_privilege **  privileges,
int  privileges_size 
)

Create user defined role.

as_status aerospike_create_user ( aerospike as,
as_error err,
const as_policy_admin policy,
const char *  user_name,
const char *  password,
const char **  roles,
int  roles_size 
)

Create user with password and roles. Clear-text password will be hashed using bcrypt before sending to server.

as_status aerospike_drop_role ( aerospike as,
as_error err,
const as_policy_admin policy,
const char *  role 
)

Delete user defined role.

as_status aerospike_drop_user ( aerospike as,
as_error err,
const as_policy_admin policy,
const char *  user_name 
)

Remove user from cluster.

as_status aerospike_grant_privileges ( aerospike as,
as_error err,
const as_policy_admin policy,
const char *  role,
as_privilege **  privileges,
int  privileges_size 
)

Add specified privileges to user.

as_status aerospike_grant_roles ( aerospike as,
as_error err,
const as_policy_admin policy,
const char *  user_name,
const char **  roles,
int  roles_size 
)

Add role to user's list of roles.

as_status aerospike_query_role ( aerospike as,
as_error err,
const as_policy_admin policy,
const char *  role_name,
as_role **  role 
)

Retrieve role definition for a given role name. When successful, as_role_destroy() must be called to free resources.

as_status aerospike_query_roles ( aerospike as,
as_error err,
const as_policy_admin policy,
as_role ***  roles,
int *  roles_size 
)

Retrieve all roles and their privileges. When successful, as_roles_destroy() must be called to free resources.

as_status aerospike_query_user ( aerospike as,
as_error err,
const as_policy_admin policy,
const char *  user_name,
as_user **  user 
)

Retrieve roles for a given user. When successful, as_user_destroy() must be called to free resources.

as_status aerospike_query_users ( aerospike as,
as_error err,
const as_policy_admin policy,
as_user ***  users,
int *  users_size 
)

Retrieve all users and their roles. When successful, as_users_destroy() must be called to free resources.

as_status aerospike_revoke_privileges ( aerospike as,
as_error err,
const as_policy_admin policy,
const char *  role,
as_privilege **  privileges,
int  privileges_size 
)

Remove specified privileges from user.

as_status aerospike_revoke_roles ( aerospike as,
as_error err,
const as_policy_admin policy,
const char *  user_name,
const char **  roles,
int  roles_size 
)

Remove role from user's list of roles.

as_status aerospike_set_password ( aerospike as,
as_error err,
const as_policy_admin policy,
const char *  user_name,
const char *  password 
)

Set user's password by user administrator. Clear-text password will be hashed using bcrypt before sending to server.

as_status as_authenticate ( as_error err,
as_socket sock,
struct as_node_s *  node,
const char *  user,
const char *  credential,
uint32_t  socket_timeout,
uint64_t  deadline_ms 
)
private

Authenticate user with a server node. This is done automatically after socket open. Do not use this method directly.

uint32_t as_authenticate_set ( const char *  user,
const char *  credential,
uint8_t *  buffer 
)
private

Write authentication command to buffer. Return buffer length.

void as_role_destroy ( as_role role)

Release as_role memory.

void as_roles_destroy ( as_role **  roles,
int  roles_size 
)

Release memory for as_role array.

void as_user_destroy ( as_user user)

Release as_user_roles memory.

void as_users_destroy ( as_user **  users,
int  users_size 
)

Release memory for as_user_roles array.