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>;
31 explicit SaslManager(SendDataInterface *socket) : m_socket(socket) { }
34 HandleElementResult handleElement(
const QDomElement &el);
37 SendDataInterface *m_socket;
38 std::unique_ptr<QXmppSaslClient> m_saslClient;
39 std::optional<QXmppPromise<AuthResult>> m_promise;
46 using AuthError = std::pair<QString, AuthenticationError>;
47 using AuthResult = std::variant<Sasl2::Success, AuthError>;
49 explicit Sasl2Manager(SendDataInterface *socket) : m_socket(socket) { }
52 HandleElementResult handleElement(
const QDomElement &);
56 std::unique_ptr<QXmppSaslClient> sasl;
58 std::optional<Sasl2::Continue> unsupportedContinue;
61 SendDataInterface *m_socket;
62 std::optional<State> m_state;
72 bool hasToken()
const;
73 void onSasl2Authenticate(Sasl2::Authenticate &auth,
const Sasl2::StreamFeature &feature);
74 void onSasl2Success(
const Sasl2::Success &success);
75 bool tokenChanged()
const {
return m_tokenChanged; }
79 std::optional<SaslHtMechanism> requestedMechanism;
80 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
The QXmppStreamFeatures class represents the features returned by an XMPP server or client.
Definition: QXmppStreamFeatures.h:23
Definition: QXmppTask.h:62