10 #include <boost/algorithm/string.hpp>
11 #include <pion/net/HTTPAuth.hpp>
12 #include <pion/net/HTTPServer.hpp>
26 PION_LOG_INFO(
m_logger,
"Set authentication restrictions for HTTP resource: " << clean_resource);
34 PION_LOG_INFO(
m_logger,
"Set authentication permission for HTTP resource: " << clean_resource);
66 const std::string& resource)
const
68 AuthResourceSet::const_iterator i = resource_set.upper_bound(resource);
69 while (i != resource_set.begin()) {
72 if (i->empty() || resource.compare(0, i->size(), *i) == 0) {
75 if (resource.size() == i->size() || resource[i->size()]==
'/') {
PionUserManagerPtr m_user_manager
container used to manager user objects
AuthResourceSet m_white_list
collection of resources that do NOT require authentication
PionLogger m_logger
primary logging interface used by this class
static std::string stripTrailingSlash(const std::string &str)
bool findResource(const AuthResourceSet &resource_set, const std::string &resource) const
void addPermit(const std::string &resource)
boost::mutex m_resource_mutex
mutex used to protect access to the resources
AuthResourceSet m_restrict_list
collection of resources that require authentication
void addRestrict(const std::string &resource)
the following enables use of the lock-free cache
bool needAuthentication(HTTPRequestPtr const &http_request) const
std::set< std::string > AuthResourceSet
data type for a set of resources to be authenticated