[java-sp-server] branch main updated: More cleanup to get POC running.

Scott Cantor cantor.2 at osu.edu
Tue Oct 18 19:57:43 UTC 2022


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

scantor pushed a commit to branch main
in repository java-sp-server.

View the commit online:
http://git.shibboleth.net/view/?p=java-sp-server.git;a=commit;h=d87f5fbe5c65b7d8d9d4a33aeb45b1c7c50de92c

The following commit(s) were added to refs/heads/main by this push:
     new d87f5fb  More cleanup to get POC running.
d87f5fb is described below

commit d87f5fbe5c65b7d8d9d4a33aeb45b1c7c50de92c
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Oct 18 15:57:41 2022 -0400

    More cleanup to get POC running.
---
 sp-conf-impl/pom.xml                               | 10 +++++++
 .../net/shibboleth/sp/conf/global-system.xml       |  4 +--
 .../net/shibboleth/sp/conf/integration.xml         |  4 +--
 .../net/shibboleth/sp/conf/services-system.xml     |  1 -
 .../net/shibboleth/sp/impl/BasicApplication.java   | 33 ++++++++++++++++++++++
 .../net/shibboleth/sp/impl/OpenSAMLConfigBean.java | 18 ++++++------
 .../sp/remoting/endpoint/impl/XMLParser.java       |  4 +--
 .../sp/remoting/endpoint/impl/package-info.java    |  2 +-
 .../sp/spring/impl}/ByteArrayToDDFConverter.java   |  6 ++--
 .../sp/spring/impl}/DDFToByteArrayConverter.java   |  6 ++--
 10 files changed, 65 insertions(+), 23 deletions(-)

diff --git a/sp-conf-impl/pom.xml b/sp-conf-impl/pom.xml
index bcf99b4..7f68e8b 100644
--- a/sp-conf-impl/pom.xml
+++ b/sp-conf-impl/pom.xml
@@ -34,11 +34,21 @@
             <version>${project.version}</version>
             <scope>runtime</scope>
         </dependency>
+        <dependency>
+            <groupId>net.shibboleth</groupId>
+            <artifactId>shib-networking-spring</artifactId>
+            <scope>runtime</scope>
+        </dependency>
         <dependency>
             <groupId>net.shibboleth</groupId>
             <artifactId>shib-spring</artifactId>
             <scope>runtime</scope>
         </dependency>
+        <dependency>
+            <groupId>net.shibboleth</groupId>
+            <artifactId>shib-velocity-spring</artifactId>
+            <scope>runtime</scope>
+        </dependency>
         <dependency>
             <groupId>org.opensaml</groupId>
             <artifactId>opensaml-core-api</artifactId>
diff --git a/sp-conf-impl/src/main/resources/net/shibboleth/sp/conf/global-system.xml b/sp-conf-impl/src/main/resources/net/shibboleth/sp/conf/global-system.xml
index c3f7855..3969049 100644
--- a/sp-conf-impl/src/main/resources/net/shibboleth/sp/conf/global-system.xml
+++ b/sp-conf-impl/src/main/resources/net/shibboleth/sp/conf/global-system.xml
@@ -74,7 +74,7 @@
         <entry key="runtime.strict_mode.enable" value="%{sp.velocity.runtime.strictmode:false}" />
     </util:map>
 
-    <bean id="shibboleth.VelocityEngine" class="net.shibboleth.ext.spring.velocity.VelocityEngineFactoryBean"
+    <bean id="shibboleth.VelocityEngine" class="net.shibboleth.shared.spring.velocity.VelocityEngineFactoryBean"
         depends-on="shibboleth.LoggingService"
         p:velocityPropertiesMap="#{getObject('shibboleth.VelocityEngineProperties') ?: getObject('shibboleth.DefaultVelocityEngineProperties')}" />
 
@@ -128,7 +128,7 @@
         class="%{sp.storage.StorageService:org.opensaml.storage.impl.MemoryStorageService}"
         p:cleanupInterval="%{sp.storage.cleanupInterval:PT10M}" />
 
-    <bean id="shibboleth.ReplayCache" class="org.opensaml.storage.ReplayCache"
+    <bean id="shibboleth.ReplayCache" class="org.opensaml.storage.impl.StorageServiceReplayCache"
         p:storage-ref="#{'%{sp.replayCache.StorageService:shibboleth.StorageService}'.trim()}"
         p:strict="%{sp.replayCache.strict:true}" />
 
diff --git a/sp-conf-impl/src/main/resources/net/shibboleth/sp/conf/integration.xml b/sp-conf-impl/src/main/resources/net/shibboleth/sp/conf/integration.xml
index 7b4a656..7003c26 100644
--- a/sp-conf-impl/src/main/resources/net/shibboleth/sp/conf/integration.xml
+++ b/sp-conf-impl/src/main/resources/net/shibboleth/sp/conf/integration.xml
@@ -18,8 +18,8 @@
     <bean id="integrationConversionService" class="org.springframework.context.support.ConversionServiceFactoryBean">
         <property name="converters">
             <set>
