Home | History | Annotate | Download | only in xmpp
      1 /*
      2  *  Copyright 2004 The WebRTC Project Authors. All rights reserved.
      3  *
      4  *  Use of this source code is governed by a BSD-style license
      5  *  that can be found in the LICENSE file in the root of the source
      6  *  tree. An additional intellectual property rights grant can be found
      7  *  in the file PATENTS.  All contributing project authors may
      8  *  be found in the AUTHORS file in the root of the source tree.
      9  */
     10 
     11 #ifndef WEBRTC_LIBJINGLE_XMPP_SASLHANDLER_H_
     12 #define WEBRTC_LIBJINGLE_XMPP_SASLHANDLER_H_
     13 
     14 #include <string>
     15 #include <vector>
     16 
     17 namespace buzz {
     18 
     19 class XmlElement;
     20 class SaslMechanism;
     21 
     22 // Creates mechanisms to deal with a given mechanism
     23 class SaslHandler {
     24 
     25 public:
     26 
     27   // Intended to be subclassed
     28   virtual ~SaslHandler() {}
     29 
     30   // Should pick the best method according to this handler
     31   // returns the empty string if none are suitable
     32   virtual std::string ChooseBestSaslMechanism(const std::vector<std::string> & mechanisms, bool encrypted) = 0;
     33 
     34   // Creates a SaslMechanism for the given mechanism name (you own it
     35   // once you get it).
     36   // If not handled, return NULL.
     37   virtual SaslMechanism * CreateSaslMechanism(const std::string & mechanism) = 0;
     38 };
     39 
     40 }
     41 
     42 #endif  // WEBRTC_LIBJINGLE_XMPP_SASLHANDLER_H_
     43