21#ifndef G_SASL_SERVER_H
22#define G_SASL_SERVER_H
128 virtual std::string
apply(
const std::string & response ,
bool & done ) = 0 ;
142 virtual std::string
id()
const = 0 ;
147 const std::string & address_display )
const = 0 ;
An interface for implementing the server-side SASL challenge/response concept.
virtual std::string apply(const std::string &response, bool &done)=0
Applies the client response and returns the next challenge and a 'done' flag by reference.
virtual bool init(bool secure, const std::string &mechanism)=0
Initialiser for the given mechanism.
virtual bool mustChallenge() const =0
Returns true if authentication using the current mechanism must always start with a non-empty server ...
virtual bool trusted(const G::StringArray &address_wildcards, const std::string &address_display) const =0
Returns true if a trusted client that does not need to authenticate.
virtual std::string id() const =0
Returns the authenticated or trusted identity.
virtual std::string preferredMechanism(bool secure) const =0
Returns a preferred mechanism if authentication with the current mechanism has failed.
virtual G::StringArray mechanisms(bool secure) const =0
Returns a list of supported, standard mechanisms that can be advertised to the client.
virtual std::string mechanism() const =0
Returns the current mechanism, as selected by the last successful init().
virtual ~SaslServer()=default
Destructor.
virtual bool authenticated() const =0
Returns true if authenticated sucessfully.
virtual std::string initialChallenge() const =0
Returns the possibly-empty initial server challenge.
virtual void reset()=0
Clears the internal state as if just constructed.
SASL authentication classes.
std::vector< std::string > StringArray
A std::vector of std::strings.