| Index: third_party/xmpp/xmppauth.h
|
| diff --git a/third_party/xmpp/xmppauth.h b/third_party/xmpp/xmppauth.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..073ab4aa2a6d4578c5a792e775a68c432be9a43e
|
| --- /dev/null
|
| +++ b/third_party/xmpp/xmppauth.h
|
| @@ -0,0 +1,55 @@
|
| +// Copyright 2004 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef WEBRTC_LIBJINGLE_XMPP_XMPPAUTH_H_
|
| +#define WEBRTC_LIBJINGLE_XMPP_XMPPAUTH_H_
|
| +
|
| +#include <vector>
|
| +
|
| +#include "third_party/xmpp/jid.h"
|
| +#include "third_party/xmpp/prexmppauth.h"
|
| +#include "third_party/xmpp/saslhandler.h"
|
| +#include "webrtc/base/cryptstring.h"
|
| +#include "webrtc/base/sigslot.h"
|
| +
|
| +class XmppAuth: public buzz::PreXmppAuth {
|
| +public:
|
| + XmppAuth();
|
| + virtual ~XmppAuth();
|
| +
|
| + // TODO: Just have one "secret" that is either pass or
|
| + // token?
|
| + virtual void StartPreXmppAuth(const buzz::Jid& jid,
|
| + const rtc::SocketAddress& server,
|
| + const rtc::CryptString& pass,
|
| + const std::string& auth_mechanism,
|
| + const std::string& auth_token);
|
| +
|
| + virtual bool IsAuthDone() const { return done_; }
|
| + virtual bool IsAuthorized() const { return true; }
|
| + virtual bool HadError() const { return false; }
|
| + virtual int GetError() const { return 0; }
|
| + virtual buzz::CaptchaChallenge GetCaptchaChallenge() const {
|
| + return buzz::CaptchaChallenge();
|
| + }
|
| + virtual std::string GetAuthMechanism() const { return auth_mechanism_; }
|
| + virtual std::string GetAuthToken() const { return auth_token_; }
|
| +
|
| + virtual std::string ChooseBestSaslMechanism(
|
| + const std::vector<std::string>& mechanisms,
|
| + bool encrypted);
|
| +
|
| + virtual buzz::SaslMechanism * CreateSaslMechanism(
|
| + const std::string& mechanism);
|
| +
|
| +private:
|
| + buzz::Jid jid_;
|
| + rtc::CryptString passwd_;
|
| + std::string auth_mechanism_;
|
| + std::string auth_token_;
|
| + bool done_;
|
| +};
|
| +
|
| +#endif // WEBRTC_LIBJINGLE_XMPP_XMPPAUTH_H_
|
| +
|
|
|