From: Scott Cantor Date: Tue, 6 Mar 2007 05:12:03 +0000 (+0000) Subject: Collapse unneeded header files. X-Git-Tag: 2.0-alpha1~75 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-opensaml.git;a=commitdiff_plain;h=0e738d39ba71958fe55692498c91fc6e6d402604 Collapse unneeded header files. --- diff --git a/saml/Makefile.am b/saml/Makefile.am index ae428f9..61cca51 100644 --- a/saml/Makefile.am +++ b/saml/Makefile.am @@ -34,21 +34,17 @@ libsamlinclude_HEADERS = \ samlbindinclude_HEADERS = \ binding/ArtifactMap.h \ - binding/ClientCertAuthRule.h \ binding/GenericRequest.h \ binding/GenericResponse.h \ binding/HTTPRequest.h \ binding/HTTPResponse.h \ binding/MessageDecoder.h \ binding/MessageEncoder.h \ - binding/MessageFlowRule.h \ binding/SAMLArtifact.h \ binding/SecurityPolicy.h \ binding/SecurityPolicyRule.h \ - binding/SimpleSigningRule.h \ binding/SOAPClient.h \ - binding/URLEncoder.h \ - binding/XMLSigningRule.h + binding/URLEncoder.h encinclude_HEADERS = \ encryption/EncryptedKeyResolver.h @@ -70,14 +66,7 @@ saml1coreinclude_HEADERS = \ saml1bindinclude_HEADERS = \ saml1/binding/SAMLArtifactType0001.h \ saml1/binding/SAMLArtifactType0002.h \ - saml1/binding/SAML1ArtifactDecoder.h \ - saml1/binding/SAML1ArtifactEncoder.h \ - saml1/binding/SAML1POSTDecoder.h \ - saml1/binding/SAML1POSTEncoder.h \ - saml1/binding/SAML1SOAPDecoder.h \ - saml1/binding/SAML1SOAPEncoder.h \ - saml1/binding/SAML1SOAPClient.h \ - saml1/binding/SAML1MessageRule.h + saml1/binding/SAML1SOAPClient.h saml2coreinclude_HEADERS = \ saml2/core/Assertions.h \ @@ -86,17 +75,8 @@ saml2coreinclude_HEADERS = \ saml2bindinclude_HEADERS = \ saml2/binding/SAML2Artifact.h \ saml2/binding/SAML2ArtifactType0004.h \ - saml2/binding/SAML2ArtifactDecoder.h \ - saml2/binding/SAML2ArtifactEncoder.h \ - saml2/binding/SAML2POSTDecoder.h \ - saml2/binding/SAML2POSTEncoder.h \ saml2/binding/SAML2Redirect.h \ - saml2/binding/SAML2RedirectDecoder.h \ - saml2/binding/SAML2RedirectEncoder.h \ - saml2/binding/SAML2SOAPDecoder.h \ - saml2/binding/SAML2SOAPEncoder.h \ - saml2/binding/SAML2SOAPClient.h \ - saml2/binding/SAML2MessageRule.h + saml2/binding/SAML2SOAPClient.h saml2mdinclude_HEADERS = \ saml2/metadata/AbstractMetadataProvider.h \ diff --git a/saml/binding/ClientCertAuthRule.h b/saml/binding/ClientCertAuthRule.h deleted file mode 100644 index e878c48..0000000 --- a/saml/binding/ClientCertAuthRule.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2001-2007 Internet2 - * - * 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 - * - * 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. - */ - -/** - * @file saml/binding/ClientCertAuthRule.h - * - * TLS client authentication SecurityPolicyRule - */ - -#ifndef __saml_certrule_h__ -#define __saml_certrule_h__ - -#include - - -namespace opensaml { - /** - * TLS client authentication SecurityPolicyRule - */ - class SAML_API ClientCertAuthRule : public SecurityPolicyRule - { - public: - ClientCertAuthRule(const DOMElement* e) {} - virtual ~ClientCertAuthRule() {} - - void evaluate(const xmltooling::XMLObject& message, const GenericRequest* request, SecurityPolicy& policy) const; - }; -}; - -#endif /* __saml_certrule_h__ */ diff --git a/saml/binding/MessageFlowRule.h b/saml/binding/MessageFlowRule.h deleted file mode 100644 index 9ffaa7c..0000000 --- a/saml/binding/MessageFlowRule.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2001-2007 Internet2 - * - * 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 - * - * 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. - */ - -/** - * @file saml/binding/MessageFlowRule.h - * - * SAML replay and freshness checking SecurityPolicyRule - */ - -#ifndef __saml_flowrule_h__ -#define __saml_flowrule_h__ - -#include - - -namespace opensaml { - /** - * SAML replay and freshness checking SecurityPolicyRule - * - * Some form of message rule to extract ID and timestamp must be - * run prior to this rule. - */ - class SAML_API MessageFlowRule : public SecurityPolicyRule - { - public: - MessageFlowRule(const DOMElement* e); - virtual ~MessageFlowRule() {} - - void evaluate(const xmltooling::XMLObject& message, const GenericRequest* request, SecurityPolicy& policy) const; - - /** - * Controls whether rule executes replay checking. - * - * @param checkReplay replay checking value to set - */ - void setCheckReplay(bool checkReplay) { - m_checkReplay = checkReplay; - } - - /** - * Controls maximum elapsed time between message issue and rule execution. - * - * @param expires maximum elapsed time in seconds - */ - void setExpires(time_t expires) { - m_expires = expires; - } - - private: - bool m_checkReplay; - time_t m_expires; - }; - -}; - -#endif /* __saml_flowrule_h__ */ diff --git a/saml/binding/SimpleSigningRule.h b/saml/binding/SimpleSigningRule.h deleted file mode 100644 index e7d3abd..0000000 --- a/saml/binding/SimpleSigningRule.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2001-2007 Internet2 - * - * 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 - * - * 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. - */ - -/** - * @file saml/binding/SimpleSigningRule.h - * - * Blob-oriented signature checking SecurityPolicyRule - */ - -#ifndef __saml_simplesignrule_h__ -#define __saml_simplesignrule_h__ - -#include - - -namespace opensaml { - /** - * Blob-oriented signature checking SecurityPolicyRule for - * bindings that support non-XML signature techniques. - */ - class SAML_API SimpleSigningRule : public SecurityPolicyRule - { - public: - SimpleSigningRule(const DOMElement* e); - virtual ~SimpleSigningRule() {} - - void evaluate(const xmltooling::XMLObject& message, const GenericRequest* request, SecurityPolicy& policy) const; - - protected: - /** Flag determining whether to raise exceptions if a signature fails to validate. */ - bool m_errorsFatal; - }; - -}; - -#endif /* __saml_simplesignrule_h__ */ diff --git a/saml/binding/XMLSigningRule.h b/saml/binding/XMLSigningRule.h deleted file mode 100644 index b6f42c7..0000000 --- a/saml/binding/XMLSigningRule.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2001-2007 Internet2 - * - * 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 - * - * 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. - */ - -/** - * @file saml/binding/XMLSigningRule.h - * - * XML Signature checking SecurityPolicyRule - */ - -#ifndef __saml_xmlsignrule_h__ -#define __saml_xmlsignrule_h__ - -#include - - -namespace opensaml { - /** - * XML Signature checking SecurityPolicyRule - */ - class SAML_API XMLSigningRule : public SecurityPolicyRule - { - public: - XMLSigningRule(const DOMElement* e); - virtual ~XMLSigningRule() {} - - void evaluate(const xmltooling::XMLObject& message, const GenericRequest* request, SecurityPolicy& policy) const; - - protected: - /** Flag determining whether to raise exceptions if a signature fails to validate. */ - bool m_errorsFatal; - }; - -}; - -#endif /* __saml_xmlsignrule_h__ */ diff --git a/saml/binding/impl/ClientCertAuthRule.cpp b/saml/binding/impl/ClientCertAuthRule.cpp index 095eb9c..4662392 100644 --- a/saml/binding/impl/ClientCertAuthRule.cpp +++ b/saml/binding/impl/ClientCertAuthRule.cpp @@ -22,7 +22,7 @@ #include "internal.h" #include "exceptions.h" -#include "binding/ClientCertAuthRule.h" +#include "binding/SecurityPolicyRule.h" #include "saml2/metadata/Metadata.h" #include "saml2/metadata/MetadataProvider.h" @@ -37,6 +37,15 @@ using namespace log4cpp; using namespace std; namespace opensaml { + class SAML_DLLLOCAL ClientCertAuthRule : public SecurityPolicyRule + { + public: + ClientCertAuthRule(const DOMElement* e) {} + virtual ~ClientCertAuthRule() {} + + void evaluate(const xmltooling::XMLObject& message, const GenericRequest* request, SecurityPolicy& policy) const; + }; + SecurityPolicyRule* SAML_DLLLOCAL ClientCertAuthRuleFactory(const DOMElement* const & e) { return new ClientCertAuthRule(e); diff --git a/saml/binding/impl/MessageFlowRule.cpp b/saml/binding/impl/MessageFlowRule.cpp index facb617..93a2649 100644 --- a/saml/binding/impl/MessageFlowRule.cpp +++ b/saml/binding/impl/MessageFlowRule.cpp @@ -22,7 +22,7 @@ #include "internal.h" #include "exceptions.h" -#include "binding/MessageFlowRule.h" +#include "binding/SecurityPolicyRule.h" #include #include @@ -34,6 +34,19 @@ using namespace log4cpp; using namespace std; namespace opensaml { + class SAML_DLLLOCAL MessageFlowRule : public SecurityPolicyRule + { + public: + MessageFlowRule(const DOMElement* e); + virtual ~MessageFlowRule() {} + + void evaluate(const xmltooling::XMLObject& message, const GenericRequest* request, SecurityPolicy& policy) const; + + private: + bool m_checkReplay; + time_t m_expires; + }; + SecurityPolicyRule* SAML_DLLLOCAL MessageFlowRuleFactory(const DOMElement* const & e) { return new MessageFlowRule(e); diff --git a/saml/binding/impl/SimpleSigningRule.cpp b/saml/binding/impl/SimpleSigningRule.cpp index c7fd46a..c27f7c2 100644 --- a/saml/binding/impl/SimpleSigningRule.cpp +++ b/saml/binding/impl/SimpleSigningRule.cpp @@ -23,7 +23,7 @@ #include "internal.h" #include "exceptions.h" #include "binding/HTTPRequest.h" -#include "binding/SimpleSigningRule.h" +#include "binding/SecurityPolicyRule.h" #include "saml2/core/Assertions.h" #include "saml2/metadata/Metadata.h" #include "saml2/metadata/MetadataProvider.h" @@ -41,30 +41,44 @@ using xmlsignature::KeyInfo; using xmlsignature::SignatureException; namespace opensaml { - SecurityPolicyRule* SAML_DLLLOCAL SimpleSigningRuleFactory(const DOMElement* const & e) + class SAML_DLLLOCAL SimpleSigningRule : public SecurityPolicyRule { - return new SimpleSigningRule(e); - } + public: + SimpleSigningRule(const DOMElement* e); + virtual ~SimpleSigningRule() {} + + void evaluate(const xmltooling::XMLObject& message, const GenericRequest* request, SecurityPolicy& policy) const; + + private: + // Appends a raw parameter=value pair to the string. + static bool appendParameter(string& s, const char* data, const char* name); + + bool m_errorsFatal; + }; - // Appends a raw parameter=value pair to the string. - static bool appendParameter(string& s, const char* data, const char* name) + SecurityPolicyRule* SAML_DLLLOCAL SimpleSigningRuleFactory(const DOMElement* const & e) { - const char* start = strstr(data,name); - if (!start) - return false; - if (!s.empty()) - s += '&'; - const char* end = strchr(start,'&'); - if (end) - s.append(start, end-start); - else - s.append(start); - return true; + return new SimpleSigningRule(e); } static const XMLCh errorsFatal[] = UNICODE_LITERAL_11(e,r,r,o,r,s,F,a,t,a,l); }; +bool SimpleSigningRule::appendParameter(string& s, const char* data, const char* name) +{ + const char* start = strstr(data,name); + if (!start) + return false; + if (!s.empty()) + s += '&'; + const char* end = strchr(start,'&'); + if (end) + s.append(start, end-start); + else + s.append(start); + return true; +} + SimpleSigningRule::SimpleSigningRule(const DOMElement* e) : m_errorsFatal(false) { if (e) { diff --git a/saml/binding/impl/XMLSigningRule.cpp b/saml/binding/impl/XMLSigningRule.cpp index e437041..ab68b22 100644 --- a/saml/binding/impl/XMLSigningRule.cpp +++ b/saml/binding/impl/XMLSigningRule.cpp @@ -22,7 +22,7 @@ #include "internal.h" #include "exceptions.h" -#include "binding/XMLSigningRule.h" +#include "binding/SecurityPolicyRule.h" #include "saml2/core/Assertions.h" #include "saml2/metadata/Metadata.h" #include "saml2/metadata/MetadataProvider.h" @@ -39,6 +39,18 @@ using namespace std; using xmlsignature::SignatureException; namespace opensaml { + class SAML_DLLLOCAL XMLSigningRule : public SecurityPolicyRule + { + public: + XMLSigningRule(const DOMElement* e); + virtual ~XMLSigningRule() {} + + void evaluate(const xmltooling::XMLObject& message, const GenericRequest* request, SecurityPolicy& policy) const; + + private: + bool m_errorsFatal; + }; + SecurityPolicyRule* SAML_DLLLOCAL XMLSigningRuleFactory(const DOMElement* const & e) { return new XMLSigningRule(e); diff --git a/saml/saml.vcproj b/saml/saml.vcproj index 6575f68..b1d48ab 100644 --- a/saml/saml.vcproj +++ b/saml/saml.vcproj @@ -630,38 +630,10 @@ Name="binding" > - - - - - - - - - - - - - - @@ -746,53 +718,17 @@ > - - - - - - - - - - - - - - - - - - - - @@ -839,10 +771,6 @@ > - - @@ -855,10 +783,6 @@ > - - @@ -866,10 +790,6 @@ RelativePath=".\binding\URLEncoder.h" > - - -#include - - -namespace opensaml { - namespace saml1p { - - /** - * SAML 1.x Artifact binding/profile message decoder - */ - class SAML_API SAML1ArtifactDecoder : public MessageDecoder - { - public: - SAML1ArtifactDecoder(const DOMElement* e); - virtual ~SAML1ArtifactDecoder() {} - - xmltooling::XMLObject* decode( - std::string& relayState, - const GenericRequest& genericRequest, - SecurityPolicy& policy - ) const; - }; - - }; -}; diff --git a/saml/saml1/binding/SAML1ArtifactEncoder.h b/saml/saml1/binding/SAML1ArtifactEncoder.h deleted file mode 100644 index f4194b8..0000000 --- a/saml/saml1/binding/SAML1ArtifactEncoder.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2001-2007 Internet2 - * - * 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 - * - * 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. - */ - -/** - * @file saml/saml1/binding/SAML1ArtifactEncoder.h - * - * SAML 1.x Artifact binding/profile message encoder - */ - -#include - - -namespace opensaml { - namespace saml1p { - - /** - * SAML 1.x Artifact binding/profile message encoder - */ - class SAML_API SAML1ArtifactEncoder : public MessageEncoder - { - public: - SAML1ArtifactEncoder(const DOMElement* e); - virtual ~SAML1ArtifactEncoder() {} - - long encode( - GenericResponse& genericResponse, - xmltooling::XMLObject* xmlObject, - const char* destination, - const char* recipientID=NULL, - const char* relayState=NULL, - const xmltooling::CredentialResolver* credResolver=NULL, - const XMLCh* sigAlgorithm=NULL - ) const; - }; - - }; -}; diff --git a/saml/saml1/binding/SAML1MessageRule.h b/saml/saml1/binding/SAML1MessageRule.h deleted file mode 100644 index 724339e..0000000 --- a/saml/saml1/binding/SAML1MessageRule.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2001-2007 Internet2 - * - * 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 - * - * 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. - */ - -/** - * @file saml/saml1/binding/SAML1MessageRule.h - * - * SAML 1.x message extraction rule - */ - -#ifndef __saml_1msgrule_h__ -#define __saml_1msgrule_h__ - -#include - - -namespace opensaml { - namespace saml1p { - /** - * SAML 1.x message extraction rule - */ - class SAML_API SAML1MessageRule : public SecurityPolicyRule - { - public: - SAML1MessageRule(const DOMElement* e) {} - virtual ~SAML1MessageRule() {} - - void evaluate(const xmltooling::XMLObject& message, const GenericRequest* request, SecurityPolicy& policy) const; - }; - }; -}; - -#endif /* __saml_1msgrule_h__ */ diff --git a/saml/saml1/binding/SAML1POSTDecoder.h b/saml/saml1/binding/SAML1POSTDecoder.h deleted file mode 100644 index be903f5..0000000 --- a/saml/saml1/binding/SAML1POSTDecoder.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2001-2007 Internet2 - * - * 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 - * - * 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. - */ - -/** - * @file saml/saml1/binding/SAML1POSTDecoder.h - * - * SAML 1.x POST binding/profile message decoder - */ - -#include -#include - - -namespace opensaml { - namespace saml1p { - - /** - * SAML 1.x POST binding/profile message decoder - */ - class SAML_API SAML1POSTDecoder : public MessageDecoder - { - public: - SAML1POSTDecoder(const DOMElement* e); - virtual ~SAML1POSTDecoder() {} - - xmltooling::XMLObject* decode( - std::string& relayState, - const GenericRequest& genericRequest, - SecurityPolicy& policy - ) const; - }; - - }; -}; diff --git a/saml/saml1/binding/SAML1POSTEncoder.h b/saml/saml1/binding/SAML1POSTEncoder.h deleted file mode 100644 index ec96683..0000000 --- a/saml/saml1/binding/SAML1POSTEncoder.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2001-2007 Internet2 - * - * 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 - * - * 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. - */ - -/** - * @file saml/saml1/binding/SAML1POSTEncoder.h - * - * SAML 1.x POST binding/profile message encoder - */ - -#include - - -namespace opensaml { - namespace saml1p { - - /** - * SAML 1.x POST binding/profile message encoder - */ - class SAML_API SAML1POSTEncoder : public MessageEncoder - { - public: - SAML1POSTEncoder(const DOMElement* e); - virtual ~SAML1POSTEncoder() {} - - long encode( - GenericResponse& genericResponse, - xmltooling::XMLObject* xmlObject, - const char* destination, - const char* recipientID=NULL, - const char* relayState=NULL, - const xmltooling::CredentialResolver* credResolver=NULL, - const XMLCh* sigAlgorithm=NULL - ) const; - - protected: - /** Pathname of HTML template for transmission of message via POST. */ - std::string m_template; - }; - - }; -}; diff --git a/saml/saml1/binding/SAML1SOAPDecoder.h b/saml/saml1/binding/SAML1SOAPDecoder.h deleted file mode 100644 index 66a431f..0000000 --- a/saml/saml1/binding/SAML1SOAPDecoder.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2001-2007 Internet2 - * - * 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 - * - * 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. - */ - -/** - * @file saml/saml1/binding/SAML1SOAPDecoder.h - * - * SAML 1.x SOAP binding message decoder - */ - -#include -#include - - -namespace opensaml { - namespace saml1p { - - /** - * SAML 1.x SOAP binding message decoder - */ - class SAML_API SAML1SOAPDecoder : public MessageDecoder - { - public: - SAML1SOAPDecoder(const DOMElement* e); - virtual ~SAML1SOAPDecoder() {} - - xmltooling::XMLObject* decode( - std::string& relayState, - const GenericRequest& genericRequest, - SecurityPolicy& policy - ) const; - }; - - }; -}; diff --git a/saml/saml1/binding/SAML1SOAPEncoder.h b/saml/saml1/binding/SAML1SOAPEncoder.h deleted file mode 100644 index 6501576..0000000 --- a/saml/saml1/binding/SAML1SOAPEncoder.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2001-2007 Internet2 - * - * 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 - * - * 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. - */ - -/** - * @file saml/saml1/binding/SAML1SOAPEncoder.h - * - * SAML 1.x SOAP binding message encoder - */ - -#include - - -namespace opensaml { - namespace saml1p { - - /** - * SAML 1.x POST binding message encoder - */ - class SAML_API SAML1SOAPEncoder : public MessageEncoder - { - public: - SAML1SOAPEncoder(const DOMElement* e); - virtual ~SAML1SOAPEncoder() {} - - long encode( - GenericResponse& genericResponse, - xmltooling::XMLObject* xmlObject, - const char* destination, - const char* recipientID=NULL, - const char* relayState=NULL, - const xmltooling::CredentialResolver* credResolver=NULL, - const XMLCh* sigAlgorithm=NULL - ) const; - }; - - }; -}; diff --git a/saml/saml1/binding/impl/SAML1ArtifactDecoder.cpp b/saml/saml1/binding/impl/SAML1ArtifactDecoder.cpp index 71932a0..8839b7d 100644 --- a/saml/saml1/binding/impl/SAML1ArtifactDecoder.cpp +++ b/saml/saml1/binding/impl/SAML1ArtifactDecoder.cpp @@ -23,8 +23,9 @@ #include "internal.h" #include "exceptions.h" #include "binding/HTTPRequest.h" -#include "saml/binding/SAMLArtifact.h" -#include "saml1/binding/SAML1ArtifactDecoder.h" +#include "binding/MessageDecoder.h" +#include "binding/SAMLArtifact.h" +#include "saml1/core/Protocols.h" #include "saml2/metadata/Metadata.h" #include "saml2/metadata/MetadataProvider.h" @@ -41,6 +42,19 @@ using namespace std; namespace opensaml { namespace saml1p { + class SAML_DLLLOCAL SAML1ArtifactDecoder : public MessageDecoder + { + public: + SAML1ArtifactDecoder(const DOMElement* e) {} + virtual ~SAML1ArtifactDecoder() {} + + xmltooling::XMLObject* decode( + std::string& relayState, + const GenericRequest& genericRequest, + SecurityPolicy& policy + ) const; + }; + MessageDecoder* SAML_DLLLOCAL SAML1ArtifactDecoderFactory(const DOMElement* const & e) { return new SAML1ArtifactDecoder(e); @@ -48,8 +62,6 @@ namespace opensaml { }; }; -SAML1ArtifactDecoder::SAML1ArtifactDecoder(const DOMElement* e) {} - XMLObject* SAML1ArtifactDecoder::decode( string& relayState, const GenericRequest& genericRequest, diff --git a/saml/saml1/binding/impl/SAML1ArtifactEncoder.cpp b/saml/saml1/binding/impl/SAML1ArtifactEncoder.cpp index 0a3ca1b..01b79a5 100644 --- a/saml/saml1/binding/impl/SAML1ArtifactEncoder.cpp +++ b/saml/saml1/binding/impl/SAML1ArtifactEncoder.cpp @@ -24,10 +24,11 @@ #include "exceptions.h" #include "binding/ArtifactMap.h" #include "binding/HTTPResponse.h" +#include "binding/MessageEncoder.h" #include "binding/SAMLArtifact.h" #include "binding/URLEncoder.h" -#include "saml1/binding/SAML1ArtifactEncoder.h" #include "saml1/core/Assertions.h" +#include "saml1/core/Protocols.h" #include #include @@ -42,6 +43,23 @@ using namespace std; namespace opensaml { namespace saml1p { + class SAML_DLLLOCAL SAML1ArtifactEncoder : public MessageEncoder + { + public: + SAML1ArtifactEncoder(const DOMElement* e) {} + virtual ~SAML1ArtifactEncoder() {} + + long encode( + GenericResponse& genericResponse, + xmltooling::XMLObject* xmlObject, + const char* destination, + const char* recipientID=NULL, + const char* relayState=NULL, + const xmltooling::CredentialResolver* credResolver=NULL, + const XMLCh* sigAlgorithm=NULL + ) const; + }; + MessageEncoder* SAML_DLLLOCAL SAML1ArtifactEncoderFactory(const DOMElement* const & e) { return new SAML1ArtifactEncoder(e); @@ -49,8 +67,6 @@ namespace opensaml { }; }; -SAML1ArtifactEncoder::SAML1ArtifactEncoder(const DOMElement* e) {} - long SAML1ArtifactEncoder::encode( GenericResponse& genericResponse, XMLObject* xmlObject, diff --git a/saml/saml1/binding/impl/SAML1MessageRule.cpp b/saml/saml1/binding/impl/SAML1MessageRule.cpp index fc34dac..397cbde 100644 --- a/saml/saml1/binding/impl/SAML1MessageRule.cpp +++ b/saml/saml1/binding/impl/SAML1MessageRule.cpp @@ -23,7 +23,7 @@ #include "internal.h" #include "exceptions.h" #include "RootObject.h" -#include "saml1/binding/SAML1MessageRule.h" +#include "binding/SecurityPolicyRule.h" #include "saml1/core/Assertions.h" #include "saml1/core/Protocols.h" #include "saml2/core/Assertions.h" @@ -41,6 +41,16 @@ using namespace log4cpp; using namespace std; namespace opensaml { + + class SAML_DLLLOCAL SAML1MessageRule : public SecurityPolicyRule + { + public: + SAML1MessageRule(const DOMElement* e) {} + virtual ~SAML1MessageRule() {} + + void evaluate(const xmltooling::XMLObject& message, const GenericRequest* request, SecurityPolicy& policy) const; + }; + SecurityPolicyRule* SAML_DLLLOCAL SAML1MessageRuleFactory(const DOMElement* const & e) { return new SAML1MessageRule(e); diff --git a/saml/saml1/binding/impl/SAML1POSTDecoder.cpp b/saml/saml1/binding/impl/SAML1POSTDecoder.cpp index 2c823ae..de2d1d2 100644 --- a/saml/saml1/binding/impl/SAML1POSTDecoder.cpp +++ b/saml/saml1/binding/impl/SAML1POSTDecoder.cpp @@ -23,8 +23,9 @@ #include "internal.h" #include "exceptions.h" #include "binding/HTTPRequest.h" +#include "binding/MessageDecoder.h" #include "saml1/core/Assertions.h" -#include "saml1/binding/SAML1POSTDecoder.h" +#include "saml1/core/Protocols.h" #include "saml2/metadata/Metadata.h" #include "saml2/metadata/MetadataProvider.h" @@ -43,6 +44,19 @@ using namespace std; namespace opensaml { namespace saml1p { + class SAML_DLLLOCAL SAML1POSTDecoder : public MessageDecoder + { + public: + SAML1POSTDecoder(const DOMElement* e) {} + virtual ~SAML1POSTDecoder() {} + + xmltooling::XMLObject* decode( + std::string& relayState, + const GenericRequest& genericRequest, + SecurityPolicy& policy + ) const; + }; + MessageDecoder* SAML_DLLLOCAL SAML1POSTDecoderFactory(const DOMElement* const & e) { return new SAML1POSTDecoder(e); @@ -50,8 +64,6 @@ namespace opensaml { }; }; -SAML1POSTDecoder::SAML1POSTDecoder(const DOMElement* e) {} - XMLObject* SAML1POSTDecoder::decode( string& relayState, const GenericRequest& genericRequest, diff --git a/saml/saml1/binding/impl/SAML1POSTEncoder.cpp b/saml/saml1/binding/impl/SAML1POSTEncoder.cpp index 11d3005..de3b377 100644 --- a/saml/saml1/binding/impl/SAML1POSTEncoder.cpp +++ b/saml/saml1/binding/impl/SAML1POSTEncoder.cpp @@ -22,7 +22,7 @@ #include "internal.h" #include "exceptions.h" -#include "saml1/binding/SAML1POSTEncoder.h" +#include "binding/MessageEncoder.h" #include "saml1/core/Protocols.h" #include @@ -41,6 +41,27 @@ using namespace std; namespace opensaml { namespace saml1p { + class SAML_DLLLOCAL SAML1POSTEncoder : public MessageEncoder + { + public: + SAML1POSTEncoder(const DOMElement* e); + virtual ~SAML1POSTEncoder() {} + + long encode( + GenericResponse& genericResponse, + xmltooling::XMLObject* xmlObject, + const char* destination, + const char* recipientID=NULL, + const char* relayState=NULL, + const xmltooling::CredentialResolver* credResolver=NULL, + const XMLCh* sigAlgorithm=NULL + ) const; + + protected: + /** Pathname of HTML template for transmission of message via POST. */ + std::string m_template; + }; + MessageEncoder* SAML_DLLLOCAL SAML1POSTEncoderFactory(const DOMElement* const & e) { return new SAML1POSTEncoder(e); @@ -48,17 +69,17 @@ namespace opensaml { }; }; -static const XMLCh templat[] = UNICODE_LITERAL_8(t,e,m,p,l,a,t,e); +static const XMLCh _template[] = UNICODE_LITERAL_8(t,e,m,p,l,a,t,e); SAML1POSTEncoder::SAML1POSTEncoder(const DOMElement* e) { if (e) { - auto_ptr_char t(e->getAttributeNS(NULL, templat)); + auto_ptr_char t(e->getAttributeNS(NULL, _template)); if (t.get()) m_template = t.get(); } if (m_template.empty()) - throw XMLToolingException("SAML1POSTEncoder requires template attribute."); + throw XMLToolingException("SAML1POSTEncoder requires template XML attribute."); } long SAML1POSTEncoder::encode( diff --git a/saml/saml1/binding/impl/SAML1SOAPDecoder.cpp b/saml/saml1/binding/impl/SAML1SOAPDecoder.cpp index a6e51f3..d759507 100644 --- a/saml/saml1/binding/impl/SAML1SOAPDecoder.cpp +++ b/saml/saml1/binding/impl/SAML1SOAPDecoder.cpp @@ -22,7 +22,8 @@ #include "internal.h" #include "exceptions.h" -#include "saml1/binding/SAML1SOAPDecoder.h" +#include "binding/MessageDecoder.h" +#include "saml1/core/Protocols.h" #include #include @@ -38,6 +39,19 @@ using namespace std; namespace opensaml { namespace saml1p { + class SAML_DLLLOCAL SAML1SOAPDecoder : public MessageDecoder + { + public: + SAML1SOAPDecoder(const DOMElement* e) {} + virtual ~SAML1SOAPDecoder() {} + + xmltooling::XMLObject* decode( + std::string& relayState, + const GenericRequest& genericRequest, + SecurityPolicy& policy + ) const; + }; + MessageDecoder* SAML_DLLLOCAL SAML1SOAPDecoderFactory(const DOMElement* const & e) { return new SAML1SOAPDecoder(e); @@ -45,8 +59,6 @@ namespace opensaml { }; }; -SAML1SOAPDecoder::SAML1SOAPDecoder(const DOMElement* e) {} - XMLObject* SAML1SOAPDecoder::decode( string& relayState, const GenericRequest& genericRequest, diff --git a/saml/saml1/binding/impl/SAML1SOAPEncoder.cpp b/saml/saml1/binding/impl/SAML1SOAPEncoder.cpp index 9e4946a..086aef1 100644 --- a/saml/saml1/binding/impl/SAML1SOAPEncoder.cpp +++ b/saml/saml1/binding/impl/SAML1SOAPEncoder.cpp @@ -23,7 +23,7 @@ #include "internal.h" #include "exceptions.h" #include "binding/HTTPResponse.h" -#include "saml1/binding/SAML1SOAPEncoder.h" +#include "binding/MessageEncoder.h" #include "saml1/core/Protocols.h" #include @@ -41,6 +41,23 @@ using namespace std; namespace opensaml { namespace saml1p { + class SAML_DLLLOCAL SAML1SOAPEncoder : public MessageEncoder + { + public: + SAML1SOAPEncoder(const DOMElement* e) {} + virtual ~SAML1SOAPEncoder() {} + + long encode( + GenericResponse& genericResponse, + xmltooling::XMLObject* xmlObject, + const char* destination, + const char* recipientID=NULL, + const char* relayState=NULL, + const xmltooling::CredentialResolver* credResolver=NULL, + const XMLCh* sigAlgorithm=NULL + ) const; + }; + MessageEncoder* SAML_DLLLOCAL SAML1SOAPEncoderFactory(const DOMElement* const & e) { return new SAML1SOAPEncoder(e); @@ -48,8 +65,6 @@ namespace opensaml { }; }; -SAML1SOAPEncoder::SAML1SOAPEncoder(const DOMElement* e) {} - long SAML1SOAPEncoder::encode( GenericResponse& genericResponse, XMLObject* xmlObject, diff --git a/saml/saml2/binding/SAML2ArtifactDecoder.h b/saml/saml2/binding/SAML2ArtifactDecoder.h deleted file mode 100644 index 02f5680..0000000 --- a/saml/saml2/binding/SAML2ArtifactDecoder.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2001-2007 Internet2 - * - * 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 - * - * 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. - */ - -/** - * @file saml/saml2/binding/SAML2ArtifactDecoder.h - * - * SAML 2.0 Artifact binding message decoder - */ - -#include - - -namespace opensaml { - namespace saml2 { - class SAML_API Issuer; - }; - - namespace saml2p { - - /** - * SAML 2.0 Artifact binding message decoder - */ - class SAML_API SAML2ArtifactDecoder : public MessageDecoder - { - public: - SAML2ArtifactDecoder(const DOMElement* e); - virtual ~SAML2ArtifactDecoder() {} - - xmltooling::XMLObject* decode( - std::string& relayState, - const GenericRequest& genericRequest, - SecurityPolicy& policy - ) const; - }; - - }; -}; diff --git a/saml/saml2/binding/SAML2ArtifactEncoder.h b/saml/saml2/binding/SAML2ArtifactEncoder.h deleted file mode 100644 index 518c779..0000000 --- a/saml/saml2/binding/SAML2ArtifactEncoder.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2001-2007 Internet2 - * - * 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 - * - * 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. - */ - -/** - * @file saml/saml2/binding/SAML2ArtifactEncoder.h - * - * SAML 2.0 HTTP-Artifact binding message encoder - */ - -#include - - -namespace opensaml { - namespace saml2p { - - /** - * SAML 2.0 HTTP-Artifact binding message encoder - */ - class SAML_API SAML2ArtifactEncoder : public MessageEncoder - { - public: - SAML2ArtifactEncoder(const DOMElement* e); - virtual ~SAML2ArtifactEncoder() {} - - long encode( - GenericResponse& genericResponse, - xmltooling::XMLObject* xmlObject, - const char* destination, - const char* recipientID=NULL, - const char* relayState=NULL, - const xmltooling::CredentialResolver* credResolver=NULL, - const XMLCh* sigAlgorithm=NULL - ) const; - - protected: - /** Pathname of HTML template for transmission of message via POST. */ - std::string m_template; - }; - - }; -}; diff --git a/saml/saml2/binding/SAML2MessageRule.h b/saml/saml2/binding/SAML2MessageRule.h deleted file mode 100644 index 29a5694..0000000 --- a/saml/saml2/binding/SAML2MessageRule.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2001-2007 Internet2 - * - * 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 - * - * 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. - */ - -/** - * @file saml/saml2/binding/SAML2MessageRule.h - * - * SAML 2.0 message extraction rule - */ - -#ifndef __saml_2msgrule_h__ -#define __saml_2msgrule_h__ - -#include - - -namespace opensaml { - namespace saml2p { - /** - * SAML 2.0 message extraction rule - */ - class SAML_API SAML2MessageRule : public SecurityPolicyRule - { - public: - SAML2MessageRule(const DOMElement* e) {} - virtual ~SAML2MessageRule() {} - - void evaluate(const xmltooling::XMLObject& message, const GenericRequest* request, SecurityPolicy& policy) const; - }; - }; -}; - -#endif /* __saml_2msgrule_h__ */ diff --git a/saml/saml2/binding/SAML2POSTDecoder.h b/saml/saml2/binding/SAML2POSTDecoder.h deleted file mode 100644 index 01104f0..0000000 --- a/saml/saml2/binding/SAML2POSTDecoder.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2001-2007 Internet2 - * - * 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 - * - * 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. - */ - -/** - * @file saml/saml2/binding/SAML2POSTDecoder.h - * - * SAML 2.0 HTTP POST binding message decoder - */ - -#include -#include - -namespace opensaml { - - namespace saml2p { - - /** - * SAML 2.0 HTTP POST binding message decoder - */ - class SAML_API SAML2POSTDecoder : public MessageDecoder - { - public: - SAML2POSTDecoder(const DOMElement* e); - virtual ~SAML2POSTDecoder() {} - - xmltooling::XMLObject* decode( - std::string& relayState, - const GenericRequest& genericRequest, - SecurityPolicy& policy - ) const; - }; - - }; -}; diff --git a/saml/saml2/binding/SAML2POSTEncoder.h b/saml/saml2/binding/SAML2POSTEncoder.h deleted file mode 100644 index b2af656..0000000 --- a/saml/saml2/binding/SAML2POSTEncoder.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2001-2007 Internet2 - * - * 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 - * - * 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. - */ - -/** - * @file saml/saml2/binding/SAML2POSTEncoder.h - * - * SAML 2.0 HTTP-POST (and -SimpleSign) binding message encoder - */ - -#include - - -namespace opensaml { - namespace saml2p { - - /** - * SAML 2.0 HTTP-POST (and -SimpleSign) binding message encoder - */ - class SAML_API SAML2POSTEncoder : public MessageEncoder - { - public: - SAML2POSTEncoder(const DOMElement* e, bool simple=false); - virtual ~SAML2POSTEncoder() {} - - long encode( - GenericResponse& genericResponse, - xmltooling::XMLObject* xmlObject, - const char* destination, - const char* recipientID=NULL, - const char* relayState=NULL, - const xmltooling::CredentialResolver* credResolver=NULL, - const XMLCh* sigAlgorithm=NULL - ) const; - - protected: - /** Pathname of HTML template for transmission of message via POST. */ - std::string m_template; - - /** Flag controls signing behavior (XML vs. "simple") */ - bool m_simple; - }; - - }; -}; diff --git a/saml/saml2/binding/SAML2RedirectDecoder.h b/saml/saml2/binding/SAML2RedirectDecoder.h deleted file mode 100644 index 9daf1cb..0000000 --- a/saml/saml2/binding/SAML2RedirectDecoder.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2001-2007 Internet2 - * - * 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 - * - * 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. - */ - -/** - * @file saml/saml2/binding/SAML2RedirectDecoder.h - * - * SAML 2.0 HTTP Redirect binding message decoder - */ - -#include - -namespace opensaml { - namespace saml2p { - - /** - * SAML 2.0 HTTP Redirect binding message decoder - */ - class SAML_API SAML2RedirectDecoder : public MessageDecoder - { - public: - SAML2RedirectDecoder(const DOMElement* e); - virtual ~SAML2RedirectDecoder() {} - - xmltooling::XMLObject* decode( - std::string& relayState, - const GenericRequest& genericRequest, - SecurityPolicy& policy - ) const; - }; - - }; -}; diff --git a/saml/saml2/binding/SAML2RedirectEncoder.h b/saml/saml2/binding/SAML2RedirectEncoder.h deleted file mode 100644 index 7e7b06e..0000000 --- a/saml/saml2/binding/SAML2RedirectEncoder.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2001-2007 Internet2 - * - * 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 - * - * 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. - */ - -/** - * @file saml/saml2/binding/SAML2RedirectEncoder.h - * - * SAML 2.0 HTTP-Redirect binding message encoder - */ - -#include - - -namespace opensaml { - namespace saml2p { - - /** - * SAML 2.0 HTTP-Redirect binding message encoder - */ - class SAML_API SAML2RedirectEncoder : public MessageEncoder - { - public: - SAML2RedirectEncoder(const DOMElement* e) {} - virtual ~SAML2RedirectEncoder() {} - - long encode( - GenericResponse& genericResponse, - xmltooling::XMLObject* xmlObject, - const char* destination, - const char* recipientID=NULL, - const char* relayState=NULL, - const xmltooling::CredentialResolver* credResolver=NULL, - const XMLCh* sigAlgorithm=NULL - ) const; - }; - - }; -}; diff --git a/saml/saml2/binding/SAML2SOAPDecoder.h b/saml/saml2/binding/SAML2SOAPDecoder.h deleted file mode 100644 index 426c1c3..0000000 --- a/saml/saml2/binding/SAML2SOAPDecoder.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2001-2007 Internet2 - * - * 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 - * - * 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. - */ - -/** - * @file saml/saml2/binding/SAML2SOAPDecoder.h - * - * SAML 2.0 SOAP binding message decoder - */ - -#include -#include - - -namespace opensaml { - namespace saml2p { - - /** - * SAML 2.0 SOAP binding message decoder - */ - class SAML_API SAML2SOAPDecoder : public MessageDecoder - { - public: - SAML2SOAPDecoder(const DOMElement* e); - virtual ~SAML2SOAPDecoder() {} - - xmltooling::XMLObject* decode( - std::string& relayState, - const GenericRequest& genericRequest, - SecurityPolicy& policy - ) const; - }; - - }; -}; diff --git a/saml/saml2/binding/SAML2SOAPEncoder.h b/saml/saml2/binding/SAML2SOAPEncoder.h deleted file mode 100644 index 05ca6ae..0000000 --- a/saml/saml2/binding/SAML2SOAPEncoder.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2001-2007 Internet2 - * - * 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 - * - * 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. - */ - -/** - * @file saml/saml2/binding/SAML2SOAPEncoder.h - * - * SAML 2.0 SOAP binding message encoder - */ - -#include - - -namespace opensaml { - namespace saml2p { - - /** - * SAML 2.0 POST binding message encoder - */ - class SAML_API SAML2SOAPEncoder : public MessageEncoder - { - public: - SAML2SOAPEncoder(const DOMElement* e); - virtual ~SAML2SOAPEncoder() {} - - long encode( - GenericResponse& genericResponse, - xmltooling::XMLObject* xmlObject, - const char* destination, - const char* recipientID=NULL, - const char* relayState=NULL, - const xmltooling::CredentialResolver* credResolver=NULL, - const XMLCh* sigAlgorithm=NULL - ) const; - }; - - }; -}; diff --git a/saml/saml2/binding/impl/SAML2ArtifactDecoder.cpp b/saml/saml2/binding/impl/SAML2ArtifactDecoder.cpp index 42882cb..c4c24a4 100644 --- a/saml/saml2/binding/impl/SAML2ArtifactDecoder.cpp +++ b/saml/saml2/binding/impl/SAML2ArtifactDecoder.cpp @@ -23,9 +23,8 @@ #include "internal.h" #include "exceptions.h" #include "binding/HTTPRequest.h" -#include "saml/binding/SAMLArtifact.h" +#include "binding/MessageDecoder.h" #include "saml2/binding/SAML2Artifact.h" -#include "saml2/binding/SAML2ArtifactDecoder.h" #include "saml2/core/Protocols.h" #include "saml2/metadata/Metadata.h" #include "saml2/metadata/MetadataProvider.h" @@ -44,6 +43,19 @@ using namespace std; namespace opensaml { namespace saml2p { + class SAML_DLLLOCAL SAML2ArtifactDecoder : public MessageDecoder + { + public: + SAML2ArtifactDecoder(const DOMElement* e) {} + virtual ~SAML2ArtifactDecoder() {} + + xmltooling::XMLObject* decode( + std::string& relayState, + const GenericRequest& genericRequest, + SecurityPolicy& policy + ) const; + }; + MessageDecoder* SAML_DLLLOCAL SAML2ArtifactDecoderFactory(const DOMElement* const & e) { return new SAML2ArtifactDecoder(e); @@ -51,8 +63,6 @@ namespace opensaml { }; }; -SAML2ArtifactDecoder::SAML2ArtifactDecoder(const DOMElement* e) {} - XMLObject* SAML2ArtifactDecoder::decode( string& relayState, const GenericRequest& genericRequest, diff --git a/saml/saml2/binding/impl/SAML2ArtifactEncoder.cpp b/saml/saml2/binding/impl/SAML2ArtifactEncoder.cpp index c9c6e38..17d5880 100644 --- a/saml/saml2/binding/impl/SAML2ArtifactEncoder.cpp +++ b/saml/saml2/binding/impl/SAML2ArtifactEncoder.cpp @@ -24,9 +24,9 @@ #include "exceptions.h" #include "binding/ArtifactMap.h" #include "binding/HTTPResponse.h" +#include "binding/MessageEncoder.h" #include "binding/URLEncoder.h" #include "saml2/binding/SAML2Artifact.h" -#include "saml2/binding/SAML2ArtifactEncoder.h" #include "saml2/core/Protocols.h" #include @@ -44,6 +44,26 @@ using namespace std; namespace opensaml { namespace saml2p { + class SAML_DLLLOCAL SAML2ArtifactEncoder : public MessageEncoder + { + public: + SAML2ArtifactEncoder(const DOMElement* e); + virtual ~SAML2ArtifactEncoder() {} + + long encode( + GenericResponse& genericResponse, + xmltooling::XMLObject* xmlObject, + const char* destination, + const char* recipientID=NULL, + const char* relayState=NULL, + const xmltooling::CredentialResolver* credResolver=NULL, + const XMLCh* sigAlgorithm=NULL + ) const; + + private: + std::string m_template; + }; + MessageEncoder* SAML_DLLLOCAL SAML2ArtifactEncoderFactory(const DOMElement* const & e) { return new SAML2ArtifactEncoder(e); @@ -51,12 +71,12 @@ namespace opensaml { }; }; -static const XMLCh templat[] = UNICODE_LITERAL_8(t,e,m,p,l,a,t,e); +static const XMLCh _template[] = UNICODE_LITERAL_8(t,e,m,p,l,a,t,e); SAML2ArtifactEncoder::SAML2ArtifactEncoder(const DOMElement* e) { if (e) { - auto_ptr_char t(e->getAttributeNS(NULL, templat)); + auto_ptr_char t(e->getAttributeNS(NULL, _template)); if (t.get()) m_template = t.get(); } diff --git a/saml/saml2/binding/impl/SAML2MessageRule.cpp b/saml/saml2/binding/impl/SAML2MessageRule.cpp index f657b8c..c9bb283 100644 --- a/saml/saml2/binding/impl/SAML2MessageRule.cpp +++ b/saml/saml2/binding/impl/SAML2MessageRule.cpp @@ -22,7 +22,7 @@ #include "internal.h" #include "exceptions.h" -#include "saml2/binding/SAML2MessageRule.h" +#include "binding/SecurityPolicyRule.h" #include "saml2/core/Protocols.h" #include "saml2/metadata/Metadata.h" #include "saml2/metadata/MetadataProvider.h" @@ -39,6 +39,15 @@ using namespace log4cpp; using namespace std; namespace opensaml { + class SAML_DLLLOCAL SAML2MessageRule : public SecurityPolicyRule + { + public: + SAML2MessageRule(const DOMElement* e) {} + virtual ~SAML2MessageRule() {} + + void evaluate(const xmltooling::XMLObject& message, const GenericRequest* request, SecurityPolicy& policy) const; + }; + SecurityPolicyRule* SAML_DLLLOCAL SAML2MessageRuleFactory(const DOMElement* const & e) { return new SAML2MessageRule(e); diff --git a/saml/saml2/binding/impl/SAML2POSTDecoder.cpp b/saml/saml2/binding/impl/SAML2POSTDecoder.cpp index 90d0b63..bec0d43 100644 --- a/saml/saml2/binding/impl/SAML2POSTDecoder.cpp +++ b/saml/saml2/binding/impl/SAML2POSTDecoder.cpp @@ -23,7 +23,7 @@ #include "internal.h" #include "exceptions.h" #include "binding/HTTPRequest.h" -#include "saml2/binding/SAML2POSTDecoder.h" +#include "binding/MessageDecoder.h" #include "saml2/core/Protocols.h" #include "saml2/metadata/Metadata.h" #include "saml2/metadata/MetadataProvider.h" @@ -43,6 +43,19 @@ using namespace std; namespace opensaml { namespace saml2p { + class SAML_DLLLOCAL SAML2POSTDecoder : public MessageDecoder + { + public: + SAML2POSTDecoder(const DOMElement* e) {} + virtual ~SAML2POSTDecoder() {} + + xmltooling::XMLObject* decode( + std::string& relayState, + const GenericRequest& genericRequest, + SecurityPolicy& policy + ) const; + }; + MessageDecoder* SAML_DLLLOCAL SAML2POSTDecoderFactory(const DOMElement* const & e) { return new SAML2POSTDecoder(e); @@ -50,8 +63,6 @@ namespace opensaml { }; }; -SAML2POSTDecoder::SAML2POSTDecoder(const DOMElement* e) {} - XMLObject* SAML2POSTDecoder::decode( std::string& relayState, const GenericRequest& genericRequest, diff --git a/saml/saml2/binding/impl/SAML2POSTEncoder.cpp b/saml/saml2/binding/impl/SAML2POSTEncoder.cpp index 32c8e9c..1f30f5b 100644 --- a/saml/saml2/binding/impl/SAML2POSTEncoder.cpp +++ b/saml/saml2/binding/impl/SAML2POSTEncoder.cpp @@ -22,7 +22,7 @@ #include "internal.h" #include "exceptions.h" -#include "saml2/binding/SAML2POSTEncoder.h" +#include "binding/MessageEncoder.h" #include "saml2/core/Protocols.h" #include @@ -41,6 +41,27 @@ using namespace std; namespace opensaml { namespace saml2p { + class SAML_DLLLOCAL SAML2POSTEncoder : public MessageEncoder + { + public: + SAML2POSTEncoder(const DOMElement* e, bool simple=false); + virtual ~SAML2POSTEncoder() {} + + long encode( + GenericResponse& genericResponse, + xmltooling::XMLObject* xmlObject, + const char* destination, + const char* recipientID=NULL, + const char* relayState=NULL, + const xmltooling::CredentialResolver* credResolver=NULL, + const XMLCh* sigAlgorithm=NULL + ) const; + + private: + std::string m_template; + bool m_simple; + }; + MessageEncoder* SAML_DLLLOCAL SAML2POSTEncoderFactory(const DOMElement* const & e) { return new SAML2POSTEncoder(e, false); @@ -53,17 +74,17 @@ namespace opensaml { }; }; -static const XMLCh templat[] = UNICODE_LITERAL_8(t,e,m,p,l,a,t,e); +static const XMLCh _template[] = UNICODE_LITERAL_8(t,e,m,p,l,a,t,e); SAML2POSTEncoder::SAML2POSTEncoder(const DOMElement* e, bool simple) : m_simple(simple) { if (e) { - auto_ptr_char t(e->getAttributeNS(NULL, templat)); + auto_ptr_char t(e->getAttributeNS(NULL, _template)); if (t.get()) m_template = t.get(); } if (m_template.empty()) - throw XMLToolingException("SAML2POSTEncoder requires template attribute."); + throw XMLToolingException("SAML2POSTEncoder requires template XML attribute."); } long SAML2POSTEncoder::encode( diff --git a/saml/saml2/binding/impl/SAML2RedirectDecoder.cpp b/saml/saml2/binding/impl/SAML2RedirectDecoder.cpp index 63a324a..cbaa37c 100644 --- a/saml/saml2/binding/impl/SAML2RedirectDecoder.cpp +++ b/saml/saml2/binding/impl/SAML2RedirectDecoder.cpp @@ -23,8 +23,8 @@ #include "internal.h" #include "exceptions.h" #include "binding/HTTPRequest.h" +#include "binding/MessageDecoder.h" #include "saml2/binding/SAML2Redirect.h" -#include "saml2/binding/SAML2RedirectDecoder.h" #include "saml2/core/Protocols.h" #include "saml2/metadata/Metadata.h" #include "saml2/metadata/MetadataProvider.h" @@ -45,6 +45,19 @@ using namespace std; namespace opensaml { namespace saml2p { + class SAML_DLLLOCAL SAML2RedirectDecoder : public MessageDecoder + { + public: + SAML2RedirectDecoder(const DOMElement* e) {} + virtual ~SAML2RedirectDecoder() {} + + xmltooling::XMLObject* decode( + std::string& relayState, + const GenericRequest& genericRequest, + SecurityPolicy& policy + ) const; + }; + MessageDecoder* SAML_DLLLOCAL SAML2RedirectDecoderFactory(const DOMElement* const & e) { return new SAML2RedirectDecoder(e); @@ -52,8 +65,6 @@ namespace opensaml { }; }; -SAML2RedirectDecoder::SAML2RedirectDecoder(const DOMElement* e) {} - XMLObject* SAML2RedirectDecoder::decode( string& relayState, const GenericRequest& genericRequest, diff --git a/saml/saml2/binding/impl/SAML2RedirectEncoder.cpp b/saml/saml2/binding/impl/SAML2RedirectEncoder.cpp index 38bf52c..c4806f2 100644 --- a/saml/saml2/binding/impl/SAML2RedirectEncoder.cpp +++ b/saml/saml2/binding/impl/SAML2RedirectEncoder.cpp @@ -23,9 +23,9 @@ #include "internal.h" #include "exceptions.h" #include "binding/HTTPResponse.h" +#include "binding/MessageEncoder.h" #include "binding/URLEncoder.h" #include "saml2/binding/SAML2Redirect.h" -#include "saml2/binding/SAML2RedirectEncoder.h" #include "saml2/core/Protocols.h" #include @@ -43,6 +43,23 @@ using namespace std; namespace opensaml { namespace saml2p { + class SAML_DLLLOCAL SAML2RedirectEncoder : public MessageEncoder + { + public: + SAML2RedirectEncoder(const DOMElement* e) {} + virtual ~SAML2RedirectEncoder() {} + + long encode( + GenericResponse& genericResponse, + xmltooling::XMLObject* xmlObject, + const char* destination, + const char* recipientID=NULL, + const char* relayState=NULL, + const xmltooling::CredentialResolver* credResolver=NULL, + const XMLCh* sigAlgorithm=NULL + ) const; + }; + MessageEncoder* SAML_DLLLOCAL SAML2RedirectEncoderFactory(const DOMElement* const & e) { return new SAML2RedirectEncoder(e); diff --git a/saml/saml2/binding/impl/SAML2SOAPDecoder.cpp b/saml/saml2/binding/impl/SAML2SOAPDecoder.cpp index f2fb1a9..c48c2f9 100644 --- a/saml/saml2/binding/impl/SAML2SOAPDecoder.cpp +++ b/saml/saml2/binding/impl/SAML2SOAPDecoder.cpp @@ -22,7 +22,8 @@ #include "internal.h" #include "exceptions.h" -#include "saml2/binding/SAML2SOAPDecoder.h" +#include "binding/MessageDecoder.h" +#include "saml2/core/Protocols.h" #include #include @@ -38,6 +39,19 @@ using namespace std; namespace opensaml { namespace saml2p { + class SAML_DLLLOCAL SAML2SOAPDecoder : public MessageDecoder + { + public: + SAML2SOAPDecoder(const DOMElement* e); + virtual ~SAML2SOAPDecoder() {} + + xmltooling::XMLObject* decode( + std::string& relayState, + const GenericRequest& genericRequest, + SecurityPolicy& policy + ) const; + }; + MessageDecoder* SAML_DLLLOCAL SAML2SOAPDecoderFactory(const DOMElement* const & e) { return new SAML2SOAPDecoder(e); diff --git a/saml/saml2/binding/impl/SAML2SOAPEncoder.cpp b/saml/saml2/binding/impl/SAML2SOAPEncoder.cpp index 687cf9e..7a5bfef 100644 --- a/saml/saml2/binding/impl/SAML2SOAPEncoder.cpp +++ b/saml/saml2/binding/impl/SAML2SOAPEncoder.cpp @@ -23,7 +23,7 @@ #include "internal.h" #include "exceptions.h" #include "binding/HTTPResponse.h" -#include "saml2/binding/SAML2SOAPEncoder.h" +#include "binding/MessageEncoder.h" #include "saml2/core/Protocols.h" #include @@ -41,6 +41,23 @@ using namespace std; namespace opensaml { namespace saml2p { + class SAML_DLLLOCAL SAML2SOAPEncoder : public MessageEncoder + { + public: + SAML2SOAPEncoder(const DOMElement* e); + virtual ~SAML2SOAPEncoder() {} + + long encode( + GenericResponse& genericResponse, + xmltooling::XMLObject* xmlObject, + const char* destination, + const char* recipientID=NULL, + const char* relayState=NULL, + const xmltooling::CredentialResolver* credResolver=NULL, + const XMLCh* sigAlgorithm=NULL + ) const; + }; + MessageEncoder* SAML_DLLLOCAL SAML2SOAPEncoderFactory(const DOMElement* const & e) { return new SAML2SOAPEncoder(e);