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

noreply at shibboleth.net noreply at shibboleth.net
Sun May 11 17:18:52 EDT 2014


Author: scantor
Date: Sun May 11 17:18:51 2014
New Revision: 5902

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5902&view=rev
Log:
Moved new predicates to OpenSAML, and layer legacy conditional rule on top of them.

Modified:
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/config/logic/LegacyEncryptionRequirementPredicate.java
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/config/logic/LegacySigningRequirementPredicate.java
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/config/logic/NoConfidentialityMessageChannelPredicate.java
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/config/logic/NoIntegrityMessageChannelPredicate.java

Modified: trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/config/logic/LegacyEncryptionRequirementPredicate.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/config/logic/LegacyEncryptionRequirementPredicate.java?rev=5902&r1=5901&r2=5902&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/config/logic/LegacyEncryptionRequirementPredicate.java (original)
+++ trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/config/logic/LegacyEncryptionRequirementPredicate.java Sun May 11 17:18:51 2014
@@ -23,16 +23,14 @@
 import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
 import net.shibboleth.utilities.java.support.logic.Constraint;
 
-import org.opensaml.messaging.context.MessageChannelSecurityContext;
 import org.opensaml.profile.context.ProfileRequestContext;
-
-import com.google.common.base.Predicate;
+import org.opensaml.profile.logic.NoConfidentialityMessageChannelPredicate;
 
 /**
  * A predicate implementation that supports the legacy V2 configuration options of
  * "always", "conditional", and "never" for encryption.
  */
-public class LegacyEncryptionRequirementPredicate implements Predicate<ProfileRequestContext> {
+public class LegacyEncryptionRequirementPredicate extends NoConfidentialityMessageChannelPredicate {
 
     /** Internal enum for the options supported. */
     private enum EncryptionRequirementSetting {
@@ -78,12 +76,7 @@
                 return false;
                 
             case CONDITIONAL:
-                if (input == null || input.getOutboundMessageContext() == null) {
-                    throw new IllegalArgumentException(
-                            "Conditional setting for encryption requires non-null outbound message context");
-                }
-                return !input.getOutboundMessageContext().getSubcontext(
-                        MessageChannelSecurityContext.class, true).isConfidentialityActive();
+                return super.apply(input);
                 
             default:
                 throw new IllegalArgumentException("Encryption requirement setting not one of the supported values");

Modified: trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/config/logic/LegacySigningRequirementPredicate.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/config/logic/LegacySigningRequirementPredicate.java?rev=5902&r1=5901&r2=5902&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/config/logic/LegacySigningRequirementPredicate.java (original)
+++ trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/config/logic/LegacySigningRequirementPredicate.java Sun May 11 17:18:51 2014
@@ -23,16 +23,14 @@
 import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
 import net.shibboleth.utilities.java.support.logic.Constraint;
 
-import org.opensaml.messaging.context.MessageChannelSecurityContext;
 import org.opensaml.profile.context.ProfileRequestContext;
-
-import com.google.common.base.Predicate;
+import org.opensaml.profile.logic.NoIntegrityMessageChannelPredicate;
 
 /**
  * A predicate implementation that supports the legacy V2 configuration options of
  * "always", "conditional", and "never" for signing.
  */
-public class LegacySigningRequirementPredicate implements Predicate<ProfileRequestContext> {
+public class LegacySigningRequirementPredicate extends NoIntegrityMessageChannelPredicate {
 
     /** Internal enum for the options supported. */
     private enum SigningRequirementSetting {
@@ -78,12 +76,7 @@
                 return false;
                 
             case CONDITIONAL:
-                if (input == null || input.getOutboundMessageContext() == null) {
-                    throw new IllegalArgumentException(
-                            "Conditional setting for signing requires non-null outbound message context");
-                }
-                return !input.getOutboundMessageContext().getSubcontext(

[... 6 lines stripped ...]


More information about the commits mailing list