Prepare policy API for mix-in subclassing. Allow policy rules to distinguish success...
[shibboleth/cpp-opensaml.git] / saml / binding / SecurityPolicyRule.h
index 095e115..ae17ba4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -54,16 +54,19 @@ namespace opensaml {
          * 
          * <p>An exception will be raised if the message is invalid according to
          * a policy rule.
+         *
+         * <p>The return value is used to indicate whether a message was ignored or
+         * successfully processed. A false value signals that the rule wasn't successful
+         * but was also not unsuccessful, because the rule was inapplicable to the message.
          * 
          * @param message   the incoming message
          * @param request   the protocol request
-         * @param protocol  the protocol family in use
          * @param policy    SecurityPolicy to provide various components and track message data
+         * @return  indicator as to whether a message was understood and processed
          */
-        virtual void evaluate(
+        virtual bool evaluate(
             const xmltooling::XMLObject& message,
             const xmltooling::GenericRequest* request,
-            const XMLCh* protocol,
             SecurityPolicy& policy
             ) const=0;
     };
@@ -74,20 +77,6 @@ namespace opensaml {
     void SAML_API registerSecurityPolicyRules();
 
     /**
-     * SecurityPolicyRule for processing SAML 1.x messages.
-     * 
-     * Extracts message ID, timestamp, and issuer information.
-     */
-    #define SAML1MESSAGE_POLICY_RULE  "SAML1Message"
-
-    /**
-     * SecurityPolicyRule for processing SAML 2.0 messages.
-     * 
-     * Extracts message ID, timestamp, and issuer information.
-     */
-    #define SAML2MESSAGE_POLICY_RULE  "SAML2Message"
-
-    /**
      * SecurityPolicyRule for TLS client certificate authentication.
      * 
      * Evaluates client certificates against the issuer's metadata.