X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-opensaml.git;a=blobdiff_plain;f=saml%2Fprofile%2Fimpl%2FIgnoreRule.cpp;h=5b9aa3ae8638502c5f762504993ccfa3dd35092c;hp=f60242491c99f29916d50393ca02cb065a9c3e42;hb=1462057b3b9ae7e165d34d988e30b14c213672ca;hpb=c3cd4ec3fa87d0ad3c6f65c1a5e15f548b1b6cc2 diff --git a/saml/profile/impl/IgnoreRule.cpp b/saml/profile/impl/IgnoreRule.cpp index f602424..5b9aa3a 100644 --- a/saml/profile/impl/IgnoreRule.cpp +++ b/saml/profile/impl/IgnoreRule.cpp @@ -1,17 +1,21 @@ -/* - * Copyright 2009 Internet2 +/** + * Licensed to the University Corporation for Advanced Internet + * Development, Inc. (UCAID) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * UCAID licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the + * License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the License. */ /** @@ -24,7 +28,10 @@ #include "exceptions.h" #include "binding/SecurityPolicyRule.h" +#include #include +#include +#include #include using namespace opensaml; @@ -38,25 +45,23 @@ namespace opensaml { { public: IgnoreRule(const DOMElement* e) - : m_log(Category::getInstance(SAML_LOGCAT".SecurityPolicyRule.Ignore")), m_qname(XMLHelper::getNodeValueAsQName(e)) { - if (!m_qname) + : m_log(Category::getInstance(SAML_LOGCAT ".SecurityPolicyRule.Ignore")), m_qname(XMLHelper::getNodeValueAsQName(e)) { + if (!m_qname.get()) throw SecurityPolicyException("No schema type or element name supplied to Ignore rule."); } - virtual ~IgnoreRule() { - delete m_qname; - } + virtual ~IgnoreRule() {} const char* getType() const { return IGNORE_POLICY_RULE; } bool evaluate(const XMLObject& message, const GenericRequest* request, SecurityPolicy& policy) const { if (message.getSchemaType()) { - if (*m_qname != *(message.getSchemaType())) + if (*m_qname.get() != *(message.getSchemaType())) return false; m_log.info("ignoring condition with type (%s)", message.getSchemaType()->toString().c_str()); } else { - if (*m_qname != message.getElementQName()) + if (*m_qname.get() != message.getElementQName()) return false; m_log.info("ignoring condition (%s)", message.getElementQName().toString().c_str()); } @@ -65,7 +70,7 @@ namespace opensaml { private: Category& m_log; - xmltooling::QName* m_qname; + auto_ptr m_qname; }; SecurityPolicyRule* SAML_DLLLOCAL IgnoreRuleFactory(const DOMElement* const & e)