saslhandler.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. #ifndef THIRD_PARTY_LIBJINGLE_XMPP_XMPP_SASLHANDLER_H_
  11. #define THIRD_PARTY_LIBJINGLE_XMPP_XMPP_SASLHANDLER_H_
  12. #include <string>
  13. #include <vector>
  14. namespace jingle_xmpp {
  15. class XmlElement;
  16. class SaslMechanism;
  17. // Creates mechanisms to deal with a given mechanism
  18. class SaslHandler {
  19. public:
  20. // Intended to be subclassed
  21. virtual ~SaslHandler() {}
  22. // Should pick the best method according to this handler
  23. // returns the empty string if none are suitable
  24. virtual std::string ChooseBestSaslMechanism(const std::vector<std::string> & mechanisms, bool encrypted) = 0;
  25. // Creates a SaslMechanism for the given mechanism name (you own it
  26. // once you get it).
  27. // If not handled, return NULL.
  28. virtual SaslMechanism * CreateSaslMechanism(const std::string & mechanism) = 0;
  29. };
  30. }
  31. #endif // THIRD_PARTY_LIBJINGLE_XMPP_XMPP_SASLHANDLER_H_