[java-identity-provider] 01/04: IDP-1432 Some deprecated classes missed the axe

Rod Widdowson rdw at steadingsoftware.com
Fri Apr 12 08:01:22 EDT 2019


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

rdw pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=44942f5163cc32e605e7f2e790db474ec392d112

commit 44942f5163cc32e605e7f2e790db474ec392d112
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu Apr 11 17:20:30 2019 +0100

    IDP-1432 Some deprecated classes missed the axe
    
    https://issues.shibboleth.net/jira/browse/IDP-1432
---
 .../idp/installer/metadata/MetadataGenerator.java  | 898 ---------------------
 .../metadata/MetadataGeneratorParameters.java      | 245 ------
 .../idp/installer/metadata/package-info.java       |  23 -
 .../net/shibboleth/idp/installer/package-info.java |  23 -
 4 files changed, 1189 deletions(-)

diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/metadata/MetadataGenerator.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/metadata/MetadataGenerator.java
deleted file mode 100644
index 06494fb..0000000
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/metadata/MetadataGenerator.java
+++ /dev/null
@@ -1,898 +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.installer.metadata;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.time.Instant;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.List;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-import org.opensaml.core.xml.LangBearing;
-import org.opensaml.saml.common.xml.SAMLConstants;
-import org.opensaml.saml.ext.saml2mdui.Description;
-import org.opensaml.saml.ext.saml2mdui.DisplayName;
-import org.opensaml.saml.ext.saml2mdui.Logo;
-import org.opensaml.saml.ext.saml2mdui.UIInfo;
-import org.opensaml.saml.saml2.core.Extensions;
-import org.opensaml.saml.saml2.metadata.ArtifactResolutionService;
-import org.opensaml.saml.saml2.metadata.AttributeAuthorityDescriptor;
-import org.opensaml.saml.saml2.metadata.AttributeService;
-import org.opensaml.saml.saml2.metadata.EntityDescriptor;
-import org.opensaml.saml.saml2.metadata.IDPSSODescriptor;
-import org.opensaml.saml.saml2.metadata.KeyDescriptor;
-import org.opensaml.saml.saml2.metadata.SingleLogoutService;
-import org.opensaml.saml.saml2.metadata.SingleSignOnService;
-import org.opensaml.xmlsec.signature.KeyInfo;
-import org.opensaml.xmlsec.signature.X509Certificate;
-import org.opensaml.xmlsec.signature.X509Data;
-import org.opensaml.xmlsec.signature.support.SignatureConstants;
-
-import com.google.common.collect.ImmutableSet;
-
-import net.shibboleth.idp.saml.xmlobject.ExtensionsConstants;
-import net.shibboleth.idp.saml.xmlobject.Scope;
-import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
-import net.shibboleth.utilities.java.support.logic.Constraint;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport.ObjectType;
-import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
-import net.shibboleth.utilities.java.support.xml.XMLConstants;
-
-/**
- * This class gathers information which it then uses to generate IdP Metadata. Loosely based on the SP metadata
- * generator, and the V2 metadata.
- */
-// Checkstyle: HideUtilityClassConstructor OFF
- at Deprecated public class MetadataGenerator {
-
-    /**
-     * The end points we understand.
-     */
-    enum Endpoints {
-        /** IDPSSODescriptor. Artfact */
-        SAML1Artifact, SAML2Artifact,
-        /** IDPSSODescriptor. SLO */
-        RedirectSLO, POSTSLO, POSTSimpleSignSLO, SOAPSLO,
-        /** IDPSSODescriptor. SSO */
-        ShibbolethSSO, POSTSSO, POSTSimpleSignSSO, RedirectSSO,
-
-        /** AttributeAuthorityDescriptor. */
-        SAML1Query, SAML2Query,
-    }
-
-    /**
-     * Those endpoints which require a backchannel.
-     */
-    static final ImmutableSet<Endpoints> BACKCHANNEL_ENDPOINTS = ImmutableSet.copyOf(EnumSet.of(
-            Endpoints.SAML1Artifact, Endpoints.SAML2Artifact, Endpoints.SOAPSLO, Endpoints.SAML1Query,
-            Endpoints.SAML2Query));
-
-    /**
-     * the Artifact endpoints.
-     */
-    static final ImmutableSet<Endpoints> ARTIFACT_ENDPOINTS = ImmutableSet.copyOf(EnumSet.of(Endpoints.SAML1Artifact,
-            Endpoints.SAML2Artifact));
-
-    /**
-     * the SSO endpoints.
-     */
-    static final ImmutableSet<Endpoints> SSO_ENDPOINTS = ImmutableSet.copyOf(EnumSet.of(Endpoints.ShibbolethSSO,
-            Endpoints.POSTSSO, Endpoints.POSTSimpleSignSSO, Endpoints.RedirectSSO));
-
-    /**
-     * the SLO endpoints.
-     */
-    static final ImmutableSet<Endpoints> SLO_ENDPOINTS = ImmutableSet.copyOf(EnumSet.of(Endpoints.RedirectSLO,
-            Endpoints.POSTSLO, Endpoints.POSTSimpleSignSLO, Endpoints.SOAPSLO));
-
-    /**
-     * AttributeAuthority endpoints.
-     */
-    static final ImmutableSet<Endpoints> AA_ENDPOINTS = ImmutableSet.copyOf(EnumSet.of(Endpoints.SAML1Query,
-            Endpoints.SAML2Query));
-
-    /**
-     * Which endpoints to generate.
-     */
-    private EnumSet<Endpoints> endpoints;
-
-    /**
-     * The EntityID.
-     */
-    private String entityID;
-
-    /**
-     * The Dns Name.
-     */
-    private String dnsName;
-
-    /**
-     * The Scope.
-     */
-    private String scope;
-
-    /**
-     * Whether to comment out the SAML2 AA endpoint.
-     */
-    private boolean saml2AttributeQueryCommented = true;
-
-    /**
-     * Whether to comment out the SAML2 SLO endpoints.
-     */
-    private boolean saml2LogoutCommented = true;
-
-    /**
-     * The signing certificates.
-     */
-    private List<List<String>> signingCerts;
-
-    /**
-     * The encryption certificates.
-     */
-    private List<List<String>> encryptionCerts;
-
-    /**
-     * Where to write to.
-     */
-    private final BufferedWriter writer;
-
-    /**
-     * Constructor.
-     * 
-     * @param file file to output to.
-     * @throws FileNotFoundException if the file cannot be found.
-     */
-    public MetadataGenerator(@Nonnull final File file) throws FileNotFoundException {
-        DeprecationSupport.warn(ObjectType.CLASS, this.getClass().getName(), null , ".impl");
-        final File nonnullFile = Constraint.isNotNull(file, "provided file must be nonnull");
-        final FileOutputStream outStream = new FileOutputStream(nonnullFile);
-        writer = new BufferedWriter(new OutputStreamWriter(outStream));
-        endpoints = EnumSet.allOf(Endpoints.class);
-    }
-
-    /**
-     * Get the entityID.
-     * 
-     * @return Returns the entityID.
-     */
-    public String getEntityID() {
-        return entityID;
-    }
-
-    /**
-     * Set the entityID.
-     * 
-     * @param id what to set.
-     */
-    public void setEntityID(final String id) {
-        entityID = id;
-    }
-
-    /**
-     * Get the Scope.
-     * 
-     * @return Returns the Scope.
-     */
-    public String getScope() {
-        return scope;
-    }
-
-    /**
-     * Set the Scope.
-     * 
-     * @param id what to set.
-     */
-    public void setScope(final String id) {
-        scope = id;
-    }
-
-    /**
-     * Get the DNSName.
-     * 
-     * @return Returns the DNSName.
-     */
-    public String getDNSName() {
-        return dnsName;
-    }
-
-    /**
-     * Set the DNSName.
-     * 
-     * @param id what to set.
-     */
-    public void setDNSName(final String id) {
-        dnsName = id;
-    }
-
-    /**
-     * Get the signingCerts.
-     * 
-     * @return Returns the signingCerts.
-     */
-    public List<List<String>> getSigningCerts() {
-        return signingCerts;
-    }
-
-    /**
-     * Set the signingCerts.
-     * 
-     * @param certs what to set.
-     */
-    public void setSigningCerts(final List<List<String>> certs) {
-        signingCerts = certs;
-    }
-
-    /**
-     * Get the encryptionCerts.
-     * 
-     * @return Returns the signingCerts.
-     */
-    public List<List<String>> getEncryptionCerts() {
-        return encryptionCerts;
-    }
-
-    /**
-     * Set the encryptionCerts.
-     * 
-     * @param certs what to set.
-     */
-    public void setEncryptionCerts(final List<List<String>> certs) {
-        encryptionCerts = certs;
-    }
-
-    /**
-     * remove back channel endpoints.
-     */
-    public void removeBackChannel() {
-        endpoints.removeAll(BACKCHANNEL_ENDPOINTS);
-    }
-
-    /**
-     * Get the Endpoints.
-     * 
-     * @return Returns the Endpoints
-     */
-    public EnumSet<Endpoints> getEndpoints() {
-        return endpoints;
-    }
-
-    /**
-     * Set the Endpoints.
-     * 
-     * @param points what to set.
-     */
-    public void setEndpoints(@Nonnull final EnumSet<Endpoints> points) {
-        endpoints = Constraint.isNotNull(points, "supplied endpoints should not be null");
-    }
-
-    /**
-     * Returns whether to comment the SAML2 AA endpoint.
-     * 
-     * @return whether to comment the SAML2 AA endpoint
-     */
-    public boolean isSAML2AttributeQueryCommented() {
-        return saml2AttributeQueryCommented;
-    }
-
-    /**
-     * Sets whether to comment the SAML2 AA endpoint.
-     * 
-     * @param asComment whether to comment or not.
-     */
-    public void setSAML2AttributeQueryCommented(final boolean asComment) {
-        saml2AttributeQueryCommented = asComment;
-    }
-
-    /**
-     * Returns whether to comment the SAML2 Logout endpoints.
-     * 
-     * @return whether to comment the SAML2 Logout endpoints
-     */
-    public boolean isSAML2LogoutCommented() {
-        return saml2LogoutCommented;
-    }
-
-    /**
-     * Sets whether to comment the SAML2 Logout endpoints.
-     * 
-     * @param asComment whether to comment or not
-     */
-    public void setSAML2LogoutCommented(final boolean asComment) {
-        saml2LogoutCommented = asComment;
-    }
-
-    /**
-     * Generate the metadata.
-     * 
-     * @throws IOException if we have a failure.
-     */
-    public void generate() throws IOException {
-        writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
-        writer.newLine();
-        writeComments();
-        writer.write("<");
-        writer.write(EntityDescriptor.DEFAULT_ELEMENT_LOCAL_NAME);
-        writer.write(' ');
-        writeNameSpace(null, SAMLConstants.SAML20MD_NS);
-        writeNameSpace(SignatureConstants.XMLSIG_PREFIX, SignatureConstants.XMLSIG_NS);
-        writeNameSpace(ExtensionsConstants.SHIB_MDEXT10_PREFIX, ExtensionsConstants.SHIB_MDEXT10_NS);
-        writeNameSpace(XMLConstants.XML_PREFIX, XMLConstants.XML_NS);
-        writeNameSpace(SAMLConstants.SAML20MDUI_PREFIX, SAMLConstants.SAML20MDUI_NS);
-
-        writer.write(" validUntil=\"" + DOMTypeSupport.instantToString(Instant.now()) + "\"");
-        
-        writer.write(" entityID=\"");
-        writer.write(getEntityID());
-        writer.write("\">");
-        writer.newLine();
-        writer.newLine();
-        
-        
-
-        writeIDPSSO();
-        writer.newLine();
-        writer.newLine();
-        writeAttributeAuthorityDescriptor();
-        writer.newLine();
-        writer.write("</EntityDescriptor>");
-        writer.newLine();
-        writer.flush();
-        writer.close();
-    }
-
-    /**
-     * Add appropriate comments to metadata header.
-     * 
-     * @throws IOException if badness occurs in the writer
-     */
-    protected void writeComments() throws IOException {
-        writer.write("<!--");
-        writer.newLine();
-        writer.write("     This is example metadata only. Do *NOT* supply it as is without review,");
-        writer.newLine();
-        writer.write("     and do *NOT* provide it in real time to your partners.");
-        writer.newLine();
-        writer.newLine();
-        writer.write("     This metadata is not dynamic - it will not change as your configuration changes.");
-        writer.newLine();
-        writer.write("-->");
-        writer.newLine();
-    }
-
-    /**
-     * Writeout a prefix/namespace pair.
-     * 
-     * @param prefix the prefix, or null
-     * @param name the namespace
-     * @throws IOException if badness happens
-     */
-    protected void writeNameSpace(@Nullable final String prefix, @Nonnull final String name) throws IOException {
-        writer.write(" xmlns");
-        if (null != prefix) {
-            writer.write(':');
-            writer.write(prefix);
-        }
-        writer.write("=\"");
-        writer.write(name);
-        writer.write("\"");
-    }
-
-    /**
-     * Write the <IDPSSODescriptor>.
-     * 
-     * @throws IOException if badness happens
-     */
-    protected void writeIDPSSO() throws IOException {
-
-        writeRoleDescriptor(IDPSSODescriptor.DEFAULT_ELEMENT_LOCAL_NAME,
-                Arrays.asList(SAMLConstants.SAML20P_NS, SAMLConstants.SAML11P_NS, "urn:mace:shibboleth:1.0"));
-        writer.newLine();
-        openExtensions();
-        writeScope();
-        writeMDUI();
-        closeExtensions();
-        writer.newLine();
-        writeKeyDescriptors();
-        for (final Endpoints endpoint : ARTIFACT_ENDPOINTS) {
-            if (getEndpoints().contains(endpoint)) {
-                outputEndpoint(endpoint);
-            }
-        }
-        writer.newLine();
-        if (isSAML2LogoutCommented()) {
-            writer.write("        <!--");
-            writer.newLine();
-        }
-        for (final Endpoints endpoint : SLO_ENDPOINTS) {
-            if (getEndpoints().contains(endpoint)) {
-                outputEndpoint(endpoint);
-            }
-        }
-        if (isSAML2LogoutCommented()) {
-            writer.write("        -->");
-            writer.newLine();
-        }
-        
-        writer.newLine();
-        for (final Endpoints endpoint : SSO_ENDPOINTS) {
-            if (getEndpoints().contains(endpoint)) {
-                outputEndpoint(endpoint);
-            }
-        }
-        writer.newLine();
-        writer.write("    </");
-        writer.write(IDPSSODescriptor.DEFAULT_ELEMENT_LOCAL_NAME);
-        writer.write(">");
-        writer.newLine();
-    }
-
-    /**
-     * Write the <AttributeAuthorityDescriptor>.
-     * 
-     * @throws IOException if badness happens
-     */
-    private void writeAttributeAuthorityDescriptor() throws IOException {
-        final List<String> protocols;
-        if (isSAML2AttributeQueryCommented()) {
-            protocols = Collections.singletonList(SAMLConstants.SAML11P_NS);
-        } else {
-            protocols = Arrays.asList(SAMLConstants.SAML20P_NS, SAMLConstants.SAML11P_NS);
-        }
-        writeRoleDescriptor(AttributeAuthorityDescriptor.DEFAULT_ELEMENT_LOCAL_NAME, protocols);
-        writer.newLine();
-        openExtensions();
-        writeScope();
-        closeExtensions();
-        writer.newLine();
-        writeKeyDescriptors();
-        for (final Endpoints endpoint : AA_ENDPOINTS) {
-            if (getEndpoints().contains(endpoint)) {
-                outputEndpoint(endpoint);
-            }
-        }
-        writer.newLine();
-        writer.write("    </");
-        writer.write(AttributeAuthorityDescriptor.DEFAULT_ELEMENT_LOCAL_NAME);
-        writer.write('>');
-        writer.newLine();
-    }
-
-    /**
-     * Write out an role descriptor.
-     * 
-     * @param name the name
-     * @param protocols the supported protocols
-     * @throws IOException when badness happebns
-     */
-    protected void writeRoleDescriptor(final String name, final List<String> protocols) throws IOException {
-        writer.write("    <");
-        writer.write(name);
-        writer.write(" protocolSupportEnumeration=\"");
-        boolean first = true;
-        for (final String protocol : protocols) {
-            if (!first) {
-                writer.write(" ");
-            }
-            writer.write(protocol);
-            first = false;
-        }
-        writer.write("\">");
-        writer.newLine();
-    }
-
-    /**
-     * Write the open <Extensions> elements.
-     * 
-     * @throws IOException if badness happens
-     */
-    protected void openExtensions() throws IOException {
-
-        writer.write("        <");
-        writer.write(Extensions.DEFAULT_ELEMENT_LOCAL_NAME);
-        writer.write('>');
-        writer.newLine();
-    }
-
-    /**
-     * Write out the close <\Extensions> Element.
-     * 
-     * @throws IOException if badness happens
-     */
-    protected void closeExtensions() throws IOException {
-
-        writer.write("        </");
-        writer.write(Extensions.DEFAULT_ELEMENT_LOCAL_NAME);
-        writer.write('>');
-        writer.newLine();
-    }
-
-    /**
-     * Write out any <Extensions>Elements. Currently this is just the scope TODO: mdui TODO: entityAttributes
-     * 
-     * @deprecated use {@link #openExtensions()} and {@link #closeExtensions()}
-     * @throws IOException if badness happens
-     */
-    @Deprecated protected void writeExtensions() throws IOException {
-
-        openExtensions();
-        writeScope();
-        writeMDUI();
-        closeExtensions();
-    }
-
-    /**
-     * Write out the <shibmd:Scope> element.
-     * 
-     * @throws IOException if badness happens
-     */
-    protected void writeScope() throws IOException {
-        if (null == getScope() || getScope().isEmpty()) {
-            return;
-        }
-
-        writer.write("            <");
-        writeNameSpaceQualified(ExtensionsConstants.SHIB_MDEXT10_PREFIX, Scope.DEFAULT_ELEMENT_LOCAL_NAME);
-        writer.write(" regexp=\"false\">");
-        writer.write(getScope());
-        writer.write("</");
-        writeNameSpaceQualified(ExtensionsConstants.SHIB_MDEXT10_PREFIX, Scope.DEFAULT_ELEMENT_LOCAL_NAME);
-        writer.write('>');
-        writer.newLine();
-    }
-
-    /**
-     * Write out the <mdui:UIINFO> element and children.
-     * 
-     * @throws IOException if badness happens
-     */
-    protected void writeMDUI() throws IOException {
-        writer.write("<!--");
-        writer.newLine();
-        writer.write("    Fill in the details for your IdP here ");
-        writer.newLine();
-        writer.newLine();
-
-        writer.write("            <");
-        writeNameSpaceQualified(SAMLConstants.SAML20MDUI_PREFIX, UIInfo.DEFAULT_ELEMENT_LOCAL_NAME);
-        writer.write('>');
-        writer.newLine();
-
-        // DisplayName
-        writer.write("                <");
-        writeNameSpaceQualified(SAMLConstants.SAML20MDUI_PREFIX, DisplayName.DEFAULT_ELEMENT_LOCAL_NAME);
-        writer.write(' ');
-        writeLangAttribute("en");
-        writer.write('>');
-        writer.write("A Name for the IdP at ");
-        writer.write(getDNSName());
-        writer.write("</");
-        writeNameSpaceQualified(SAMLConstants.SAML20MDUI_PREFIX, DisplayName.DEFAULT_ELEMENT_LOCAL_NAME);
-        writer.write('>');
-        writer.newLine();
-
-        // Description
-        writer.write("                <");
-        writeNameSpaceQualified(SAMLConstants.SAML20MDUI_PREFIX, Description.DEFAULT_ELEMENT_LOCAL_NAME);
-        writer.write(' ');
-        writeLangAttribute("en");
-        writer.write('>');
-        writer.write("Enter a description of your IdP at ");
-        writer.write(getDNSName());
-        writer.write("</");
-        writeNameSpaceQualified(SAMLConstants.SAML20MDUI_PREFIX, Description.DEFAULT_ELEMENT_LOCAL_NAME);
-        writer.write('>');
-        writer.newLine();
-
-        // Logo
-        writer.write("                <");
-        writeNameSpaceQualified(SAMLConstants.SAML20MDUI_PREFIX, Logo.DEFAULT_ELEMENT_LOCAL_NAME);
-        writer.write(" height=\"80\" width=\"80\">");
-        writer.write("https://");
-        writer.write(getDNSName());
-        writer.write("/Path/To/Logo.png");
-        writer.write("</");
-        writeNameSpaceQualified(SAMLConstants.SAML20MDUI_PREFIX, Logo.DEFAULT_ELEMENT_LOCAL_NAME);
-        writer.write('>');
-        writer.newLine();
-
-        writer.write("            </");
-        writeNameSpaceQualified(SAMLConstants.SAML20MDUI_PREFIX, UIInfo.DEFAULT_ELEMENT_LOCAL_NAME);
-        writer.write('>');
-        writer.newLine();
-
-        writer.write("-->");
-        writer.newLine();
-    }
-
-    /**
-     * Write the language attribute.
-     * 
-     * @param language which languages
-     * @throws IOException if badness happens
-     */
-    protected void writeLangAttribute(final String language) throws IOException {
-        writeNameSpaceQualified(XMLConstants.XML_PREFIX, LangBearing.XML_LANG_ATTR_LOCAL_NAME);
-        writer.write("=\"");
-        writer.write(language);
-        writer.write('"');
-    }
-
-    /**
-     * Write out any <KeyDescriptor>Elements.
-     * 
-     * @throws IOException if badness happens
-     */
-    protected void writeKeyDescriptors() throws IOException {
-        if (getSigningCerts().size() == 2) {
-            writer.write("        <!-- First signing certificate is BackChannel, the Second is FrontChannel -->");
-            writer.newLine();
-        }
-        writeKeyDescriptors(getSigningCerts(), "signing");
-        writeKeyDescriptors(getEncryptionCerts(), "encryption");
-        writer.newLine();
-    }
-
-    /**
-     * Write out <KeyDescriptor>Elements. of a specific type
-     * 
-     * @param certs the certificates
-     * @param use the type - signing or encryption
-     * @throws IOException if badness happens
-     */
-    protected void writeKeyDescriptors(@Nullable final List<List<String>> certs, @Nonnull @NotEmpty final String use)
-            throws IOException {
-
-        if (null == certs || certs.isEmpty()) {
-            return;
-        }
-        for (final List<String> cert : certs) {
-            writer.write("        <");
-            writer.write(KeyDescriptor.DEFAULT_ELEMENT_LOCAL_NAME);
-            writer.write(" use=\"");
-            writer.write(use);
-            writer.write("\">");
-            writer.newLine();
-            writer.write("            <");
-            writeNameSpaceQualified(SignatureConstants.XMLSIG_PREFIX, KeyInfo.DEFAULT_ELEMENT_LOCAL_NAME);
-            writer.write('>');
-            writer.newLine();
-            writer.write("                    <");
-            writeNameSpaceQualified(SignatureConstants.XMLSIG_PREFIX, X509Data.DEFAULT_ELEMENT_LOCAL_NAME);
-            writer.write('>');
-            writer.newLine();
-            writer.write("                        <");
-            writeNameSpaceQualified(SignatureConstants.XMLSIG_PREFIX, X509Certificate.DEFAULT_ELEMENT_LOCAL_NAME);
-            writer.write('>');
-            writer.newLine();
-            for (final String certLine : cert) {
-                writer.write(certLine);
-                writer.newLine();
-            }
-            writer.write("                        </");
-            writeNameSpaceQualified(SignatureConstants.XMLSIG_PREFIX, X509Certificate.DEFAULT_ELEMENT_LOCAL_NAME);
-            writer.write('>');
-            writer.newLine();
-            writer.write("                    </");
-            writeNameSpaceQualified(SignatureConstants.XMLSIG_PREFIX, X509Data.DEFAULT_ELEMENT_LOCAL_NAME);
-            writer.write('>');
-            writer.newLine();
-            writer.write("            </");
-            writeNameSpaceQualified(SignatureConstants.XMLSIG_PREFIX, KeyInfo.DEFAULT_ELEMENT_LOCAL_NAME);
-            writer.write('>');
-            writer.newLine();
-            writer.newLine();
-            writer.write("        </");
-            writer.write(KeyDescriptor.DEFAULT_ELEMENT_LOCAL_NAME);
-            writer.write('>');
-            writer.newLine();
-        }
-    }
-
-    /**
-     * Output the SAML for a single endpoint.
-     * 
-     * @param endpoint the type
-     * @throws IOException if badness happens.
-     */
-    // Checkstyle: MethodLength|CyclomaticComplexity OFF
-    protected void outputEndpoint(final Endpoints endpoint) throws IOException {
-        switch (endpoint) {
-            case SAML1Artifact:
-                writer.write("        ");
-                writer.write("<");
-                writer.write(ArtifactResolutionService.DEFAULT_ELEMENT_LOCAL_NAME);
-                writer.write(" Binding=\"");
-                writer.write(SAMLConstants.SAML1_SOAP11_BINDING_URI);
-                writer.write("\" Location=\"https://");
-                writer.write(getDNSName());
-                writer.write(":8443/idp/profile/SAML1/SOAP/ArtifactResolution\"");
-                writer.write(" index=\"1\"/>");
-                writer.newLine();
-                break;
-
-            case SAML2Artifact:
-                writer.write("        ");
-                writer.write("<");
-                writer.write(ArtifactResolutionService.DEFAULT_ELEMENT_LOCAL_NAME);
-                writer.write(" Binding=\"");
-                writer.write(SAMLConstants.SAML2_SOAP11_BINDING_URI);
-                writer.write("\" Location=\"https://");
-                writer.write(getDNSName());
-                writer.write(":8443/idp/profile/SAML2/SOAP/ArtifactResolution\"");
-                writer.write(" index=\"2\"/>");
-                writer.newLine();
-                break;
-
-            case RedirectSLO:
-                writer.write("        ");
-                writer.write("<");
-                writer.write(SingleLogoutService.DEFAULT_ELEMENT_LOCAL_NAME);
-                writer.write(" Binding=\"");
-                writer.write(SAMLConstants.SAML2_REDIRECT_BINDING_URI);
-                writer.write("\" Location=\"https://");
-                writer.write(getDNSName());
-                writer.write("/idp/profile/SAML2/Redirect/SLO\"/>");
-                writer.newLine();
-                break;
-
-            case POSTSLO:
-                writer.write("        ");
-                writer.write("<");
-                writer.write(SingleLogoutService.DEFAULT_ELEMENT_LOCAL_NAME);
-                writer.write(" Binding=\"");
-                writer.write(SAMLConstants.SAML2_POST_BINDING_URI);
-                writer.write("\" Location=\"https://");
-                writer.write(getDNSName());
-                writer.write("/idp/profile/SAML2/POST/SLO\"/>");
-                writer.newLine();
-                break;
-
-            case POSTSimpleSignSLO:
-                writer.write("        ");
-                writer.write("<");
-                writer.write(SingleLogoutService.DEFAULT_ELEMENT_LOCAL_NAME);
-                writer.write(" Binding=\"");
-                writer.write(SAMLConstants.SAML2_POST_SIMPLE_SIGN_BINDING_URI);
-                writer.write("\" Location=\"https://");
-                writer.write(getDNSName());
-                writer.write("/idp/profile/SAML2/POST-SimpleSign/SLO\"/>");
-                writer.newLine();
-                break;
-
-            case SOAPSLO:
-                writer.write("        ");
-                writer.write("<");
-                writer.write(SingleLogoutService.DEFAULT_ELEMENT_LOCAL_NAME);
-                writer.write(" Binding=\"");
-                writer.write(SAMLConstants.SAML2_SOAP11_BINDING_URI);
-                writer.write("\" Location=\"https://");
-                writer.write(getDNSName());
-                writer.write(":8443/idp/profile/SAML2/SOAP/SLO\"/>");
-                writer.newLine();
-                break;
-
-            case ShibbolethSSO:
-                writer.write("        ");
-                writer.write("<");
-                writer.write(SingleSignOnService.DEFAULT_ELEMENT_LOCAL_NAME);
-                writer.write(" Binding=\"urn:mace:shibboleth:1.0:profiles:AuthnRequest\"");
-                writer.write(" Location=\"https://");
-                writer.write(getDNSName());
-                writer.write("/idp/profile/Shibboleth/SSO\"/>");
-                writer.newLine();
-                break;
-
-            case POSTSSO:
-                writer.write("        ");
-                writer.write("<");
-                writer.write(SingleSignOnService.DEFAULT_ELEMENT_LOCAL_NAME);
-                writer.write(" Binding=\"");
-                writer.write(SAMLConstants.SAML2_POST_BINDING_URI);
-                writer.write("\" Location=\"https://");
-                writer.write(getDNSName());
-                writer.write("/idp/profile/SAML2/POST/SSO\"/>");
-                writer.newLine();
-                break;
-
-            case POSTSimpleSignSSO:
-                writer.write("        ");
-                writer.write("<");
-                writer.write(SingleSignOnService.DEFAULT_ELEMENT_LOCAL_NAME);
-                writer.write(" Binding=\"");
-                writer.write(SAMLConstants.SAML2_POST_SIMPLE_SIGN_BINDING_URI);
-                writer.write("\" Location=\"https://");
-                writer.write(getDNSName());
-                writer.write("/idp/profile/SAML2/POST-SimpleSign/SSO\"/>");
-                writer.newLine();
-                break;
-
-            case RedirectSSO:
-                writer.write("        ");
-                writer.write("<");
-                writer.write(SingleSignOnService.DEFAULT_ELEMENT_LOCAL_NAME);
-                writer.write(" Binding=\"");
-                writer.write(SAMLConstants.SAML2_REDIRECT_BINDING_URI);
-                writer.write("\" Location=\"https://");
-                writer.write(getDNSName());
-                writer.write("/idp/profile/SAML2/Redirect/SSO\"/>");
-                writer.newLine();
-                break;
-
-            case SAML1Query:
-                writer.write("        ");
-                writer.write("<");
-                writer.write(AttributeService.DEFAULT_ELEMENT_LOCAL_NAME);
-                writer.write(" Binding=\"");
-                writer.write(SAMLConstants.SAML1_SOAP11_BINDING_URI);
-                writer.write("\" Location=\"https://");
-                writer.write(getDNSName());
-                writer.write(":8443/idp/profile/SAML1/SOAP/AttributeQuery\"/>");
-                writer.newLine();
-                break;
-
-            case SAML2Query:
-                writer.write("        ");
-                if (isSAML2AttributeQueryCommented()) {
-                    writer.write("<!-- ");
-                }
-                writer.write("<");
-                writer.write(AttributeService.DEFAULT_ELEMENT_LOCAL_NAME);
-                writer.write(" Binding=\"");
-                writer.write(SAMLConstants.SAML2_SOAP11_BINDING_URI);
-                writer.write("\" Location=\"https://");
-                writer.write(getDNSName());
-                writer.write(":8443/idp/profile/SAML2/SOAP/AttributeQuery\"/>");
-                if (isSAML2AttributeQueryCommented()) {
-                    writer.write(" -->");
-                    writer.newLine();
-                    writer.write("        ");
-                    writer.write("<!-- If you uncomment the above you should add " + SAMLConstants.SAML20P_NS
-                            + " to the protocolSupportEnumeration above -->");
-                }
-                writer.newLine();
-                break;
-
-            default:
-                break;
-        }
-    }
-
-    /**
-     * Write a namespace:identifier pair.
-     * 
-     * @param nameSpace the namespace
-     * @param what the identifier
-     * @throws IOException if badness happens
-     */
-    protected void writeNameSpaceQualified(@Nonnull final String nameSpace, final String what) throws IOException {
-        writer.write(nameSpace);
-        writer.write(':');
-        writer.write(what);
-    }
-
-}
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/metadata/MetadataGeneratorParameters.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/metadata/MetadataGeneratorParameters.java
deleted file mode 100644
index 999a034..0000000
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/metadata/MetadataGeneratorParameters.java
+++ /dev/null
@@ -1,245 +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.installer.metadata;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.Nullable;
-
-import org.springframework.core.io.Resource;
-
-/**
- * POJO to collect parameters from the metadata configuration (partially via spring).
- */
- at Deprecated public class MetadataGeneratorParameters {
-
-    /**
-     * The file with the certificate the IDP uses to encrypt.
-     */
-    private File encryptionCert;
-
-    /**
-     * The file with the certificate that TLS uses to 'sign'.
-     */
-    private File backChannelCert;
-
-    /**
-     * The file with the certificate the IDP uses to sign.
-     */
-    private File signingCert;
-
-    /** The entityID. */
-    private String entityID;
-
-    /** The DNS name. */
-    private String dnsName;
-
-    /** The scope. */
-    private String scope;
-    
-    /**
-     * Get the string representation of the encryption cert.
-     * 
-     * @return Returns the encryptionCert.
-     * @throws IOException if badness occurrs
-     */
-    @Nullable public List<String> getEncryptionCert() throws IOException {
-        return getCertificateContents(encryptionCert);
-    }
-
-    /**
-     * Set the encryption Certificate file.
-     * 
-     * @param file what to set.
-     */
-    public void setEncryptionCert(final File file) {
-
-        encryptionCert = file;
-    }
-
-    /**
-     * Set the encryption Certificate file.
-     * 
-     * @param resource what to set.
-     */
-    public void setEncryptionCertResource(final Resource resource) {
-
-        try {
-            encryptionCert = resource.getFile();
-        } catch (final IOException e) {
-            encryptionCert = null;
-        }
-    }
-
-    /**
-     * Get the string representation of the signing cert.
-     * 
-     * @return Returns the encryptionCert.
-     * @throws IOException if badness occurrs
-     */
-    @Nullable public List<String> getSigningCert() throws IOException {
-        return getCertificateContents(signingCert);
-    }
-
-    /**
-     * Set the signing Certificate file.
-     * 
-     * @param file what to set.
-     */
-    public void setSigningCert(final File file) {
-
-        signingCert = file;
-    }
-
-    /**
-     * Set the signing Certificate file.
-     * 
-     * @param resource what to set.
-     */
-    public void setSigningCertResource(final Resource resource) {
-
-
-        try {
-            signingCert = resource.getFile();
-        } catch (final IOException e) {
-            signingCert = null;
-        }
-    }
-
-    /**
-     * Get the string representation of the back channel cert.
-     * 
-     * @return Returns the encryptionCert.
-     * @throws IOException if badness occurrs
-     */
-    @Nullable public List<String> getBackchannelCert() throws IOException {
-        return getCertificateContents(backChannelCert);
-    }
-
-    /**
-     * Set the Backchannel Certificate file.
-     * 
-     * @param file what to set.
-     */
-    public void setBackchannelCert(final File file) {
-
-        backChannelCert = file;
-    }
-
-    /**
-     * Open the file and return the contents and a list of lines.
-     * 
-     * @param file the file
-     * @return the contents
-     * @throws IOException if badness occurrs.
-     */
-    private List<String> getCertificateContents(final File file) throws IOException {
-        if (null == file || !file.exists()) {
-            return null;
-        }
-        final FileReader fr = new FileReader(file);
-        final BufferedReader reader = new BufferedReader(fr);
-
-        try {
-            final List<String> output = new ArrayList<>();
-            String s = reader.readLine();
-            while (s != null) {
-                output.add(s);
-                s = reader.readLine();
-            }
-            if ((output.size() > 0) && output.get(0).startsWith("----")) {
-                output.remove(0);
-            }
-            final int last = output.size() - 1;
-            if (last <= 0) {
-                return null;
-            }
-            if (output.get(last).startsWith("----")) {
-                output.remove(last);
-            }
-            return output;
-
-        } finally {
-            try {
-                reader.close();
-                fr.close();
-            } catch (final IOException e1) {
-            }
-        }
-    }
-
-    /**
-     * Returns the entityID.
-     * 
-     * @return the entityID.
-     */
-    public String getEntityID() {
-        return entityID;
-    }
-
-    /**
-     * Sets the entityID.
-     * 
-     * @param id what to set.
-     */
-    public void setEntityID(final String id) {
-        entityID = id;
-    }
-
-    /**
-     * Returns the dnsName.
-     * 
-     * @return the dnsname.
-     */
-    public String getDnsName() {
-        return dnsName;
-    }
-
-    /**
-     * Sets the dns name.
-     * 
-     * @param name what to set.
-     */
-    public void setDnsName(final String name) {
-        dnsName = name;
-    }
-
-    /**
-     * Returns the scope.
-     * 
-     * @return the scope.
-     */
-    public String getScope() {
-        return scope;
-    }
-
-    /**
-     * Sets the scope.
-     * 
-     * @param value what to set.
-     */
-    public void setScope(final String value) {
-        scope = value;
-    }
-
-}
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/metadata/package-info.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/metadata/package-info.java
deleted file mode 100644
index adbed4e..0000000
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/metadata/package-info.java
+++ /dev/null
@@ -1,23 +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.
- */
-
-/**
- * OLD, DEPRECATED Package to contain classes to do with the one off metadata generation.
- * Use the .impl versions
- */
-
-package net.shibboleth.idp.installer.metadata;
\ No newline at end of file
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/package-info.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/package-info.java
deleted file mode 100644
index 5173817..0000000
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/package-info.java
+++ /dev/null
@@ -1,23 +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.
- */
-
-/**
- * OLD Deprecated. Classes of use during installation.
- * Use the .impl versions
- */
-package net.shibboleth.idp.installer;
-

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


More information about the commits mailing list