21#ifndef G_AUTH_SECRET_H
22#define G_AUTH_SECRET_H
44 G_EXCEPTION( Error ,
"invalid authorisation secret" ) ;
45 G_EXCEPTION( BadId ,
"invalid authorisation id" ) ;
47 Secret(
const std::string & secret ,
const std::string & secret_encoding ,
48 const std::string &
id ,
bool id_encoding_xtext ,
49 const std::string & context = std::string() ) ;
53 static std::string
check(
const std::string & secret ,
const std::string & secret_encoding ,
54 const std::string &
id ,
bool id_encoding_xtext ) ;
61 std::string
key()
const ;
71 std::string
id()
const ;
82 std::string
info(
const std::string &
id = std::string() )
const ;
88 explicit Secret(
const std::string & ) ;
89 static bool isDotted(
const std::string & ) ;
90 static std::string undotted(
const std::string & ) ;
93 std::string m_server_type ;
95 std::string m_mask_type ;
97 std::string m_context ;
Encapsulates a shared secret from the secrets file plus the associated userid.
bool masked() const
Returns true if key() is masked.
static Secret none()
Factory function that returns a secret that is not valid() and has an empty id().
bool valid() const
Returns true if the secret is valid.
static std::string check(const std::string &secret, const std::string &secret_encoding, const std::string &id, bool id_encoding_xtext)
Does a non-throwing check of the constructor parameters, returning an error message or the empty stri...
std::string info(const std::string &id=std::string()) const
Returns information for logging, excluding anything sensitive.
std::string maskType() const
Returns the masking function name, such as "MD5", or the empty string if not masked().
std::string id() const
Returns the associated identity. Throws if not valid().
std::string key() const
Returns the key. Throws if not valid().
SASL authentication classes.