10 #ifndef __PION_HTTPBASICAUTH_HEADER__
11 #define __PION_HTTPBASICAUTH_HEADER__
15 #include <pion/PionConfig.hpp>
16 #include <pion/net/HTTPAuth.hpp>
17 #include <pion/PionDateTime.hpp>
33 HTTPBasicAuth(PionUserManagerPtr userManager,
const std::string& realm=
"PION:NET");
50 virtual bool handleRequest(HTTPRequestPtr& request, TCPConnectionPtr& tcp_conn);
60 virtual void setOption(
const std::string& name,
const std::string& value);
71 void handleUnauthorized(HTTPRequestPtr& http_request, TCPConnectionPtr& tcp_conn);
78 static bool parseAuthorization(std::string
const &authorization, std::string &credentials);
83 static bool parseCredentials(std::string
const &credentials, std::string &username, std::string &password);
89 typedef std::map<std::string,std::pair<PionDateTime,PionUserPtr> > PionUserCache;
92 static const unsigned int CACHE_EXPIRATION;
102 PionUserCache m_user_cache;
105 mutable boost::mutex m_cache_mutex;
virtual ~HTTPBasicAuth()
virtual destructor
boost::posix_time::ptime PionDateTime
PionDateTime is a typedef for boost::posix_time::ptime.