MySQL 9.1.0
Source Code Documentation
mysql_harness::RandomGeneratorInterface Class Referenceabstract

#include <random_generator.h>

Inheritance diagram for mysql_harness::RandomGeneratorInterface:
[legend]

Public Types

enum  AlphabetContent : unsigned {
  AlphabetDigits = 0x1 , AlphabetLowercase = 0x2 , AlphabetUppercase = 0x4 , AlphabetSpecial = 0x8 ,
  AlphabetAll = 0xFF
}
 

Public Member Functions

virtual std::string generate_identifier (unsigned length, unsigned alphabet_mask=AlphabetAll)=0
 Generates a random string out of selected alphabet. More...
 
virtual std::string generate_strong_password (unsigned length)=0
 Generates a random password that adheres to the STRONG password requirements: More...
 
 RandomGeneratorInterface ()=default
 
 RandomGeneratorInterface (const RandomGeneratorInterface &)=default
 
RandomGeneratorInterfaceoperator= (const RandomGeneratorInterface &)=default
 
virtual ~RandomGeneratorInterface ()
 

Member Enumeration Documentation

◆ AlphabetContent

Enumerator
AlphabetDigits 
AlphabetLowercase 
AlphabetUppercase 
AlphabetSpecial 
AlphabetAll 

Constructor & Destructor Documentation

◆ RandomGeneratorInterface() [1/2]

mysql_harness::RandomGeneratorInterface::RandomGeneratorInterface ( )
explicitdefault

◆ RandomGeneratorInterface() [2/2]

mysql_harness::RandomGeneratorInterface::RandomGeneratorInterface ( const RandomGeneratorInterface )
explicitdefault

◆ ~RandomGeneratorInterface()

mysql_harness::RandomGeneratorInterface::~RandomGeneratorInterface ( )
virtualdefault

Member Function Documentation

◆ generate_identifier()

virtual std::string mysql_harness::RandomGeneratorInterface::generate_identifier ( unsigned  length,
unsigned  alphabet_mask = AlphabetAll 
)
pure virtual

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

Implemented in mysql_harness::RandomGenerator, and mysql_harness::FakeRandomGenerator.

◆ generate_strong_password()

virtual std::string mysql_harness::RandomGeneratorInterface::generate_strong_password ( unsigned  length)
pure virtual

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

Implemented in mysql_harness::RandomGenerator, and mysql_harness::FakeRandomGenerator.

◆ operator=()

RandomGeneratorInterface & mysql_harness::RandomGeneratorInterface::operator= ( const RandomGeneratorInterface )
default

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