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

noreply at shibboleth.net noreply at shibboleth.net
Mon Feb 17 23:15:00 EST 2014


Author: scantor
Date: Mon Feb 17 23:15:00 2014
New Revision: 5392

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5392&view=rev
Log:
Remove dependency on implementation class, move to unit test.

Modified:
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/PopulateBindingAndEndpointContexts.java
    trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/profile/PopulateBindingAndEndpointContextsTest.java

Modified: trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/PopulateBindingAndEndpointContexts.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/PopulateBindingAndEndpointContexts.java?rev=5392&r1=5391&r2=5392&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/PopulateBindingAndEndpointContexts.java (original)
+++ trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/PopulateBindingAndEndpointContexts.java Mon Feb 17 23:15:00 2014
@@ -43,9 +43,7 @@
 import org.opensaml.profile.action.EventIds;
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.opensaml.profile.context.navigate.OutboundMessageContextLookup;
-import org.opensaml.saml.common.SignableSAMLObject;
 import org.opensaml.saml.common.binding.BindingDescriptor;
-import org.opensaml.saml.common.binding.DefaultEndpointResolver;
 import org.opensaml.saml.common.binding.EndpointResolver;
 import org.opensaml.saml.common.binding.SAMLBindingSupport;
 import org.opensaml.saml.common.messaging.context.SAMLBindingContext;
@@ -61,7 +59,6 @@
 import org.opensaml.saml.saml2.metadata.AssertionConsumerService;
 import org.opensaml.saml.saml2.metadata.Endpoint;
 import org.opensaml.saml.saml2.metadata.IndexedEndpoint;
-import org.opensaml.xmlsec.signature.SignableXMLObject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -99,7 +96,7 @@
     @Nonnull private QName endpointType;
 
     /** Endpoint resolver. */
-    @Nonnull private EndpointResolver<?> endpointResolver;
+    @NonnullAfterInit private EndpointResolver<?> endpointResolver;
     
     /** List of possible bindings, in preference order. */
     @Nonnull @NonnullElements private List<BindingDescriptor> bindingDescriptors;
@@ -125,12 +122,12 @@
     /** Optional metadata for use in endpoint derivation/validation. */
     @Nullable private SAMLMetadataContext mdContext;
     
+    /** Whether to bypass endpoint validation when message is signed. */
     private boolean skipValidationWhenSigned;
     
     /** Constructor. */
     public PopulateBindingAndEndpointContexts() {
         endpointType = AssertionConsumerService.DEFAULT_ELEMENT_NAME;
-        endpointResolver = new DefaultEndpointResolver();
         bindingDescriptors = Collections.emptyList();
         
         relyingPartyContextLookupStrategy = new ChildContextLookup<>(RelyingPartyContext.class);
@@ -234,6 +231,10 @@
     @Override
     protected void doInitialize() throws ComponentInitializationException {
         super.doInitialize();
+
+        if (endpointResolver == null) {
+            throw new ComponentInitializationException("EndpointResolver cannot be null");
+        }
         
         endpointBuilder = XMLObjectSupport.getBuilder(endpointType);
         if (endpointBuilder == null) {
@@ -242,8 +243,6 @@
             throw new ComponentInitializationException("Builder for endpoint type " + endpointType
                     + " did not result in Endpoint object");
         }
-        
-        endpointResolver.initialize();
     }
     
     /** {@inheritDoc} */
@@ -272,6 +271,7 @@
     }
 
     /** {@inheritDoc} */
+// Checkstyle: CyclomaticComplexity OFF
     @Override protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext)
             throws ProfileException {
         
@@ -330,7 +330,8 @@
         bindingCtx.setRelayState(SAMLBindingSupport.getRelayState(profileRequestContext.getInboundMessageContext()));
         bindingCtx.setBindingUri(resolvedEndpoint.getBinding());
     }
-
+ // Checkstyle: CyclomaticComplexity ON
+    
     /**
      * Build a template Endpoint object to use as input criteria to the resolution process.
      * 

Modified: trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/profile/PopulateBindingAndEndpointContextsTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/profile/PopulateBindingAndEndpointContextsTest.java?rev=5392&r1=5391&r2=5392&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/profile/PopulateBindingAndEndpointContextsTest.java (original)
+++ trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/profile/PopulateBindingAndEndpointContextsTest.java Mon Feb 17 23:15:00 2014
@@ -41,6 +41,7 @@
 import org.opensaml.profile.action.EventIds;

[... 35 lines stripped ...]


More information about the commits mailing list