6#ifndef QXMPPSASLMANAGER_P_H
7#define QXMPPSASLMANAGER_P_H
9#include "QXmppAuthenticationError.h"
10#include "QXmppOutgoingClient.h"
11#include "QXmppPromise.h"
12#include "QXmppSasl_p.h"
20namespace QXmpp::Private {
22class SendDataInterface;
28 using AuthError = std::pair<QString, AuthenticationError>;
29 using AuthResult = std::variant<Success, AuthError>;
30 static constexpr QStringView TaskName = u
"SASL 1 authentication";
32 explicit SaslManager(SendDataInterface *socket) : m_socket(socket) { }
35 HandleElementResult handleElement(
const QDomElement &el);
38 SendDataInterface *m_socket;
39 std::unique_ptr<QXmppSaslClient> m_saslClient;
40 std::optional<QXmppPromise<AuthResult>> m_promise;
47 using AuthError = std::pair<QString, AuthenticationError>;
48 using AuthResult = std::variant<Sasl2::Success, AuthError>;
49 static constexpr QStringView TaskName = u
"SASL 2 authentication";
51 explicit Sasl2Manager(SendDataInterface *socket) : m_socket(socket) { }
54 HandleElementResult handleElement(
const QDomElement &);
58 std::unique_ptr<QXmppSaslClient> sasl;
60 std::optional<Sasl2::Continue> unsupportedContinue;
63 SendDataInterface *m_socket;
64 std::optional<State> m_state;
74 bool hasToken()
const;
75 void onSasl2Authenticate(Sasl2::Authenticate &auth,
const Sasl2::StreamFeature &feature);
76 void onSasl2Success(
const Sasl2::Success &success);
77 bool tokenChanged()
const {
return m_tokenChanged; }
81 std::optional<SaslHtMechanism> requestedMechanism;
82 bool m_tokenChanged =
false;
The QXmppConfiguration class holds configuration options.
Definition QXmppConfiguration.h:37
The QXmppLoggable class represents a source of logging messages.
Definition QXmppLogger.h:110
Create and update QXmppTask objects to communicate results of asynchronous operations.
Definition QXmppPromise.h:23
The QXmppStreamFeatures class represents the features returned by an XMPP server or client.
Definition QXmppStreamFeatures.h:23
Definition QXmppTask.h:46