33 explicit SecretsImp(
const std::string & path ) ;
34 std::string path()
const ;
35 GAuth::Secret serverSecret(
const std::string & encoding_type ,
const std::string &
id )
const ;
36 bool contains(
const std::string & mechanism )
const ;
55 return m_imp->path() ;
60 return m_imp->path() ;
70 return m_imp->serverSecret( encoding_type ,
id ) ;
75 return std::make_pair( std::string() , std::string() ) ;
80 return m_imp->contains( mechanism ) ;
85 GPop::SecretsImp::SecretsImp(
const std::string & path ) :
87 m_secrets( path ,
"pop-server" )
90 if( !m_secrets.valid() )
91 throw GPop::Secrets::OpenError(path) ;
94 std::string GPop::SecretsImp::path()
const
99 GAuth::Secret GPop::SecretsImp::serverSecret(
const std::string & encoding_type ,
const std::string &
id )
const
101 return m_secrets.serverSecret( encoding_type ,
id ) ;
104 bool GPop::SecretsImp::contains(
const std::string & mechanism )
const
106 return m_secrets.contains( mechanism ) ;
bool contains(const std::string &mechanism) const
Returns true if there is one or more secrets using the given mechanism.
virtual GAuth::Secret serverSecret(const std::string &encoding_type, const std::string &id) const override
Override from GSmtp::SaslServer::Secrets.
A simple interface for a store of secrets used in authentication.
virtual bool valid() const override
Override from GSmtp::Valid virtual base class.
Secrets(const std::string &storage_path=defaultPath())
Constructor.
A private pimple-pattern implementation class used by GPop::Secrets.
virtual ~Secrets()
Destructor.
virtual std::pair< std::string, std::string > serverTrust(const std::string &) const override
Override from GSmtp::SaslServer::Secrets.
std::string path() const
Returns the storage path.
virtual std::string source() const override
Override from GAuth::SaslServerSecrets.
Encapsulates a shared secret from the secrets file plus the associated userid.