2 * Copyright 2001-2009 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * NullSecurityRule.cpp
20 * SecurityPolicyRule that "disables" security.
24 #include "binding/SecurityPolicy.h"
25 #include "binding/SecurityPolicyRule.h"
27 #include <xmltooling/logging.h>
29 using namespace opensaml;
30 using namespace xmltooling::logging;
31 using namespace xmltooling;
35 class SAML_DLLLOCAL NullSecurityRule : public SecurityPolicyRule
38 NullSecurityRule(const DOMElement* e) : m_log(Category::getInstance(SAML_LOGCAT".SecurityPolicyRule.NullSecurity")) {}
39 virtual ~NullSecurityRule() {}
41 const char* getType() const {
42 return NULLSECURITY_POLICY_RULE;
44 bool evaluate(const XMLObject& message, const GenericRequest* request, SecurityPolicy& policy) const {
45 m_log.warn("security enforced using NULL policy rule, be sure you know what you're doing");
46 policy.setAuthenticated(true);
54 SecurityPolicyRule* SAML_DLLLOCAL NullSecurityRuleFactory(const DOMElement* const & e)
56 return new NullSecurityRule(e);