-/*
- * Copyright 2001-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.
*/
/**
#include <ctime>
#include <vector>
+#include <memory>
#include <xmltooling/unicode.h>
#if defined (_MSC_VER)
* @param validate true iff XML parsing should be done with validation
*/
SecurityPolicy(
- const saml2md::MetadataProvider* metadataProvider=NULL,
- const xmltooling::QName* role=NULL,
- const xmltooling::TrustEngine* trustEngine=NULL,
+ const saml2md::MetadataProvider* metadataProvider=nullptr,
+ const xmltooling::QName* role=nullptr,
+ const xmltooling::TrustEngine* trustEngine=nullptr,
bool validate=true
);
/**
* Returns the locked MetadataProvider supplied to the policy.
*
- * @return the supplied MetadataProvider or NULL
+ * @return the supplied MetadataProvider or nullptr
*/
const saml2md::MetadataProvider* getMetadataProvider() const;
/**
* Returns the TrustEngine supplied to the policy.
*
- * @return the supplied TrustEngine or NULL
+ * @return the supplied TrustEngine or nullptr
*/
const xmltooling::TrustEngine* getTrustEngine() const;
/**
* Sets a locked MetadataProvider for the policy.
*
- * @param metadata a locked MetadataProvider or NULL
+ * @param metadata a locked MetadataProvider or nullptr
*/
void setMetadataProvider(const saml2md::MetadataProvider* metadata);
* <p>The policy will take ownership of the criteria object when this
* method completes.
*
- * @param criteria a MetadataProvider::Criteria instance, or NULL
+ * @param criteria a MetadataProvider::Criteria instance, or nullptr
*/
void setMetadataProviderCriteria(saml2md::MetadataProvider::Criteria* criteria);
/**
* Sets a peer role element/type for to the policy.
*
- * @param role the peer role element/type or NULL
+ * @param role the peer role element/type or nullptr
*/
void setRole(const xmltooling::QName* role);
/**
* Sets a TrustEngine for the policy.
*
- * @param trust a TrustEngine or NULL
+ * @param trust a TrustEngine or nullptr
*/
void setTrustEngine(const xmltooling::TrustEngine* trust);
*
* @throws BindingException raised if the message/request is invalid according to the supplied rules
*/
- void evaluate(const xmltooling::XMLObject& message, const xmltooling::GenericRequest* request=NULL);
+ void evaluate(const xmltooling::XMLObject& message, const xmltooling::GenericRequest* request=nullptr);
/**
* Resets the policy object and/or clears any per-message state.
// information extracted from message
xmltooling::xstring m_messageID;
time_t m_issueInstant;
- saml2::Issuer* m_issuer;
+ std::auto_ptr<saml2::Issuer> m_issuer;
const saml2md::RoleDescriptor* m_issuerRole;
bool m_authenticated;
// components governing policy rules
- IssuerMatchingPolicy* m_matchingPolicy;
+ std::auto_ptr<IssuerMatchingPolicy> m_matchingPolicy;
std::vector<const SecurityPolicyRule*> m_rules;
const saml2md::MetadataProvider* m_metadata;
- xmltooling::QName* m_role;
+ std::auto_ptr<xmltooling::QName> m_role;
const xmltooling::TrustEngine* m_trust;
bool m_validate;
bool m_entityOnly;