/*
- * Copyright 2001-2006 Internet2
+ * 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.
#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"
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);
const QName& q = message.getElementQName();
policy.setMessageQName(&q);
+
+ if (!XMLString::equals(q.getNamespaceURI(), samlconstants::SAML1P_NS)) {
+ log.debug("not a SAML 1.x protocol message");
+ return;
+ }
+
try {
const RootObject& samlRoot = dynamic_cast<const RootObject&>(message);
policy.setMessageID(samlRoot.getID());
policy.setIssueInstant(samlRoot.getIssueInstantEpoch());
- if (!XMLString::equals(q.getNamespaceURI(), samlconstants::SAML1P_NS)) {
- log.warn("not a SAML 1.x protocol message");
- throw BindingException("Message was not a recognized SAML 1.x protocol element.");
- }
-
log.debug("extracting issuer from message");
// Only samlp:Response is known to carry issuer (via payload) in standard SAML 1.x.