[java-identity-provider COMMIT] in /trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2: Dec...

noreply at shibboleth.net noreply at shibboleth.net
Wed Feb 5 17:59:59 EST 2014


Author: scantor
Date: Wed Feb  5 17:59:59 2014
New Revision: 5318

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5318&view=rev
Log:
Work in progress on NameID decrypting action.

Added:
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/DecryptNameID.java
      - copied, changed from r5315, trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/DecryptSubjectNameIdentifiers.java
Modified:
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/DecryptAttributes.java
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/DecryptSubjectNameIdentifiers.java

Copied: trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/DecryptNameID.java (from r5315, trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/DecryptSubjectNameIdentifiers.java)
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/DecryptNameID.java?p2=trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/DecryptNameID.java&p1=trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/DecryptSubjectNameIdentifiers.java&r1=5315&r2=5318&rev=5318&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/DecryptSubjectNameIdentifiers.java (original)
+++ trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/DecryptNameID.java Wed Feb  5 17:59:59 2014
@@ -18,25 +18,241 @@
 package net.shibboleth.idp.saml.impl.profile.saml2;
 
 import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 
 import net.shibboleth.idp.profile.AbstractProfileAction;
+import net.shibboleth.idp.profile.IdPEventIds;
+import net.shibboleth.idp.relyingparty.RelyingPartyContext;
+import net.shibboleth.utilities.java.support.component.ComponentSupport;
+import net.shibboleth.utilities.java.support.logic.Constraint;
+
+import org.opensaml.messaging.context.navigate.ChildContextLookup;
+import org.opensaml.messaging.context.navigate.MessageLookup;
 import org.opensaml.profile.ProfileException;
+import org.opensaml.profile.action.ActionSupport;
+import org.opensaml.profile.action.EventIds;
 import org.opensaml.profile.context.ProfileRequestContext;
-
+import org.opensaml.profile.context.navigate.InboundMessageContextLookup;
+import org.opensaml.saml.common.SAMLObject;
+import org.opensaml.saml.common.profile.SAMLEventIds;
+import org.opensaml.saml.saml2.core.Assertion;
+import org.opensaml.saml.saml2.core.AuthnRequest;
+import org.opensaml.saml.saml2.core.EncryptedID;
+import org.opensaml.saml.saml2.core.LogoutRequest;
+import org.opensaml.saml.saml2.core.LogoutResponse;
+import org.opensaml.saml.saml2.core.ManageNameIDRequest;
+import org.opensaml.saml.saml2.core.ManageNameIDResponse;
+import org.opensaml.saml.saml2.core.NameID;
+import org.opensaml.saml.saml2.core.NameIDMappingRequest;
+import org.opensaml.saml.saml2.core.NameIDMappingResponse;
 import org.opensaml.saml.saml2.core.Response;
-import org.springframework.webflow.execution.Event;
-import org.springframework.webflow.execution.RequestContext;
+import org.opensaml.saml.saml2.core.Subject;
+import org.opensaml.saml.saml2.core.SubjectConfirmation;
+import org.opensaml.saml.saml2.core.SubjectQuery;
+import org.opensaml.xmlsec.DecryptionConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Function;
+import com.google.common.base.Functions;
 
 /**
- *
+ * Action to decrypt an {@link EncryptedID} element and replace it with the decrypted {@link NameID}
+ * in situ.
+ * 
+ * <p>All of the built-in SAML message types that may include an {@link EncryptedID} are potentially
+ * handled, but the actual message to handle is obtained via strategy function, by default an inbound
+ * message.</p> 
+ * 
+ * @event {@link EventIds#PROCEED_EVENT_ID}
+ * @event {@link EventIds#INVALID_MSG_CTX}
+ * @event {@link IdPEventIds#INVALID_RELYING_PARTY_CTX}
+ * @event {@link IdPEventIds#INVALID_PROFILE_CONFIG}
+ * @event {@link SAMLEventIds#DECRYPT_NAMEID_FAILED}
  */
-public class DecryptSubjectNameIdentifiers extends AbstractProfileAction<Object, Response> {
-
+public class DecryptNameID extends AbstractProfileAction {
+
+    /** Class logger. */
+    @Nonnull private final Logger log = LoggerFactory.getLogger(DecryptNameID.class);
+    
+    /** Are decryption failures a fatal condition? */
+    private boolean errorFatal;
+
+    /** Strategy used to locate the {@link RelyingPartyContext}. */
+    @Nonnull private Function<ProfileRequestContext, RelyingPartyContext> relyingPartyContextLookupStrategy;
+
+    /** Strategy used to locate the SAML message to operate on. */
+    @Nonnull private Function<ProfileRequestContext, Object> messageLookupStrategy;
+    
+    /** Configuration supporting decryption. */
+    @Nullable private DecryptionConfiguration decryptionConfig;
+    

[... 173 lines stripped ...]


More information about the commits mailing list