PageRenderTime 22ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/mordor/http/digest.h

http://github.com/mozy/mordor
C Header | 43 lines | 32 code | 9 blank | 2 comment | 0 complexity | 3e8c69e66462381d14c211e59ef2e9f7 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. #ifndef __MORDOR_HTTP_DIGEST_AUTH_H__
  2. #define __MORDOR_HTTP_DIGEST_AUTH_H__
  3. // Copyright (c) 2009 - Mozy, Inc.
  4. #include "http.h"
  5. namespace Mordor {
  6. namespace HTTP {
  7. namespace DigestAuth {
  8. struct InvalidParamsException : virtual InvalidMessageHeaderException {};
  9. struct InvalidQopException : virtual InvalidParamsException
  10. {
  11. public:
  12. InvalidQopException(const std::string &message) : m_message(message) {}
  13. ~InvalidQopException() throw() {}
  14. const char *what() const throw() { return m_message.c_str(); }
  15. private:
  16. std::string m_message;
  17. };
  18. struct InvalidAlgorithmException : virtual InvalidParamsException
  19. {
  20. public:
  21. InvalidAlgorithmException(const std::string &message) : m_message(message) {}
  22. ~InvalidAlgorithmException() throw() {}
  23. const char *what() const throw() { return m_message.c_str(); }
  24. private:
  25. std::string m_message;
  26. };
  27. void authorize(const AuthParams &challenge, AuthParams &authorization,
  28. const URI &uri, const std::string &method, const std::string &username,
  29. const std::string &password);
  30. /// @deprecated
  31. void authorize(const Response &challenge, Request &nextRequest,
  32. const std::string &username, const std::string &password);
  33. }}}
  34. #endif