[java-idp-oidc] branch main updated: JOIDC-137 - KeySet and Configuration audit logging missing informative response binding value

Henri Mikkonen henri.mikkonen at iki.fi
Fri Nov 25 10:59:18 UTC 2022


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

hjmikkon pushed a commit to branch main
in repository java-idp-oidc.

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

The following commit(s) were added to refs/heads/main by this push:
     new e537a9e1 JOIDC-137 - KeySet and Configuration audit logging missing informative response binding value
e537a9e1 is described below

commit e537a9e1eb8f12e3363c3477c39bcda6bd565d17
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Fri Nov 25 12:58:10 2022 +0200

    JOIDC-137 - KeySet and Configuration audit logging missing informative response binding value
    
    https://shibboleth.atlassian.net/browse/JOIDC-137
    
    Fixed the typo in OutboundMessageClassLookupFunction and added specific classes
    for KeySet and OpenIDConfiguration messages.
---
 .../impl/OutboundMessageClassLookupFunction.java   |  2 +-
 .../op/messaging/impl/KeySetSuccessResponse.java   | 50 ++++++++++++++++++++++
 .../impl/OpenIDConfigurationSuccessResponse.java   | 50 ++++++++++++++++++++++
 .../oidc/op/messaging/impl/package-info.java       | 19 ++++++++
 .../impl/FormOutboundDiscoveryResponse.java        |  5 ++-
 .../impl/FormOutboundKeySetResponseMessage.java    |  4 +-
 6 files changed, 125 insertions(+), 5 deletions(-)

