Public Member Functions | Static Public Member Functions | List of all members
GPop::Secrets Class Reference

A simple interface to a store of secrets as used in authentication. More...

#include <gpopsecrets.h>

Inheritance diagram for GPop::Secrets:
GAuth::SaslServer::Secrets GAuth::Valid

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...
 

Detailed Description

A simple interface to a store of secrets as used in authentication.

Definition at line 44 of file gpopsecrets.h.

Constructor & Destructor Documentation

GPop::Secrets::Secrets ( const std::string &  storage_path = defaultPath())
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.

GPop::Secrets::~Secrets ( )
virtual

Destructor.

Reimplemented from GAuth::SaslServer::Secrets.

Definition at line 48 of file gpopsecrets.cpp.

Member Function Documentation

bool GPop::Secrets::contains ( const std::string &  mechanism) const
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.

std::string GPop::Secrets::defaultPath ( )
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().

std::string GPop::Secrets::secret ( const std::string &  mechanism,
const std::string &  id 
) const
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.

std::string GPop::Secrets::source ( ) const
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.

bool GPop::Secrets::valid ( ) const
virtual

Returns true.

Final override from GSmtp::Valid virtual base class.

Implements GAuth::Valid.

Definition at line 63 of file gpopsecrets.cpp.


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