2 * Copyright 2001-2007 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/SecurityPolicyRule.h"
26 #include <xmltooling/logging.h>
28 using namespace opensaml;
29 using namespace xmltooling::logging;
30 using namespace xmltooling;
34 class SAML_DLLLOCAL NullSecurityRule : public SecurityPolicyRule
37 NullSecurityRule(const DOMElement* e) : m_log(Category::getInstance(SAML_LOGCAT".SecurityPolicyRule.NullSecurity")) {}
38 virtual ~NullSecurityRule() {}
40 const char* getType() const {
41 return NULLSECURITY_POLICY_RULE;
43 void evaluate(const XMLObject& message, const GenericRequest* request, SecurityPolicy& policy) const {
44 m_log.warn("security enforced using NULL policy rule, be sure you know what you're doing");
45 policy.setAuthenticated(true);
52 SecurityPolicyRule* SAML_DLLLOCAL NullSecurityRuleFactory(const DOMElement* const & e)
54 return new NullSecurityRule(e);