[java-identity-provider COMMIT] in /trunk: idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/EventIds.java i...

noreply at shibboleth.net noreply at shibboleth.net
Mon Jun 4 13:43:07 BST 2012


Author: lajoie
Date: Mon Jun  4 13:43:06 2012
New Revision: 4194

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4194&view=rev
Log:
Move to model where most branching conditions are exposed as event IDs so that deployers can decide how to treat such cases (e.g., ignore them, treat them as an error)

Added:
    trunk/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/EventIds.java   (with props)
Modified:
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddAttributeStatementToAssertion.java
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddAudienceRestrictionToAssertions.java
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddDoNotCacheConditionToAssertions.java
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddInResponseToToResponse.java
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddNotBeforeConditionToAssertions.java
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddNotOnOrAfterConditionToAssertions.java
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddResponseShell.java
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/CheckRequestVersion.java
    trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/profile/saml1/AddAttributeStatementToAssertionTest.java
    trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/profile/saml1/CheckRequestVersionTest.java

Modified: trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddAttributeStatementToAssertion.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddAttributeStatementToAssertion.java?rev=4194&r1=4193&r2=4194&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddAttributeStatementToAssertion.java (original)
+++ trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddAttributeStatementToAssertion.java Mon Jun  4 13:43:06 2012
@@ -37,6 +37,7 @@
 import net.shibboleth.idp.profile.ProfileRequestContext;
 import net.shibboleth.idp.relyingparty.RelyingPartyContext;
 import net.shibboleth.idp.saml.attribute.encoding.AbstractSaml1AttributeEncoder;
+import net.shibboleth.idp.saml.profile.EventIds;
 import net.shibboleth.idp.saml.profile.saml1.Saml1ActionSupport;
 import net.shibboleth.utilities.java.support.component.ComponentSupport;
 import net.shibboleth.utilities.java.support.logic.Constraint;
@@ -61,24 +62,12 @@
  */
 @Events({
         @Event(id = ActionSupport.PROCEED_EVENT_ID),
-        @Event(id = AddAttributeStatementToAssertion.NO_RPC_EVENT_ID,
+        @Event(id = EventIds.NO_RELYING_PARTY_CTX,
                 description = "Returned if no relying party information is associated with the current request"),
-        @Event(id = AddAttributeStatementToAssertion.NO_AC_EVENT_ID,
+        @Event(id = EventIds.NO_ATTRIBUTE_CTX,
                 description = "Returned if no attribute context is associated with the relying party context"),
-        @Event(id = AddAttributeStatementToAssertion.UTEA_EVENT_ID,
-                description = "Returned if there was a problem encoding an attribute")})
+        @Event(id = EventIds.UNABLE_ENCODE_ATTRIBUTE, description = "Returned if there was a problem encoding an attribute")})
 public class AddAttributeStatementToAssertion extends AbstractProfileAction<Object, Response> {
-
-    /**
-     * ID of the event returned if no {@link RelyingPartyContext} is associated with the {@link ProfileRequestContext}.
-     */
-    public static final String NO_RPC_EVENT_ID = "NoRelyingPartyContext";
-
-    /** ID of the event returned if no {@link AttributeContext} is associated with the {@link RelyingPartyContext}. */
-    public static final String NO_AC_EVENT_ID = "NoAttributeContext";
-
-    /** ID of the transition returned if some attributes can not be encoded. */
-    public static final String UTEA_EVENT_ID = "UnableToEncodeAttribute";
 
     /** Class logger. */
     private final Logger log = LoggerFactory.getLogger(AddAttributeStatementToAssertion.class);
@@ -88,7 +77,7 @@
 
     /**
      * Whether attributes that result in an {@link AttributeEncodingException} when being encoded should be ignored or
-     * result in an {@link #UTEA_EVENT_ID} transition.
+     * result in an {@link #UNABLE_ENCODE_ATTRIBUTE} transition.
      */
     private boolean ignoringUnencodableAttributes;
 
@@ -166,14 +155,14 @@
         final RelyingPartyContext relyingPartyCtx = relyingPartyContextLookupStrategy.apply(profileRequestContext);
         if (relyingPartyCtx == null) {
             log.error("Action {}: No relying party context located in current profile request context", getId());
-            return ActionSupport.buildEvent(this, NO_RPC_EVENT_ID);

[... 685 lines stripped ...]


More information about the commits mailing list