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

Rod Widdowson rdw at steadingsoftware.com
Sun Aug 14 09:30:31 UTC 2022


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

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

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

commit d2ad4e68262bdae0cf79d0d5d43c0ef0f5153436
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().
---
 .../net/shibboleth/idp/profile/audit/impl/WriteAuditLog.java     | 9 ++-------
 1 file changed, 2 insertions(+), 7 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 2555f61fa..98e2698e3 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
@@ -53,8 +53,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 com.google.common.collect.ImmutableMap;
-
 /**
  * Action that produces audit log entries based on an {@link AuditContext} and one or more formatting strings. 
  * 
@@ -83,9 +81,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);
@@ -221,7 +216,6 @@ public class WriteAuditLog extends AbstractProfileAction {
         }
         
         auditCtx = auditContextLookupStrategy.apply(profileRequestContext);
-        httpRequest = getHttpServletRequest();
         return true;
     }
     
@@ -240,6 +234,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()));
@@ -290,4 +285,4 @@ public class WriteAuditLog extends AbstractProfileAction {
         
     }
     
-}
\ No newline at end of file
+}

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


More information about the commits mailing list