[java-oidc-common] branch main updated: JCOMOIDC-38 - Move various support classes from the OP plugin

Phil Smart philip.smart at jisc.ac.uk
Thu Nov 24 15:49:41 UTC 2022


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

philsmart 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=463f36e68c63cacf1b4503035b1bbf3d856cb69c

The following commit(s) were added to refs/heads/main by this push:
     new 463f36e  JCOMOIDC-38 - Move various support classes from the OP plugin
463f36e is described below

commit 463f36e68c63cacf1b4503035b1bbf3d856cb69c
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Thu Nov 24 15:49:38 2022 +0000

    JCOMOIDC-38 - Move various support classes from the OP plugin
    
     - Move outbound message class lookup function from OP - for audit.
    
    https://shibboleth.atlassian.net/browse/JCOMOIDC-38
---
 .../security/impl/CredentialConversionUtil.java    |  2 +-
 .../impl/OutboundMessageClassLookupFunction.java   | 55 ++++++++++++++++++++++
 2 files changed, 56 insertions(+), 1 deletion(-)

diff --git a/oidc-common-crypto-impl/src/main/java/net/shibboleth/oidc/security/impl/CredentialConversionUtil.java b/oidc-common-crypto-impl/src/main/java/net/shibboleth/oidc/security/impl/CredentialConversionUtil.java
index 5cfed4d..24c8859 100644
--- a/oidc-common-crypto-impl/src/main/java/net/shibboleth/oidc/security/impl/CredentialConversionUtil.java
+++ b/oidc-common-crypto-impl/src/main/java/net/shibboleth/oidc/security/impl/CredentialConversionUtil.java
@@ -87,7 +87,7 @@ public final class CredentialConversionUtil {
     }
 
     /**
-     * Converts credential to JWK. Only RSA and EC keys supported.
+     * Converts credential to JWK with only *public* components. Only RSA and EC keys supported.
      * 
      * @param credential to convert.
      * @return credential as JWK.
diff --git a/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/audit/impl/OutboundMessageClassLookupFunction.java b/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/audit/impl/OutboundMessageClassLookupFunction.java
new file mode 100644
index 0000000..5ed95d1
--- /dev/null
+++ b/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/audit/impl/OutboundMessageClassLookupFunction.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements.  See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.shibboleth.oidc.profile.audit.impl;
+
+import java.util.function.Function;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import org.opensaml.profile.context.ProfileRequestContext;
+
+/**
+ * Looks up the value of the simple class name from the outbound message context's message object.
+ */
+public class OutboundMessageClassLookupFunction implements Function<ProfileRequestContext, String> {
+    
+    /**
+     * Constructor. 
+     */
+    public OutboundMessageClassLookupFunction() {
+
+    }
+
+    /**
+     * The simple name of the message class in the outbound message context. Null if it doesn't exist.
+     * 
+     * {@inheritDoc}
+     */
+    @Nullable @Override
+    public String apply(@Nonnull final ProfileRequestContext profileRequestContext) {
+        if (profileRequestContext.getOutboundMessageContext() == null) {
+            return null;
+        }
+        final Object message = profileRequestContext.getOutboundMessageContext().getMessage();
+        if (message == null) {
+            return null;
+        }
+        return message.getClass().getSimpleName();
+    }
+}

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


More information about the commits mailing list