diff --git a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/audit/impl/OutboundMessageClassLookupFunction.java b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/audit/impl/OutboundMessageClassLookupFunction.java
index 855935d1..aed1a456 100644
--- a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/audit/impl/OutboundMessageClassLookupFunction.java
+++ b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/audit/impl/OutboundMessageClassLookupFunction.java
@@ -43,7 +43,7 @@ public class OutboundMessageClassLookupFunction implements Function<ProfileReque
      */
     @Nullable @Override
     public String apply(@Nonnull final ProfileRequestContext profileRequestContext) {
-        if (profileRequestContext.getInboundMessageContext() == null) {
+        if (profileRequestContext.getOutboundMessageContext() == null) {
             return null;
         }
         final Object message = profileRequestContext.getOutboundMessageContext().getMessage();
diff --git a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/messaging/impl/KeySetSuccessResponse.java b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/messaging/impl/KeySetSuccessResponse.java
new file mode 100644
index 00000000..3fa79fa7
--- /dev/null
+++ b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/messaging/impl/KeySetSuccessResponse.java
@@ -0,0 +1,50 @@
+/*
+ * 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.idp.plugin.oidc.op.messaging.impl;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import net.minidev.json.JSONObject;
+import net.shibboleth.idp.plugin.oidc.op.messaging.JSONSuccessResponse;
+
+/** KeySet success message class. */
+public class KeySetSuccessResponse extends JSONSuccessResponse {
+
+    /**
+     * Constructor.
+     *
+     * @param contentObject JSON content. MUST not be null.
+     */
+    public KeySetSuccessResponse(@Nonnull final JSONObject contentObject) {
+        super(contentObject);
+    }
+
+    /**
+     * Constructor.
+     * 
+     * @param contentObject JSON content. MUST not be null.
+     * @param cacheControlValue cache control value
+     * @param pragmaValue pragma value
+     */
+    public KeySetSuccessResponse(@Nonnull final JSONObject contentObject, @Nullable final String cacheControlValue,
+            @Nullable final String pragmaValue) {
+        super(contentObject, cacheControlValue, pragmaValue);
+    }
+
+}
diff --git a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/messaging/impl/OpenIDConfigurationSuccessResponse.java b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/messaging/impl/OpenIDConfigurationSuccessResponse.java
new file mode 100644
index 00000000..cfb991ca
--- /dev/null
+++ b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/messaging/impl/OpenIDConfigurationSuccessResponse.java
@@ -0,0 +1,50 @@
+/*
+ * 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.idp.plugin.oidc.op.messaging.impl;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import net.minidev.json.JSONObject;
+import net.shibboleth.idp.plugin.oidc.op.messaging.JSONSuccessResponse;
+
+/** OpenID Configuration success message class. */
+public class OpenIDConfigurationSuccessResponse extends JSONSuccessResponse {
+
+    /**
+     * Constructor.
+     *
+     * @param contentObject JSON content. MUST not be null.
+     */
+    public OpenIDConfigurationSuccessResponse(@Nonnull final JSONObject contentObject) {
+        super(contentObject);
+    }
+
+    /**
+     * Constructor.
+     * 
+     * @param contentObject JSON content. MUST not be null.
+     * @param cacheControlValue cache control value
+     * @param pragmaValue pragma value
+     */
+    public OpenIDConfigurationSuccessResponse(@Nonnull final JSONObject contentObject,
+            @Nullable final String cacheControlValue, @Nullable final String pragmaValue) {
+        super(contentObject, cacheControlValue, pragmaValue);
+    }
+
+}
diff --git a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/messaging/impl/package-info.java b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/messaging/impl/package-info.java
new file mode 100644
index 00000000..ba7eacb2
--- /dev/null
+++ b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/messaging/impl/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+
+/** OIDC message implementations. */
+package net.shibboleth.idp.plugin.oidc.op.messaging.impl;
\ No newline at end of file
diff --git a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/FormOutboundDiscoveryResponse.java b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/FormOutboundDiscoveryResponse.java
index 56493822..4bd42e41 100644
--- a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/FormOutboundDiscoveryResponse.java
+++ b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/FormOutboundDiscoveryResponse.java
@@ -28,7 +28,7 @@ import org.slf4j.LoggerFactory;
 
 import com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata;
 
-import net.shibboleth.idp.plugin.oidc.op.messaging.JSONSuccessResponse;
+import net.shibboleth.idp.plugin.oidc.op.messaging.impl.OpenIDConfigurationSuccessResponse;
 import net.shibboleth.idp.plugin.oidc.op.metadata.resolver.ProviderMetadataResolver;
 import net.shibboleth.idp.profile.AbstractProfileAction;
 import net.shibboleth.utilities.java.support.annotation.constraint.NonnullAfterInit;
@@ -95,7 +95,8 @@ public class FormOutboundDiscoveryResponse extends AbstractProfileAction {
     /** {@inheritDoc} */
     @Override
     protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) {
-        profileRequestContext.getOutboundMessageContext().setMessage(new JSONSuccessResponse(metadata.toJSONObject()));
+        profileRequestContext.getOutboundMessageContext().setMessage(
+                new OpenIDConfigurationSuccessResponse(metadata.toJSONObject()));
     }
 
 }
\ No newline at end of file
diff --git a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/FormOutboundKeySetResponseMessage.java b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/FormOutboundKeySetResponseMessage.java
index c878e788..7caab62c 100644
--- a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/FormOutboundKeySetResponseMessage.java
+++ b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/FormOutboundKeySetResponseMessage.java
@@ -38,7 +38,7 @@ import com.nimbusds.jose.jwk.JWK;
 import com.nimbusds.jose.jwk.JWKSet;
 
 import net.minidev.json.JSONObject;
-import net.shibboleth.idp.plugin.oidc.op.messaging.JSONSuccessResponse;
+import net.shibboleth.idp.plugin.oidc.op.messaging.impl.KeySetSuccessResponse;
 import net.shibboleth.idp.profile.AbstractProfileAction;
 import net.shibboleth.idp.profile.IdPEventIds;
 import net.shibboleth.idp.profile.config.SecurityConfiguration;
@@ -134,7 +134,7 @@ public class FormOutboundKeySetResponseMessage extends AbstractProfileAction {
         }
         final JWKSet keySet = new JWKSet(publishList);
         final JSONObject keySetJson = new JSONObject(keySet.toJSONObject());
-        profileRequestContext.getOutboundMessageContext().setMessage(new JSONSuccessResponse(keySetJson));
+        profileRequestContext.getOutboundMessageContext().setMessage(new KeySetSuccessResponse(keySetJson));
     }
     
     /**

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


More information about the commits mailing list