21#ifndef G_AUTH_SECRETS_H
22#define G_AUTH_SECRETS_H
38 class SecretsFileClient ;
39 class SecretsFileServer ;
49 G_EXCEPTION( ClientAccountError ,
tx(
"invalid client account details") )
51 static void check(
const std::string & client ,
const std::string & server ,
const std::string & pop ) ;
55 static std::unique_ptr<SaslServerSecrets>
newServerSecrets(
const std::string & spec ,
56 const std::string & log_name ) ;
62 static std::unique_ptr<SaslClientSecrets>
newClientSecrets(
const std::string & spec ,
63 const std::string & log_name ) ;
80 SecretsFileClient(
const std::string & path_spec ,
const std::string & log_name ) ;
93 bool validSelector( std::string_view selector )
const override ;
94 bool mustAuthenticate( std::string_view selector )
const override ;
95 Secret clientSecret( std::string_view type , std::string_view selector )
const override ;
124 bool valid()
const override ;
125 Secret serverSecret( std::string_view type , std::string_view
id )
const override ;
126 std::pair<std::string,std::string> serverTrust(
const std::string & address_range )
const override ;
127 std::string source()
const override ;
128 bool contains( std::string_view type , std::string_view
id )
const override ;
An interface used by GAuth::SaslClient to obtain a client id and its authentication secret.
An interface used by GAuth::SaslServer to obtain authentication secrets.
Encapsulates a userid/shared-secret/hash-function tuple from the secrets file.
A thin adapter between GAuth::SecretsFile and GAuth::SaslClientSecrets returned by GAuth::Secrets::ne...
~SecretsFileClient() override
Destructor.
SecretsFileClient(const std::string &path_spec, const std::string &log_name)
Constructor. See GAuth::Secrets::newClientSecrets().
A thin adapter between GAuth::SecretsFile and GAuth::SaslServerSecrets returned by GAuth::Secrets::ne...
~SecretsFileServer() override
Destructor.
SecretsFileServer(const std::string &path, const std::string &log_name)
Constructor. See GAuth::Secrets::newServerSecrets().
A class to read authentication secrets from file, used by GAuth::Secrets.
Provides factory functions for client and server secrets objects.
static std::unique_ptr< SaslServerSecrets > newServerSecrets(const std::string &spec, const std::string &log_name)
Factory function for server secrets.
static void check(const std::string &client, const std::string &server, const std::string &pop)
Checks the given secret sources.
static std::unique_ptr< SaslClientSecrets > newClientSecrets(const std::string &spec, const std::string &log_name)
Factory function for client secrets.
SASL authentication classes.
constexpr const char * tx(const char *p) noexcept
A briefer alternative to G::gettext_noop().