[java-identity-provider] branch main updated: Switch to shared auto-wiring wrapper for Credentials.

Scott Cantor cantor.2 at osu.edu
Mon Feb 6 16:34:37 UTC 2023


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

scantor 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=4de89855785e5a0a329753838cbf730ec299c6c9

The following commit(s) were added to refs/heads/main by this push:
     new 4de898557 Switch to shared auto-wiring wrapper for Credentials.
4de898557 is described below

commit 4de89855785e5a0a329753838cbf730ec299c6c9
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Feb 6 11:34:33 2023 -0500

    Switch to shared auto-wiring wrapper for Credentials.
---
 .../shibboleth/idp/conf/relying-party-system.xml   |  4 +-
 .../RelyingPartyResolverCredentialHolder.java      | 65 ----------------------
 idp-profile-impl/pom.xml                           |  4 ++
 .../DefaultRelyingPartyConfigurationResolver.java  |  6 +-
 4 files changed, 9 insertions(+), 70 deletions(-)

diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/relying-party-system.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/relying-party-system.xml
index dfcd16e8e..07e46af7a 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/relying-party-system.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/relying-party-system.xml
@@ -28,11 +28,11 @@
     Auto-wiring exposers for credentials to get them loaded into the bean above.
     The qualifiers control which auto-wiring point is used.
     -->
-    <bean class="net.shibboleth.idp.relyingparty.RelyingPartyResolverCredentialHolder"
+    <bean class="net.shibboleth.spring.security.CredentialHolder"
             c:_0="#{getObject('shibboleth.SigningCredentials')}">
         <qualifier value="signing"/>
     </bean>
-    <bean class="net.shibboleth.idp.relyingparty.RelyingPartyResolverCredentialHolder"
+    <bean class="net.shibboleth.spring.security.CredentialHolder"
             c:_0="#{getObject('shibboleth.EncryptionCredentials')}">
         <qualifier value="encryption"/>
     </bean>
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/relyingparty/RelyingPartyResolverCredentialHolder.java b/idp-profile-api/src/main/java/net/shibboleth/idp/relyingparty/RelyingPartyResolverCredentialHolder.java
deleted file mode 100644
index cfe6297aa..000000000
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/relyingparty/RelyingPartyResolverCredentialHolder.java
+++ /dev/null
@@ -1,65 +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.relyingparty;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-import org.opensaml.security.credential.Credential;
-
-import net.shibboleth.shared.annotation.constraint.NonnullElements;
-
-/**
- * This is a utility class used as an auto-wiring source for collections of
- * signing and encryption {@link Credential} objects so that other layers of the
- * system can gain access to the complete set of them.
- * 
- * @since 4.2.0
- */
-public class RelyingPartyResolverCredentialHolder {
-
-    /** Credentials to expose. */
-    @Nonnull @NonnullElements private final List<Credential> credentials;
-    
-    /**
-     * Constructor.
-     *
-     * @param creds credentials to expose to other components
-     */
-    public RelyingPartyResolverCredentialHolder(@Nullable @NonnullElements final Collection<Credential> creds) {
-        if (creds != null) {
-            credentials = List.copyOf(creds);
-        } else {
-            credentials = Collections.emptyList();
-        }
-    }
-    
-    /**
-     * Get the credentials to expose to other components.
-     * 
-     * @return credentials to expose
-     */
-    @Nonnull @NonnullElements public Collection<Credential> getCredentials() {
-        return credentials;
-    }
-    
-}
\ No newline at end of file
diff --git a/idp-profile-impl/pom.xml b/idp-profile-impl/pom.xml
index f2e55b043..733d0e31e 100644
--- a/idp-profile-impl/pom.xml
+++ b/idp-profile-impl/pom.xml
@@ -45,6 +45,10 @@
             <groupId>net.shibboleth</groupId>
             <artifactId>shib-attribute-filter-api</artifactId>
         </dependency>
+        <dependency>
+            <groupId>net.shibboleth</groupId>
+            <artifactId>shib-metadata-spring</artifactId>
+        </dependency>
 
         <dependency>
             <groupId>${opensaml.groupId}</groupId>
diff --git a/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/DefaultRelyingPartyConfigurationResolver.java b/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/DefaultRelyingPartyConfigurationResolver.java
index 4c3353beb..9b9020076 100644
--- a/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/DefaultRelyingPartyConfigurationResolver.java
+++ b/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/DefaultRelyingPartyConfigurationResolver.java
@@ -37,7 +37,6 @@ import org.springframework.beans.factory.annotation.Qualifier;
 import net.shibboleth.idp.profile.logic.VerifiedProfilePredicate;
 import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
 import net.shibboleth.idp.relyingparty.RelyingPartyConfigurationResolver;
-import net.shibboleth.idp.relyingparty.RelyingPartyResolverCredentialHolder;
 import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
 import net.shibboleth.shared.annotation.constraint.NonnullElements;
 import net.shibboleth.shared.annotation.constraint.NotEmpty;
@@ -48,6 +47,7 @@ import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.logic.Constraint;
 import net.shibboleth.shared.primitive.LoggerFactory;
 import net.shibboleth.shared.resolver.ResolverException;
+import net.shibboleth.spring.security.CredentialHolder;
 
 /**
  * Retrieves a per-relying party configuration for a given profile request based on the request context.
@@ -291,7 +291,7 @@ public class DefaultRelyingPartyConfigurationResolver extends AbstractIdentifiab
     @Autowired
     @Qualifier("signing")
     public void setSigningCredentials(
-            @Nullable @NonnullElements final List<RelyingPartyResolverCredentialHolder> credentials) {
+            @Nullable @NonnullElements final List<CredentialHolder> credentials) {
         checkSetterPreconditions();
         
         if (credentials != null) {
@@ -320,7 +320,7 @@ public class DefaultRelyingPartyConfigurationResolver extends AbstractIdentifiab
     @Autowired
     @Qualifier("encryption")
     public void setEncryptionCredentials(
-            @Nullable @NonnullElements final List<RelyingPartyResolverCredentialHolder> credentials) {
+            @Nullable @NonnullElements final List<CredentialHolder> credentials) {
         checkSetterPreconditions();
         
         if (credentials != null) {

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


More information about the commits mailing list