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

noreply at shibboleth.net noreply at shibboleth.net
Tue Feb 17 13:38:39 EST 2015


Author: scantor
Date: Tue Feb 17 13:38:39 2015
New Revision: 7350

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7350&view=rev
Log:
IDP-596 - malformed reload-service request loops infinitely

Modified:
    trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/ReloadServiceConfiguration.java
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/ReloadMetadata.java

Modified: trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/ReloadServiceConfiguration.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/ReloadServiceConfiguration.java?rev=7350&r1=7349&r2=7350&view=diff
==============================================================================
--- trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/ReloadServiceConfiguration.java (original)
+++ trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/ReloadServiceConfiguration.java Tue Feb 17 13:38:39 2015
@@ -99,7 +99,7 @@
         
         service = serviceLookupStrategy.apply(profileRequestContext);
         if (service == null) {
-            log.debug("{} Unable to locate service to reload", getLogPrefix());
+            log.warn("{} Unable to locate service to reload", getLogPrefix());
             try {
                 getHttpServletResponse().sendError(HttpServletResponse.SC_NOT_FOUND, "Service not found.");
             } catch (final IOException e) {
@@ -152,29 +152,25 @@
         @Nullable public ReloadableService apply(@Nullable final ProfileRequestContext input) {
 
             if (getHttpServletRequest() == null) {
-                log.debug("{} HttpServletRequest not found", getLogPrefix());
-                ActionSupport.buildEvent(input, EventIds.INVALID_PROFILE_CTX);
+                log.error("{} HttpServletRequest not found", getLogPrefix());
                 return null;
             }
             
             final String id = StringSupport.trimOrNull(getHttpServletRequest().getParameter(SERVICE_ID));
             if (id == null) {
-                log.debug("{} No 'id' parameter found in request", getLogPrefix());
-                ActionSupport.buildEvent(input, EventIds.INVALID_MESSAGE);
+                log.warn("{} No 'id' parameter found in request", getLogPrefix());
                 return null;
             }
             
             final SpringRequestContext springRequestContext = input.getSubcontext(SpringRequestContext.class);
             if (springRequestContext == null) {
-                log.debug("{} Spring request context not found in profile request context", getLogPrefix());
-                ActionSupport.buildEvent(input, EventIds.INVALID_PROFILE_CTX);
+                log.warn("{} Spring request context not found in profile request context", getLogPrefix());
                 return null;
             }
 
             final RequestContext requestContext = springRequestContext.getRequestContext();
             if (requestContext == null) {
-                log.debug("{} Web Flow request context not found in Spring request context", getLogPrefix());
-                ActionSupport.buildEvent(input, EventIds.INVALID_PROFILE_CTX);
+                log.warn("{} Web Flow request context not found in Spring request context", getLogPrefix());
                 return null;
             }
             
@@ -187,7 +183,7 @@
                 
             }
             
-            log.debug("{} No bean of the correct type found named {}", getLogPrefix(), id);
+            log.warn("{} No bean of the correct type found named {}", getLogPrefix(), id);
             return null;
         }
         

Modified: trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/ReloadMetadata.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/ReloadMetadata.java?rev=7350&r1=7349&r2=7350&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/ReloadMetadata.java (original)
+++ trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/ReloadMetadata.java Tue Feb 17 13:38:39 2015
@@ -104,8 +104,12 @@
         
         id = getHttpServletRequest() != null ? getHttpServletRequest().getParameter(RESOLVER_ID) : null;
         if (id == null) {
-            log.debug("{} No 'id' parameter found in request", getLogPrefix());
-            ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_MESSAGE);
+            log.warn("{} No 'id' parameter found in request", getLogPrefix());
+            try {
+                getHttpServletResponse().sendError(HttpServletResponse.SC_NOT_FOUND, "Metadata source not found.");
+            } catch (final IOException e) {
+                ActionSupport.buildEvent(profileRequestContext, EventIds.IO_ERROR);
+            }
             return false;
         }
         
@@ -146,12 +150,12 @@

[... 15 lines stripped ...]


More information about the commits mailing list