Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1139)

Unified Diff: third_party/libjingle_xmpp/xmpp/xmppauth.h

Issue 2443903004: Add xmllite and xmpp sources to third_party/ (Closed)
Patch Set: Fix GN and sort includes Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/libjingle_xmpp/xmpp/xmppauth.h
diff --git a/third_party/libjingle_xmpp/xmpp/xmppauth.h b/third_party/libjingle_xmpp/xmpp/xmppauth.h
new file mode 100644
index 0000000000000000000000000000000000000000..eaacdff8a04e7f1868fda525d1c2aa50d6886ec1
--- /dev/null
+++ b/third_party/libjingle_xmpp/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/libjingle_xmpp/xmpp/jid.h"
+#include "third_party/libjingle_xmpp/xmpp/prexmppauth.h"
+#include "third_party/libjingle_xmpp/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_
+

Powered by Google App Engine
This is Rietveld 408576698