E-MailRelay
|
A simple interface for a store of secrets used in authentication. More...
#include <gsecrets.h>
Public Member Functions | |
Secrets (const std::string &source_storage_path, const std::string &debug_name) | |
Constructor. More... | |
Secrets () | |
Default constructor for an in-valid(), empty-path object. More... | |
bool | valid () const override |
Override from GAuth::Valid virtual base. More... | |
Secret | serverSecret (const std::string &type, const std::string &id) const override |
Override from GAuth::SaslServerSecrets. More... | |
bool | contains (const std::string &type) const override |
Override from GAuth::SaslServerSecrets. More... | |
Secrets (const Secrets &)=delete | |
Secrets (Secrets &&)=delete | |
void | operator= (const Secrets &)=delete |
void | operator= (Secrets &&)=delete |
virtual Secret | clientSecret (const std::string &type) const =0 |
Returns the client secret for the given type. More... | |
![]() | |
virtual bool | valid () const =0 |
Returns true if a valid source of information. More... | |
virtual | ~Valid ()=default |
Destructor. | |
virtual Secret | serverSecret (const std::string &type, const std::string &id) const =0 |
Returns the server secret for the given client id. More... | |
virtual std::pair< std::string, std::string > | serverTrust (const std::string &address_range) const =0 |
Returns a non-empty trustee name if the server trusts the given address range (eg. More... | |
virtual std::string | source () const =0 |
Returns the source identifier (eg. file name). | |
virtual bool | contains (const std::string &mechanism) const =0 |
Returns true if any user has a secret encoded for the given mechanism. More... | |
Static Public Member Functions | |
static void | check (const std::string &, const std::string &, const std::string &) |
Checks the given secret sources. More... | |
A simple interface for a store of secrets used in authentication.
The default implementation uses a flat file.
Definition at line 40 of file gsecrets.h.
GAuth::Secrets::Secrets | ( | const std::string & | source_storage_path, |
const std::string & | debug_name | ||
) |
Constructor.
The connection string is a secrets file path or "/pam".
The 'debug-name' is used in log and error messages to identify the repository.
Throws on error, although an empty path is not considered an error: see valid().
Definition at line 40 of file gsecrets.cpp.
GAuth::Secrets::Secrets | ( | ) |
Default constructor for an in-valid(), empty-path object.
Definition at line 48 of file gsecrets.cpp.
|
static |
Checks the given secret sources.
Logs warnings and throws an exception if there are any fatal errors.
Definition at line 27 of file gsecrets.cpp.
|
overridevirtual |
Override from GAuth::SaslServerSecrets.
Implements GAuth::SaslServerSecrets.
Definition at line 82 of file gsecrets.cpp.
|
overridevirtual |
Override from GAuth::SaslServerSecrets.
Implements GAuth::SaslServerSecrets.
Definition at line 72 of file gsecrets.cpp.
|
overridevirtual |
Override from GAuth::Valid virtual base.
Implements GAuth::Valid.
Definition at line 62 of file gsecrets.cpp.