MySQL 8.4.0
Source Code Documentation
mysql_harness::FakeRandomGenerator Class Reference

#include <random_generator.h>

Inheritance diagram for mysql_harness::FakeRandomGenerator:
[legend]

Public Member Functions

std::string generate_identifier (unsigned length, unsigned) override
 Generates a random string out of selected alphabet. More...
 
std::string generate_strong_password (unsigned length) override
 Generates a random password that adheres to the STRONG password requirements: More...
 
- Public Member Functions inherited from mysql_harness::RandomGeneratorInterface
 RandomGeneratorInterface ()=default
 
 RandomGeneratorInterface (const RandomGeneratorInterface &)=default
 
RandomGeneratorInterfaceoperator= (const RandomGeneratorInterface &)=default
 
virtual ~RandomGeneratorInterface ()
 

Additional Inherited Members

- Public Types inherited from mysql_harness::RandomGeneratorInterface
enum  AlphabetContent : unsigned {
  AlphabetDigits = 0x1 , AlphabetLowercase = 0x2 , AlphabetUppercase = 0x4 , AlphabetSpecial = 0x8 ,
  AlphabetAll = 0xFF
}
 

Member Function Documentation

◆ generate_identifier()

std::string mysql_harness::FakeRandomGenerator::generate_identifier ( unsigned  length,
unsigned  alphabet_mask 
)
overridevirtual

Generates a random string out of selected alphabet.

Parameters
lengthlength of string requested
alphabet_maskbitmasmask indicating which alphabet symbol groups should be used for identifier generation (see AlphabetContent enum for possible values that can be or-ed)
Returns
string with the generated random chars
Exceptions
std::invalid_argumentwhen the alphabet_mask is empty or invalid

Implements mysql_harness::RandomGeneratorInterface.

◆ generate_strong_password()

std::string mysql_harness::FakeRandomGenerator::generate_strong_password ( unsigned  length)
overridevirtual

Generates a random password that adheres to the STRONG password requirements:

  • contains at least 1 digit
  • contains at least 1 uppercase letter
  • contains at least 1 lowercase letter
  • contains at least 1 special character
Parameters
lengthlength of requested password (should be at least 8)
Returns
string with the generated password
Exceptions
std::invalid_argumentwhen the requested length is less than 8

Implements mysql_harness::RandomGeneratorInterface.


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