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