[java-oidc-common] branch main updated: OSJ-354: Suffix the PROTOCOL_MESSAGE category with .SAML

Brent Putman putmanb at georgetown.edu
Wed Aug 2 23:38:54 UTC 2023


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

putmanb pushed a commit to branch main
in repository java-oidc-common.

View the commit online:
http://git.shibboleth.net/view/?p=java-oidc-common.git;a=commit;h=e38e39ac59628f614d5a8c73a42ca6ad2639ea56

The following commit(s) were added to refs/heads/main by this push:
     new e38e39a  OSJ-354: Suffix the PROTOCOL_MESSAGE category with .SAML
e38e39a is described below

commit e38e39ac59628f614d5a8c73a42ca6ad2639ea56
Author: Brent Putman <putmanb at georgetown.edu>
AuthorDate: Wed Aug 2 19:10:33 2023 -0400

    OSJ-354: Suffix the PROTOCOL_MESSAGE category with .SAML
---
 .../oidc/profile/decoding/impl/HTTPPostAuthnResponseDecoder.java | 9 +++++++++
 .../profile/decoding/impl/HTTPRedirectAuthnResponseDecoder.java  | 9 +++++++++
 .../oidc/profile/encoding/impl/AbstractOIDCMessageEncoder.java   | 8 ++++++++
 .../oidc/profile/encoding/impl/SimpleNimbusResponseEncoder.java  | 9 +++++++++
 oidc-common-profile-impl/src/test/resources/logback-test.xml     | 3 +++
 5 files changed, 38 insertions(+)

diff --git a/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/decoding/impl/HTTPPostAuthnResponseDecoder.java b/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/decoding/impl/HTTPPostAuthnResponseDecoder.java
index 1449742..4f5bf86 100644
--- a/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/decoding/impl/HTTPPostAuthnResponseDecoder.java
+++ b/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/decoding/impl/HTTPPostAuthnResponseDecoder.java
@@ -17,6 +17,7 @@ package net.shibboleth.oidc.profile.decoding.impl;
 import java.io.IOException;
 
 import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 
 import org.opensaml.messaging.context.MessageContext;
 import org.opensaml.messaging.decoder.MessageDecoder;
@@ -65,4 +66,12 @@ public class HTTPPostAuthnResponseDecoder extends AbstractHttpServletRequestMess
         }
         setMessageContext(messageContext);        
     }
+    
+    /** {@inheritDoc} */
+    @Override
+    @Nullable
+    protected String serializeMessageForLogging(@Nullable Object message) {
+        // Returning null disables log output. If want protocol message logging, need to implement this.
+        return null;
+    }
 }
diff --git a/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/decoding/impl/HTTPRedirectAuthnResponseDecoder.java b/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/decoding/impl/HTTPRedirectAuthnResponseDecoder.java
index d30793c..77db683 100644
--- a/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/decoding/impl/HTTPRedirectAuthnResponseDecoder.java
+++ b/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/decoding/impl/HTTPRedirectAuthnResponseDecoder.java
@@ -17,6 +17,7 @@ package net.shibboleth.oidc.profile.decoding.impl;
 import java.io.IOException;
 
 import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 
 import org.opensaml.messaging.context.MessageContext;
 import org.opensaml.messaging.decoder.MessageDecoder;
@@ -66,4 +67,12 @@ public class HTTPRedirectAuthnResponseDecoder extends AbstractHttpServletRequest
         }
         setMessageContext(messageContext);        
     }
+    
+    /** {@inheritDoc} */
+    @Override
+    @Nullable
+    protected String serializeMessageForLogging(@Nullable Object message) {
+        // Returning null disables log output. If want protocol message logging, need to implement this.
+        return null;
+    }
 }
diff --git a/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/encoding/impl/AbstractOIDCMessageEncoder.java b/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/encoding/impl/AbstractOIDCMessageEncoder.java
index f4cd395..fda7f81 100644
--- a/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/encoding/impl/AbstractOIDCMessageEncoder.java
+++ b/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/encoding/impl/AbstractOIDCMessageEncoder.java
@@ -316,4 +316,12 @@ public abstract class AbstractOIDCMessageEncoder extends AbstractHttpServletResp
         return pairByKey.get().getSecond().contains(value);
     }
 
+    /** {@inheritDoc} */
+    @Override
+    @Nullable
+    protected String serializeMessageForLogging(@Nullable Object message) {
+        // Returning null disables log output. If want protocol message logging, need to implement this.
+        return null;
+    }
+
 }
diff --git a/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/encoding/impl/SimpleNimbusResponseEncoder.java b/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/encoding/impl/SimpleNimbusResponseEncoder.java
index aec88dc..c87ece6 100644
--- a/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/encoding/impl/SimpleNimbusResponseEncoder.java
+++ b/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/encoding/impl/SimpleNimbusResponseEncoder.java
@@ -17,6 +17,7 @@ package net.shibboleth.oidc.profile.encoding.impl;
 import java.io.IOException;
 
 import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 
 import org.opensaml.messaging.encoder.MessageEncodingException;
 import org.opensaml.messaging.encoder.servlet.AbstractHttpServletResponseMessageEncoder;
@@ -54,5 +55,13 @@ public class SimpleNimbusResponseEncoder extends AbstractHttpServletResponseMess
             throw new MessageEncodingException("Problem encoding response", e);
         }
     }
+    
+    /** {@inheritDoc} */
+    @Override
+    @Nullable
+    protected String serializeMessageForLogging(@Nullable Object message) {
+        // Returning null disables log output. If want protocol message logging, need to implement this.
+        return null;
+    }
 
 }
diff --git a/oidc-common-profile-impl/src/test/resources/logback-test.xml b/oidc-common-profile-impl/src/test/resources/logback-test.xml
index 5b165b1..f64dfda 100644
--- a/oidc-common-profile-impl/src/test/resources/logback-test.xml
+++ b/oidc-common-profile-impl/src/test/resources/logback-test.xml
@@ -23,6 +23,9 @@
         <appender-ref ref="STDOUT" />
     </logger>
 
+     <logger name="PROTOCOL_MESSAGE" level="TRACE" additivity="false">
+        <appender-ref ref="STDOUT" />
+    </logger>
    
     <root>
         <level value="INFO" />

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


More information about the commits mailing list