[java-identity-provider] 01/02: IDP-1644 Revert decomplexifying the API

Rod Widdowson rdw at steadingsoftware.com
Tue Sep 1 15:31:53 UTC 2020


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

rdw 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=8ca93998c64b10383470abff1349ca3421e7a9e4

commit 8ca93998c64b10383470abff1349ca3421e7a9e4
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Tue Sep 1 13:55:31 2020 +0100

    IDP-1644 Revert decomplexifying the API
    
    We have plugins shipped (albeit in Alpha). so we cannot change
    fundamental API without thought.
    
    We probably should make this change but it will require a new
    release.
    
    This reverts commit 18b93279e5528a9577cb05cd04d71303f60d7bcf.
---
 .../idp/plugin/AbstractPluginDescription.java      | 14 +++++++++++--
 .../shibboleth/idp/plugin/PluginDescription.java   | 23 +++++++++++++++++++++-
 .../idp/installer/plugin/impl/PluginInstaller.java |  9 +++++++++
 3 files changed, 43 insertions(+), 3 deletions(-)

diff --git a/idp-admin-api/src/main/java/net/shibboleth/idp/plugin/AbstractPluginDescription.java b/idp-admin-api/src/main/java/net/shibboleth/idp/plugin/AbstractPluginDescription.java
index 941cc154e..9adf9ef57 100644
--- a/idp-admin-api/src/main/java/net/shibboleth/idp/plugin/AbstractPluginDescription.java
+++ b/idp-admin-api/src/main/java/net/shibboleth/idp/plugin/AbstractPluginDescription.java
@@ -32,7 +32,12 @@ import net.shibboleth.utilities.java.support.collection.Pair;
  * A base class {@link PluginDescription} which defaults many common settings.
  */
 public abstract class AbstractPluginDescription implements PluginDescription {
-      
+    
+    /** {@inheritDoc} */
+    @Nonnull public List<String> getAdditionalPropertyFiles() {
+        return Collections.emptyList();
+    }
+    
     /** {@inheritDoc} */
     @Nonnull public List<Path> getFilePathsToCopy() {
         return Collections.emptyList();
@@ -42,7 +47,12 @@ public abstract class AbstractPluginDescription implements PluginDescription {
     @Nonnull public List<Pair<URL, Path>> getExternalFilePathsToCopy() throws IOException {
         return Collections.emptyList();
     }
-   
+
+    /** {@inheritDoc} */
+    @Nonnull public List<Pair<Path, List<String>>> getPropertyMerges() {
+        return Collections.emptyList();
+    }
+    
     /** {@inheritDoc} */
     @Nonnegative public int getPatchVersion() {
         return 0;
diff --git a/idp-admin-api/src/main/java/net/shibboleth/idp/plugin/PluginDescription.java b/idp-admin-api/src/main/java/net/shibboleth/idp/plugin/PluginDescription.java
index 7944bc8ea..efdeca8f8 100644
--- a/idp-admin-api/src/main/java/net/shibboleth/idp/plugin/PluginDescription.java
+++ b/idp-admin-api/src/main/java/net/shibboleth/idp/plugin/PluginDescription.java
@@ -46,6 +46,12 @@ public interface PluginDescription {
      */
     @Nonnull @NotEmpty public String getPluginId();
 
+    /** Return the list of file names to be appended to
+     * <code>idp.additional.properties</code>.
+     * @return The list of names, potentially empty.
+     */
+    @Nonnull public List<String> getAdditionalPropertyFiles();
+    
     /** Return the list of (idp.home) relative paths (of files, <em>not directories </em>) 
      * to copy from the distribution into the IdP installation.
      *
@@ -81,7 +87,22 @@ public interface PluginDescription {
      * @throws IOException if the resource construction failed.
      */
     @Nonnull @NonnullElements public List<URL> getUpdateURLs() throws IOException;
-       
+    
+    /** Return this properties that require list merging.  
+     * 
+     * <em>Not currently supported</em>
+     * 
+     * <p>Given
+     * an property called (say) <code>idp.service.foo</code> in file <code>services.property</code>
+     * and an init setting of <code>idp.service.foo.bar</code>, the output would be:</p>
+     * <pre> idp.service.foo = BEAN.idp.service.foo.plugin-id.net.shibboleth.foo
+     * idp.service.foo.OLD.plugin-id = shibboleth.AttributeFilterResources</pre>
+     *
+     * @return A list of pairs, the first element of the pair is the (relative) path of the property file
+     * and the second is a list of property names to edit within that file.
+     */
+    @Nonnull public List<Pair<Path, List<String>>> getPropertyMerges();
+    
     /** Return the major version, (as defined by the 
      * <a href="https://wiki.shibboleth.net/confluence/display/DEV/Java+Product+Version+Policy">
      * Java Product Version Policy</a>.
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstaller.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstaller.java
index 8301ca7a4..9ca2e14ca 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstaller.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstaller.java
@@ -187,6 +187,15 @@ public final class PluginInstaller extends AbstractInitializableComponent implem
         LOG.info("Installing Plugin {} version {}.{}.{}", pluginId,
                 description.getMajorVersion(),description.getMinorVersion(), description.getPatchVersion());
 
+        if (!description.getAdditionalPropertyFiles().isEmpty()) {
+            LOG.error("Additional property files not supported");
+            throw new BuildException("Uninstallable plugin");
+        }
+        if (!description.getPropertyMerges().isEmpty()) {
+            LOG.error("Prroperty merges not supported");
+            throw new BuildException("Uninstallable plugin");
+        }
+
         final Path myWebApp = idpHome.resolve("dist").resolve("edit-webapp-" + pluginId);
         deleteTree(myWebApp);
         installWebapp(myWebApp);

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


More information about the commits mailing list