drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
auth_file::AuthFile Class Reference
Inheritance diagram for auth_file::AuthFile:
[legend]
Collaboration diagram for auth_file::AuthFile:
[legend]

Public Member Functions

 AuthFile (std::string users_file_arg)
const string & getError () const
std::string & getUsersFile ()
bool setUsersFile (std::string &usersFile)

Private Member Functions

bool authenticate (const identifier::User &sctx, const string &password)
bool verifyMySQLHash (const string &password, const string &scramble_bytes, const string &scrambled_password)
void setUsers (users_t)
void clearUsers ()

Private Attributes

string error
fs::path users_file
std::string sysvar_users_file
users_t users

Detailed Description

Definition at line 51 of file auth_file.cc.

Constructor & Destructor Documentation

◆ AuthFile()

auth_file::AuthFile::AuthFile ( std::string users_file_arg)

Definition at line 107 of file auth_file.cc.

Member Function Documentation

◆ authenticate()

bool auth_file::AuthFile::authenticate ( const identifier::User & sctx,
const string & password )
private

Base class method to check authentication for a user.

Definition at line 186 of file auth_file.cc.

◆ clearUsers()

void auth_file::AuthFile::clearUsers ( )
private

This method is called to delete all the cached username:password pairs when users file is updated.

Definition at line 201 of file auth_file.cc.

◆ getError()

const string & auth_file::AuthFile::getError ( ) const

Retrieve the last error encountered in the class.

Definition at line 113 of file auth_file.cc.

◆ getUsersFile()

std::string & auth_file::AuthFile::getUsersFile ( )

Definition at line 118 of file auth_file.cc.

◆ setUsers()

void auth_file::AuthFile::setUsers ( users_t users_dummy)
private

This method is called to update the users cache with the new username:password pairs given in new users file upon update.

Definition at line 196 of file auth_file.cc.

◆ setUsersFile()

bool auth_file::AuthFile::setUsersFile ( std::string & usersFile)

Definition at line 123 of file auth_file.cc.

◆ verifyMySQLHash()

bool auth_file::AuthFile::verifyMySQLHash ( const string & password,
const string & scramble_bytes,
const string & scrambled_password )
private

Verify the local and remote scrambled password match using the MySQL hashing algorithm.

Parameters
[in]passwordPlain text password that is stored locally.
[in]scramble_bytesThe random bytes that the server sent to the client for scrambling the password.
[in]scrambled_passwordThe result of the client scrambling the password remotely.
Returns
True if the password matched, false if not.

Definition at line 143 of file auth_file.cc.

Member Data Documentation

◆ error

string auth_file::AuthFile::error
private

Definition at line 86 of file auth_file.cc.

◆ sysvar_users_file

std::string auth_file::AuthFile::sysvar_users_file
private

Definition at line 88 of file auth_file.cc.

◆ users

users_t auth_file::AuthFile::users
private

Cache or username:password entries from the file.

Definition at line 93 of file auth_file.cc.

◆ users_file

fs::path auth_file::AuthFile::users_file
private

Definition at line 87 of file auth_file.cc.


The documentation for this class was generated from the following file: