A simple interface to a store of secrets as used in authentication. More...
#include <gpopsecrets.h>
Public Member Functions | |
Secrets (const std::string &storage_path=defaultPath()) | |
Constructor. More... | |
virtual | ~Secrets () |
Destructor. More... | |
std::string | path () const |
Returns the storage path. More... | |
virtual bool | valid () const |
Returns true. More... | |
virtual std::string | source () const |
Returns the storage path, as passed in to the constructor. More... | |
virtual std::string | secret (const std::string &mechanism, const std::string &id) const |
Returns the given user's secret. More... | |
bool | contains (const std::string &mechanism) const |
Returns true if there is one or more secrets using the given mechanism. More... | |
Public Member Functions inherited from GAuth::Valid | |
virtual | ~Valid () |
Destructor. More... | |
Static Public Member Functions | |
static std::string | defaultPath () |
Returns the default path. More... | |
A simple interface to a store of secrets as used in authentication.
Definition at line 44 of file gpopsecrets.h.
|
explicit |
Constructor.
In principle the storage_path can be a path to a file, a database connection string, etc. Throws on error.
Definition at line 43 of file gpopsecrets.cpp.
|
virtual |
Destructor.
Reimplemented from GAuth::SaslServer::Secrets.
Definition at line 48 of file gpopsecrets.cpp.
|
virtual |
Returns true if there is one or more secrets using the given mechanism.
Implements GAuth::SaslServer::Secrets.
Definition at line 73 of file gpopsecrets.cpp.
|
static |
Returns the default path.
Definition at line 26 of file gpopsecrets_unix.cpp.
References G_SYSCONFDIR, path(), G::Path::pathAppend(), and G::Path::str().
Referenced by Main::Configuration::popSecretsFile(), and Main::CommandLineImp::switchSpec().
std::string GPop::Secrets::path | ( | ) | const |
Returns the storage path.
Definition at line 53 of file gpopsecrets.cpp.
Referenced by defaultPath().
|
virtual |
Returns the given user's secret.
Returns the empty string if not a valid id.
Final override from GSmtp::SaslServer::Secrets.
Implements GAuth::SaslServer::Secrets.
Definition at line 68 of file gpopsecrets.cpp.
|
virtual |
Returns the storage path, as passed in to the constructor.
Final override from GAuth::SaslServer::Secrets.
Implements GAuth::SaslServer::Secrets.
Definition at line 58 of file gpopsecrets.cpp.
|
virtual |
Returns true.
Final override from GSmtp::Valid virtual base class.
Implements GAuth::Valid.
Definition at line 63 of file gpopsecrets.cpp.