MySQL 9.1.0
Source Code Documentation
sha2_password::SHA2_password_cache Class Reference

Password cache used for caching_sha2_authentication. More...

#include <i_sha2_password.h>

Public Types

typedef std::unordered_map< std::string, sha2_cache_entrypassword_cache
 

Public Member Functions

 SHA2_password_cache ()=default
 
 ~SHA2_password_cache ()
 Destructor - Release all memory. More...
 
bool add (const std::string authorization_id, const sha2_cache_entry &entry_to_be_cached)
 Add an entry in cache We manage our own memory. More...
 
bool remove (const std::string authorization_id)
 Remove an entry from the cache. More...
 
bool search (const std::string authorization_id, sha2_cache_entry &cache_entry)
 Search an entry from the cache. More...
 
size_t size ()
 Returns number of cache entries present
More...
 
void clear_cache ()
 Clear the cache - Release all memory. More...
 

Private Attributes

password_cache m_password_cache
 

Detailed Description

Password cache used for caching_sha2_authentication.

Member Typedef Documentation

◆ password_cache

typedef std::unordered_map<std::string, sha2_cache_entry> sha2_password::SHA2_password_cache::password_cache

Constructor & Destructor Documentation

◆ SHA2_password_cache()

sha2_password::SHA2_password_cache::SHA2_password_cache ( )
default

◆ ~SHA2_password_cache()

sha2_password::SHA2_password_cache::~SHA2_password_cache ( )

Destructor - Release all memory.

Member Function Documentation

◆ add()

bool sha2_password::SHA2_password_cache::add ( const std::string  authorization_id,
const sha2_cache_entry entry_to_be_cached 
)

Add an entry in cache We manage our own memory.

Parameters
[in]authorization_idKey
[in]entry_to_be_cachedValue
Returns
status of addition
Return values
falseSuccessful insertion
trueError

◆ clear_cache()

void sha2_password::SHA2_password_cache::clear_cache ( )

Clear the cache - Release all memory.

◆ remove()

bool sha2_password::SHA2_password_cache::remove ( const std::string  authorization_id)

Remove an entry from the cache.

Parameters
[in]authorization_idAuthID to search against
Returns
out of the deletion
Return values
falseEntry successfully removed
trueError removing the entry

◆ search()

bool sha2_password::SHA2_password_cache::search ( const std::string  authorization_id,
sha2_cache_entry cache_entry 
)

Search an entry from the cache.

Parameters
[in]authorization_idAuthID to search against
[out]cache_entryStored Password for given AuthID

Assumption : Memory for password is allocated by the caller.

Returns
Status of search operation
Return values
falseEntry found. Password contains the stored credential
trueEntry not found.

◆ size()

size_t sha2_password::SHA2_password_cache::size ( )
inline

Returns number of cache entries present

Member Data Documentation

◆ m_password_cache

password_cache sha2_password::SHA2_password_cache::m_password_cache
private

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