#include "exceptions.h"
#include "saml1/core/Assertions.h"
+#include <xmltooling/validation/ValidatorSuite.h>
+
using namespace opensaml::saml1;
using namespace opensaml;
using namespace xmltooling;
XMLOBJECTVALIDATOR_REQUIRE(Assertion,Issuer);
XMLOBJECTVALIDATOR_REQUIRE(Assertion,IssueInstant);
if (ptr->getAuthenticationStatements().empty() &&
+ ptr->getAttributeStatements().empty() &&
+ ptr->getAuthorizationDecisionStatements().empty() &&
ptr->getSubjectStatements().empty() &&
ptr->getStatements().empty())
throw ValidationException("Assertion must have at least one statement.");
+ pair<bool,int> minor=ptr->getMinorVersion();
+ if (!minor.first)
+ throw ValidationException("Assertion must have MinorVersion");
+ if (minor.second==0 && ptr->getConditions() && !ptr->getConditions()->getDoNotCacheConditions().empty())
+ throw ValidationException("SAML 1.0 assertions cannot contain DoNotCacheCondition elements.");
END_XMLOBJECTVALIDATOR;
class SAML_DLLLOCAL checkWildcardNS {
#define REGISTER_ELEMENT(cname) \
q=QName(SAMLConstants::SAML1_NS,cname::LOCAL_NAME); \
XMLObjectBuilder::registerBuilder(q,new cname##Builder()); \
- Validator::registerValidator(q,new cname##SchemaValidator())
+ SchemaValidators.registerValidator(q,new cname##SchemaValidator())
#define REGISTER_TYPE(cname) \
q=QName(SAMLConstants::SAML1_NS,cname::TYPE_NAME); \
XMLObjectBuilder::registerBuilder(q,new cname##Builder()); \
- Validator::registerValidator(q,new cname##SchemaValidator())
+ SchemaValidators.registerValidator(q,new cname##SchemaValidator())
#define REGISTER_ELEMENT_NOVAL(cname) \
q=QName(SAMLConstants::SAML1_NS,cname::LOCAL_NAME); \