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

Henri Mikkonen henri.mikkonen at iki.fi
Fri Dec 2 08:02:22 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=aed9c5fdc230462712827dd468e77829e5301fa9

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

commit aed9c5fdc230462712827dd468e77829e5301fa9
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Fri Dec 2 10:01:16 2022 +0200

    JCOMOIDC-38 - Move various support classes from the OP plugin
    
    https://shibboleth.atlassian.net/browse/JCOMOIDC-38
    
    Deleted the audit extractors that exist similarly in commons.
---
 .../op/audit/impl/ForceAuthnAuditExtractor.java    | 59 ----------------------
 .../impl/InboundMessageClassLookupFunction.java    | 48 ------------------
 .../impl/OutboundMessageClassLookupFunction.java   | 55 --------------------
 .../META-INF/net.shibboleth.idp/postconfig.xml     |  6 +--
 4 files changed, 3 insertions(+), 165 deletions(-)

diff --git a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/audit/impl/ForceAuthnAuditExtractor.java b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/audit/impl/ForceAuthnAuditExtractor.java
deleted file mode 100644
index 21734ea2..00000000
--- a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/audit/impl/ForceAuthnAuditExtractor.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.audit.impl;
-
-import java.util.function.Function;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-import org.opensaml.profile.context.ProfileRequestContext;
-
-import com.nimbusds.openid.connect.sdk.AuthenticationRequest;
-import com.nimbusds.openid.connect.sdk.Prompt;
-
-import net.shibboleth.utilities.java.support.logic.Constraint;
-
-/** {@link Function} that returns true is prompt contains login in {@link AuthenticationRequest}. */
-public class ForceAuthnAuditExtractor implements Function<ProfileRequestContext, Boolean> {
-
-    /** Lookup strategy for message to read from. */
-    @Nonnull
-    private final Function<ProfileRequestContext, AuthenticationRequest> requestLookupStrategy;
-
-    /**
-     * Constructor.
-     *
-     * @param strategy lookup strategy for message
-     */
-    public ForceAuthnAuditExtractor(@Nonnull final Function<ProfileRequestContext, AuthenticationRequest> strategy) {
-        requestLookupStrategy = Constraint.isNotNull(strategy, "AuthenticationRequest lookup strategy cannot be null");
-    }
-
-    /** {@inheritDoc} */
-    @Nullable
-    public Boolean apply(@Nullable final ProfileRequestContext input) {
-        final AuthenticationRequest request = requestLookupStrategy.apply(input);
-        if (request != null && request.getPrompt() != null) {
-            return request.getPrompt().contains(Prompt.Type.LOGIN);
-        }
-
-        return null;
-    }
-
-}
\ No newline at end of file
diff --git a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/audit/impl/InboundMessageClassLookupFunction.java b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/audit/impl/InboundMessageClassLookupFunction.java
deleted file mode 100644
index 69833e55..00000000
--- a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/audit/impl/InboundMessageClassLookupFunction.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.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 inbound message context's message object.
- */
-public class InboundMessageClassLookupFunction implements Function<ProfileRequestContext, String> {
-
-    /**
-     * The simple name of the message class in the inbound message context. Null if it doesn't exist.
-     * 
-     * {@inheritDoc}
-     */
-    @Nullable
-    public String apply(@Nonnull final ProfileRequestContext profileRequestContext) {
-        if (profileRequestContext.getInboundMessageContext() == null) {
-            return null;
-        }
-        final Object message = profileRequestContext.getInboundMessageContext().getMessage();
-        if (message == null) {
-            return null;
-        }
-        return message.getClass().getSimpleName();
-    }
-}
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
deleted file mode 100644
index aed1a456..00000000
--- a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/audit/impl/OutboundMessageClassLookupFunction.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.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();
-    }
-}
diff --git a/idp-oidc-extension-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml b/idp-oidc-extension-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
index 5ec42f3e..a9beac45 100644
--- a/idp-oidc-extension-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
+++ b/idp-oidc-extension-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
@@ -339,7 +339,7 @@
                         <util:constant
                             static-field="net.shibboleth.idp.plugin.oidc.op.audit.AuditFields.INBOUND_MESSAGE_CLASS" />
                     </key>
-                    <bean class="net.shibboleth.idp.plugin.oidc.op.audit.impl.InboundMessageClassLookupFunction" />
+                    <bean class="net.shibboleth.oidc.profile.audit.impl.InboundMessageClassLookupFunction" />
                 </entry>
                 <entry>
                     <key>
@@ -367,7 +367,7 @@
                     <key>
                         <util:constant static-field="net.shibboleth.idp.plugin.oidc.op.audit.AuditFields.FORCE_AUTHN"/>
                     </key>
-                    <bean class="net.shibboleth.idp.plugin.oidc.op.audit.impl.ForceAuthnAuditExtractor">
+                    <bean class="net.shibboleth.oidc.profile.audit.impl.ForceAuthnAuditExtractor">
                         <constructor-arg>
                             <bean parent="shibboleth.Functions.Compose"
                                 c:g-ref="shibboleth.MessageLookup.oidc.AuthenticationRequest"
@@ -516,7 +516,7 @@
                         <util:constant
                             static-field="net.shibboleth.idp.plugin.oidc.op.audit.AuditFields.OUTBOUND_MESSAGE_CLASS" />
                     </key>
-                    <bean class="net.shibboleth.idp.plugin.oidc.op.audit.impl.OutboundMessageClassLookupFunction" />
+                    <bean class="net.shibboleth.oidc.profile.audit.impl.OutboundMessageClassLookupFunction" />
                 </entry>
             </map>
         </property>

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


More information about the commits mailing list