GSmtp::Secrets Class Reference

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

#include <gsecrets.h>

Inheritance diagram for GSmtp::Secrets:

GSmtp::SaslClient::Secrets GSmtp::SaslServer::Secrets GSmtp::Valid GSmtp::Valid

List of all members.

Public Member Functions

 Secrets (const std::string &storage_path, const std::string &debug_name, const std::string &server_type=std::string())
 Constructor.
 Secrets ()
 Default constructor for an in-valid(), empty-path object.
virtual ~Secrets ()
 Destructor.
virtual bool valid () const
 Final override from GSmtp::Valid virtual base.
virtual std::string id (const std::string &mechanism) const
 Final override from GSmtp::SaslClient::Secrets.
virtual std::string secret (const std::string &mechanism) const
 Final override from GSmtp::SaslClient::Secrets.
virtual std::string secret (const std::string &mechanism, const std::string &id) const
 Final override from GSmtp::SaslServer::Secrets.
virtual bool contains (const std::string &mechanism) const
 Final override from GSmtp::SaslServer::Secrets.


Detailed Description

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

The default implementation uses a flat file.

See also:
GSmtp::SaslClient, GSmtp::SaslServer

Definition at line 43 of file gsecrets.h.


Constructor & Destructor Documentation

GSmtp::Secrets::Secrets ( const std::string &  storage_path,
const std::string &  debug_name,
const std::string &  server_type = std::string() 
)

Constructor.

In principle the repository 'storage-path' can be a path to a file, a database connection string, etc.

The 'debug-name' is used in log and error messages to identify the repository.

The 'server-type' parameter can be used to select a different set of server-side authentication records that may be stored in the same repository.

Throws on error, although an empty path is not considered an error: see valid().

Definition at line 77 of file gsecrets_full.cpp.

GSmtp::Secrets::Secrets (  ) 

Default constructor for an in-valid(), empty-path object.

Definition at line 82 of file gsecrets_full.cpp.

GSmtp::Secrets::~Secrets (  )  [virtual]

Destructor.

Reimplemented from GSmtp::SaslServer::Secrets.

Definition at line 87 of file gsecrets_full.cpp.


Member Function Documentation

bool GSmtp::Secrets::valid (  )  const [virtual]

Final override from GSmtp::Valid virtual base.

The implementation returns false if the path was empty.

Implements GSmtp::Valid.

Definition at line 92 of file gsecrets_full.cpp.

References GSmtp::SecretsImp::valid().

Referenced by GPop::SecretsImp::SecretsImp().

std::string GSmtp::Secrets::id ( const std::string &  mechanism  )  const [virtual]

Final override from GSmtp::SaslClient::Secrets.

Returns the default id for client-side authentication.

Implements GSmtp::SaslClient::Secrets.

Definition at line 97 of file gsecrets_full.cpp.

References GSmtp::SecretsImp::id().

std::string GSmtp::Secrets::secret ( const std::string &  mechanism  )  const [virtual]

Final override from GSmtp::SaslClient::Secrets.

Returns the default secret for client-side authentication.

Implements GSmtp::SaslClient::Secrets.

Definition at line 102 of file gsecrets_full.cpp.

References GSmtp::SecretsImp::secret().

Referenced by GPop::SecretsImp::secret().

std::string GSmtp::Secrets::secret ( const std::string &  mechanism,
const std::string &  id 
) const [virtual]

Final override from GSmtp::SaslServer::Secrets.

Returns the given user's secret for server-side authentication. Returns the empty string if not a valid id.

Implements GSmtp::SaslServer::Secrets.

Definition at line 107 of file gsecrets_full.cpp.

References GSmtp::SecretsImp::secret().

bool GSmtp::Secrets::contains ( const std::string &  mechanism  )  const [virtual]

Final override from GSmtp::SaslServer::Secrets.

Returns true if there is one or more server secrets using the given mechanism. This can be used to limit the list of mechanisms advertised by a server.

Implements GSmtp::SaslServer::Secrets.

Definition at line 112 of file gsecrets_full.cpp.

References GSmtp::SecretsImp::contains().

Referenced by GPop::SecretsImp::contains().


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

Generated on Fri Apr 18 15:56:14 2008 for E-MailRelay by  doxygen 1.5.5