2 * Licensed to the University Corporation for Advanced Internet
3 * Development, Inc. (UCAID) under one or more contributor license
4 * agreements. See the NOTICE file distributed with this work for
5 * additional information regarding copyright ownership.
7 * UCAID licenses this file to you under the Apache License,
8 * Version 2.0 (the "License"); you may not use this file except
9 * in compliance with the License. You may obtain a copy of the
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
17 * either express or implied. See the License for the specific
18 * language governing permissions and limitations under the License.
22 * @file shibsp/handler/SecuredHandler.h
24 * Pluggable runtime functionality that is protected by simple access control.
27 #ifndef __shibsp_securedhandler_h__
28 #define __shibsp_securedhandler_h__
30 #include <shibsp/handler/AbstractHandler.h>
31 #include <shibsp/util/IPRange.h>
37 #if defined (_MSC_VER)
38 #pragma warning( push )
39 #pragma warning( disable : 4250 )
43 * Pluggable runtime functionality that is protected by simple access control.
45 class SHIBSP_API SecuredHandler : public AbstractHandler
51 * @param e DOM element to load as property set
52 * @param log logging category to use
53 * @param aclProperty name of IP/CIDR ACL property
54 * @param defaultACL IP/CIDR ACL to apply if no acl property is set
55 * @param filter optional filter controls what child elements to include as nested PropertySets
56 * @param remapper optional map of property rename rules for legacy property support
59 const xercesc::DOMElement* e,
60 xmltooling::logging::Category& log,
61 const char* aclProperty="acl",
62 const char* defaultACL=nullptr,
63 xercesc::DOMNodeFilter* filter=nullptr,
64 const std::map<std::string,std::string>* remapper=nullptr
68 virtual ~SecuredHandler();
70 std::pair<bool,long> run(SPRequest& request, bool isHandler=true) const;
73 void parseACL(const std::string& acl);
74 std::vector<IPRange> m_acl;
77 #if defined (_MSC_VER)
78 #pragma warning( pop )
83 #endif /* __shibsp_securedhandler_h__ */