10 #include <boost/algorithm/string.hpp> 11 #include <pion/http/auth.hpp> 12 #include <pion/http/server.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 resource_set_type::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()]==
'/') {
user_manager_ptr m_user_manager
container used to manager user objects
resource_set_type m_white_list
collection of resources that do NOT require authentication
bool find_resource(const resource_set_type &resource_set, const std::string &resource) const
boost::mutex m_resource_mutex
mutex used to protect access to the resources
static std::string strip_trailing_slash(const std::string &str)
logger m_logger
primary logging interface used by this class
bool need_authentication(http::request_ptr const &http_request_ptr) const
void add_permit(const std::string &resource)
void add_restrict(const std::string &resource)
std::set< std::string > resource_set_type
data type for a set of resources to be authenticated
resource_set_type m_restrict_list
collection of resources that require authentication