21 #ifndef G_AUTH_SECRET__H
22 #define G_AUTH_SECRET__H
45 G_EXCEPTION( Error ,
"invalid authorisation secret" ) ;
47 Secret(
const std::string & ,
const std::string & ,
const std::string & ,
const std::string & = std::string() ) ;
50 static std::string
check(
const std::string & ,
const std::string & ,
const std::string & ) ;
57 std::string
key()
const ;
67 std::string
id()
const ;
78 std::string
info(
const std::string &
id = std::string() )
const ;
84 explicit Secret(
const std::string & ) ;
85 static bool isDotted(
const std::string & ) ;
86 static std::string undotted(
const std::string & ) ;
89 std::string m_server_type ;
91 std::string m_mask_type ;
93 std::string m_context ;
std::string key() const
Returns the key. Throws if not valid().
bool valid() const
Returns true if the secret is valid.
static std::string check(const std::string &, const std::string &, const std::string &)
Does a non-throwing check of the constructor parameters, returning an error or the empty string...
std::string info(const std::string &id=std::string()) const
Returns information for logging, excluding anything sensitive.
std::string id() const
Returns the associated identity. Throws if not valid().
static Secret none()
Factory function that returns a secret that is not valid() and has an empty id(). ...
bool masked() const
Returns true if key() is masked.
std::string maskType() const
Returns the masking function name, such as "MD5", or the empty string if not masked().
SASL authentication classes.
Encapsulates a shared secret from the secrets file plus the associated userid.