-                <bean class="net.shibboleth.shared.spring.config.ByteArrayToDDFConverter" />
-                <bean class="net.shibboleth.shared.spring.config.DDFToByteArrayConverter" />
+                <bean class="net.shibboleth.sp.spring.impl.ByteArrayToDDFConverter" />
+                <bean class="net.shibboleth.sp.spring.impl.DDFToByteArrayConverter" />
             </set>
         </property>
     </bean>
diff --git a/sp-conf-impl/src/main/resources/net/shibboleth/sp/conf/services-system.xml b/sp-conf-impl/src/main/resources/net/shibboleth/sp/conf/services-system.xml
index d248c05..8569743 100644
--- a/sp-conf-impl/src/main/resources/net/shibboleth/sp/conf/services-system.xml
+++ b/sp-conf-impl/src/main/resources/net/shibboleth/sp/conf/services-system.xml
@@ -21,7 +21,6 @@
         p:beanPostProcessors-ref="shibboleth.IdentifiableBeanPostProcessor"
         p:beanFactoryPostProcessors-ref="shibboleth.PropertySourcesPlaceholderConfigurer" />
 
-
     <!--
     These are beans that define reloadable services. The actual Spring resources that configure the
     services are generally defined in the services.xml file edited by deployers.
diff --git a/sp-server-impl/src/main/java/net/shibboleth/sp/impl/BasicApplication.java b/sp-server-impl/src/main/java/net/shibboleth/sp/impl/BasicApplication.java
index 63ba3c5..ddd3874 100644
--- a/sp-server-impl/src/main/java/net/shibboleth/sp/impl/BasicApplication.java
+++ b/sp-server-impl/src/main/java/net/shibboleth/sp/impl/BasicApplication.java
@@ -107,17 +107,50 @@ public class BasicApplication extends AbstractEndpoint implements Application {
     @Nonnull public ReloadableService<AttributeTranscoderRegistry> getAttributeTranscoderRegistry() {
         return transcodingRegistry;
     }
+    
+    /**
+     * Set the {@link AttributeTranscoderRegistry} to use.
+     * 
+     * @param service registry service
+     */
+    public void setAttributeTranscoderRegistry(@Nonnull final ReloadableService<AttributeTranscoderRegistry> service) {
+        checkSetterPreconditions();
+        
+        transcodingRegistry = Constraint.isNotNull(service, "AttributeTranscoderRegistry service cannot be null");
+    }
 
     /** {@inheritDoc} */
     @Nonnull public ReloadableService<AttributeResolver> getAttributeResolver() {
         return attributeResolver;
     }
 
+    /**
+     * Set the {@link AttributeResolver} to use.
+     * 
+     * @param service resolver service
+     */
+    public void setAttributeResolver(@Nonnull final ReloadableService<AttributeResolver> service) {
+        checkSetterPreconditions();
+        
+        attributeResolver = Constraint.isNotNull(service, "AttributeTranscoderRegistry service cannot be null");
+    }
+
     /** {@inheritDoc} */
     @Nonnull public ReloadableService<AttributeFilter> getAttributeFilter() {
         return attributeFilter;
     }
 
+    /**
+     * Set the {@link AttributeFilter} to use.
+     * 
+     * @param service filter service
+     */
+    public void setAttributeFilter(@Nonnull final ReloadableService<AttributeFilter> service) {
+        checkSetterPreconditions();
+        
+        attributeFilter = Constraint.isNotNull(service, "AttributeFilter service cannot be null");
+    }
+
     /** {@inheritDoc} */
     @Override
     @Nonnull public DDF doReceive(@Nonnull final DDF input) throws RemoteProcessingException {
diff --git a/sp-server-impl/src/main/java/net/shibboleth/sp/impl/OpenSAMLConfigBean.java b/sp-server-impl/src/main/java/net/shibboleth/sp/impl/OpenSAMLConfigBean.java
index 57a9d16..c553d97 100644
--- a/sp-server-impl/src/main/java/net/shibboleth/sp/impl/OpenSAMLConfigBean.java
+++ b/sp-server-impl/src/main/java/net/shibboleth/sp/impl/OpenSAMLConfigBean.java
@@ -1,9 +1,12 @@
 /*
- * Licensed 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
+ * 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
  *
- *  https://www.apache.org/licenses/LICENSE-2.0
+ *    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,
@@ -30,7 +33,6 @@ import com.codahale.metrics.MetricRegistry;
 
 import net.shibboleth.shared.component.AbstractInitializableComponent;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.ComponentSupport;
 import net.shibboleth.shared.xml.ParserPool;
 
 
@@ -67,8 +69,7 @@ public class OpenSAMLConfigBean extends AbstractInitializableComponent {
      * @param newParserPool the parser pool to set
      */
     public void setParserPool(@Nullable final ParserPool newParserPool) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        
+        checkSetterPreconditions();
         parserPool = newParserPool;
     }
     
@@ -87,8 +88,7 @@ public class OpenSAMLConfigBean extends AbstractInitializableComponent {
      * @param newParserPool the decryption parser pool to set
      */
     public void setDecryptionParserPool(@Nullable final ParserPool newParserPool) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        
+        checkSetterPreconditions();
         decryptionParserPool = newParserPool;
     }
     
diff --git a/sp-server-impl/src/main/java/net/shibboleth/sp/remoting/endpoint/impl/XMLParser.java b/sp-server-impl/src/main/java/net/shibboleth/sp/remoting/endpoint/impl/XMLParser.java
index bfcb101..ca86e6f 100644
--- a/sp-server-impl/src/main/java/net/shibboleth/sp/remoting/endpoint/impl/XMLParser.java
+++ b/sp-server-impl/src/main/java/net/shibboleth/sp/remoting/endpoint/impl/XMLParser.java
@@ -30,7 +30,6 @@ import org.w3c.dom.Document;
 import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
 import net.shibboleth.shared.annotation.constraint.NotEmpty;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.ComponentSupport;
 import net.shibboleth.shared.logic.Constraint;
 import net.shibboleth.shared.xml.ParserPool;
 import net.shibboleth.shared.xml.XMLParserException;
@@ -67,7 +66,7 @@ public class XMLParser extends AbstractEndpoint {
      * @param parser parser pool
      */
     public void setParserPool(@Nonnull final ParserPool parser) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        checkSetterPreconditions();
         
         parserPool = Constraint.isNotNull(parser, "ParserPool cannot be null");
     }
@@ -85,6 +84,7 @@ public class XMLParser extends AbstractEndpoint {
     /** {@inheritDoc} */
     @Override
     @Nonnull public DDF doReceive(@Nonnull final DDF input) throws RemoteProcessingException {
+        checkComponentActive();
         
         if (!input.isunsafestring()) {
             throw new IllegalArgumentException("Input was not an unsafe string");
diff --git a/sp-server-impl/src/main/java/net/shibboleth/sp/remoting/endpoint/impl/package-info.java b/sp-server-impl/src/main/java/net/shibboleth/sp/remoting/endpoint/impl/package-info.java
index d92a1ce..47e5676 100644
--- a/sp-server-impl/src/main/java/net/shibboleth/sp/remoting/endpoint/impl/package-info.java
+++ b/sp-server-impl/src/main/java/net/shibboleth/sp/remoting/endpoint/impl/package-info.java
@@ -13,7 +13,7 @@
  */
 
 /**
- * {@link Endpoint} implementations.
+ * {@link net.shibboleth.sp.remoting.Endpoint} implementations.
  */
 
 package net.shibboleth.sp.remoting.endpoint.impl;
\ No newline at end of file
diff --git a/sp-server-api/src/main/java/net/shibboleth/sp/ddf/ByteArrayToDDFConverter.java b/sp-server-impl/src/main/java/net/shibboleth/sp/spring/impl/ByteArrayToDDFConverter.java
similarity index 94%
rename from sp-server-api/src/main/java/net/shibboleth/sp/ddf/ByteArrayToDDFConverter.java
rename to sp-server-impl/src/main/java/net/shibboleth/sp/spring/impl/ByteArrayToDDFConverter.java
index 951a6b6..f425848 100644
--- a/sp-server-api/src/main/java/net/shibboleth/sp/ddf/ByteArrayToDDFConverter.java
+++ b/sp-server-impl/src/main/java/net/shibboleth/sp/spring/impl/ByteArrayToDDFConverter.java
@@ -15,17 +15,17 @@
  * limitations under the License.
  */
 
-package net.shibboleth.sp.ddf;
+package net.shibboleth.sp.spring.impl;
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 
 import org.springframework.core.convert.converter.Converter;
 
+import net.shibboleth.sp.ddf.DDF;
+
 /**
  * Spring converter from byte array to {@link DDF} object.
- * 
- * @since 7.0.0
  */
 public class ByteArrayToDDFConverter implements Converter<byte[], DDF> {
 
diff --git a/sp-server-api/src/main/java/net/shibboleth/sp/ddf/DDFToByteArrayConverter.java b/sp-server-impl/src/main/java/net/shibboleth/sp/spring/impl/DDFToByteArrayConverter.java
similarity index 95%
rename from sp-server-api/src/main/java/net/shibboleth/sp/ddf/DDFToByteArrayConverter.java
rename to sp-server-impl/src/main/java/net/shibboleth/sp/spring/impl/DDFToByteArrayConverter.java
index 4653e71..a00bedc 100644
--- a/sp-server-api/src/main/java/net/shibboleth/sp/ddf/DDFToByteArrayConverter.java
+++ b/sp-server-impl/src/main/java/net/shibboleth/sp/spring/impl/DDFToByteArrayConverter.java
@@ -15,17 +15,17 @@
  * limitations under the License.
  */
 
-package net.shibboleth.sp.ddf;
+package net.shibboleth.sp.spring.impl;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
 import org.springframework.core.convert.converter.Converter;
 
+import net.shibboleth.sp.ddf.DDF;
+
 /**
  * Spring converter from {@link DDF} to byte array.
- * 
- * @since 7.0.0
  */
 public class DDFToByteArrayConverter implements Converter<DDF, byte[]> {
 

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


More information about the commits mailing list