[java-identity-provider COMMIT] in /trunk/idp-saml-impl/src: main/java/net/shibboleth/idp/saml/impl/profile/saml1/Add...
noreply at shibboleth.net
noreply at shibboleth.net
Fri May 11 13:58:38 BST 2012
Author: lajoie
Date: Fri May 11 13:58:38 2012
New Revision: 4191
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4191&view=rev
Log:
Start adding some transition documentation and some action unit tests
Added:
trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/profile/saml1/AddAttributeStatementToAssertionTest.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/AddSubjectToStatements.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=4191&r1=4190&r2=4191&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 Fri May 11 13:58:38 2012
@@ -25,6 +25,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import net.shibboleth.ext.spring.webflow.Event;
+import net.shibboleth.ext.spring.webflow.Events;
import net.shibboleth.idp.attribute.Attribute;
import net.shibboleth.idp.attribute.AttributeContext;
import net.shibboleth.idp.attribute.AttributeEncoder;
@@ -48,7 +50,6 @@
import org.opensaml.saml.saml1.core.Response;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.webflow.execution.Event;
import org.springframework.webflow.execution.RequestContext;
import com.google.common.base.Function;
@@ -58,13 +59,38 @@
* {@link ProfileRequestContext#getOutboundMessageContext()}. The {@link Attribute} set to be encoded is drawn from the
* {@link AttributeContext} located on the {@link RelyingPartyContext} located on the {@link ProfileRequestContext}.
*/
+ at Events({
+ @Event(id = ActionSupport.PROCEED_EVENT_ID),
+ @Event(id = AddAttributeStatementToAssertion.NO_RPC_EVENT_ID,
+ description = "Returned if no relying party information is associated with the current request"),
+ @Event(id = AddAttributeStatementToAssertion.NO_AC_EVENT_ID,
+ 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")})
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);
/** Whether the generated attribute statement should be placed in its own assertion or added to one if it exists. */
private boolean statementInOwnAssertion;
+
+ /**
+ * Whether attributes that result in an {@link AttributeEncodingException} when being encoded should be ignored or
+ * result in an {@link #UTEA_EVENT_ID} transition.
+ */
+ private boolean ignoringUnencodableAttributes;
/**
* Strategy used to locate the {@link RelyingPartyContext} associated with a given {@link ProfileRequestContext}.
@@ -96,8 +122,8 @@
* Sets whether the generated attribute statement should be placed in its own assertion or added to one if it
* exists.
*
- * @param inOwnAssertion whether the generated attribute statement should be placed in its own assertion or
- * added to one if it exists
+ * @param inOwnAssertion whether the generated attribute statement should be placed in its own assertion or added to
+ * one if it exists
*/
public synchronized void setStatementInOwnAssertion(boolean inOwnAssertion) {
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
@@ -132,32 +158,41 @@
}
/** {@inheritDoc} */
- protected Event doExecute(final HttpServletRequest httpRequest, final HttpServletResponse httpResponse,
[... 288 lines stripped ...]
More information about the commits
mailing list