[java-identity-provider] 01/19: IDP-1984 WriteAuditLog caches the HttpServletRequest

Rod Widdowson rdw at steadingsoftware.com
Wed Aug 10 13:16:53 UTC 2022


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch maint-4
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=1194ef0b4418b56b8f41a4645bfd75da40327327

commit 1194ef0b4418b56b8f41a4645bfd75da40327327
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu Jul 28 19:42:09 2022 +0100

    IDP-1984 WriteAuditLog caches the HttpServletRequest
    
    https://shibboleth.atlassian.net/browse/IDP-1984
    
    Collect & use the request in execute.
---
 .../idp/profile/audit/impl/WriteAuditLog.java       | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/audit/impl/WriteAuditLog.java b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/audit/impl/WriteAuditLog.java
index f6d28ec92..e588bb524 100644
--- a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/audit/impl/WriteAuditLog.java
+++ b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/audit/impl/WriteAuditLog.java
@@ -33,6 +33,14 @@ import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 import javax.servlet.http.HttpServletRequest;
 
+import org.opensaml.messaging.context.navigate.ChildContextLookup;
+import org.opensaml.profile.action.EventIds;
+import org.opensaml.profile.context.ProfileRequestContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.webflow.execution.Event;
+import org.springframework.webflow.execution.RequestContext;
+
 import net.shibboleth.idp.profile.AbstractProfileAction;
 import net.shibboleth.idp.profile.IdPAuditFields;
 import net.shibboleth.idp.profile.context.AuditContext;
@@ -46,14 +54,6 @@ import net.shibboleth.utilities.java.support.logic.Constraint;
 import net.shibboleth.utilities.java.support.net.HttpServletSupport;
 import net.shibboleth.utilities.java.support.primitive.StringSupport;
 
-import org.opensaml.messaging.context.navigate.ChildContextLookup;
-import org.opensaml.profile.action.EventIds;
-import org.opensaml.profile.context.ProfileRequestContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.webflow.execution.Event;
-import org.springframework.webflow.execution.RequestContext;
-
 //import com.google.common.collect.ImmutableMap;
 
 /**
@@ -84,9 +84,6 @@ public class WriteAuditLog extends AbstractProfileAction {
     /** The AuditContext to operate on. */
     @Nullable private AuditContext auditCtx;
 
-    /** HttpServletRequest object. */
-    @Nullable private HttpServletRequest httpRequest;
-    
     /** Constructor. */
     public WriteAuditLog() {
         auditContextLookupStrategy = new ChildContextLookup<>(AuditContext.class);
@@ -225,7 +222,6 @@ public class WriteAuditLog extends AbstractProfileAction {
         }
         
         auditCtx = auditContextLookupStrategy.apply(profileRequestContext);
-        httpRequest = getHttpServletRequest();
         return true;
     }
     
@@ -244,6 +240,7 @@ public class WriteAuditLog extends AbstractProfileAction {
                         record.append('%');
                     } else {
                         final String field = token.substring(1);
+                        final HttpServletRequest httpRequest = getHttpServletRequest();
                         
                         if (IdPAuditFields.EVENT_TIME.equals(field)) {
                             record.append(dateTimeFormatter.format(Instant.now()));

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list