[java-identity-provider COMMIT] /trunk/idp-installer/src/main/java/net/shibboleth/idp/installer/metadata/MetadataGene...
noreply at shibboleth.net
noreply at shibboleth.net
Thu Oct 23 05:42:25 EDT 2014
Author: rdw
Date: Thu Oct 23 05:42:25 2014
New Revision: 6776
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=6776&view=rev
Log:
idp-481 Add a comment at the top of the file
IDP-93 Add commented out MDUI
Modified:
trunk/idp-installer/src/main/java/net/shibboleth/idp/installer/metadata/MetadataGenerator.java
Modified: trunk/idp-installer/src/main/java/net/shibboleth/idp/installer/metadata/MetadataGenerator.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-installer/src/main/java/net/shibboleth/idp/installer/metadata/MetadataGenerator.java?rev=6776&r1=6775&r2=6776&view=diff
==============================================================================
--- trunk/idp-installer/src/main/java/net/shibboleth/idp/installer/metadata/MetadataGenerator.java (original)
+++ trunk/idp-installer/src/main/java/net/shibboleth/idp/installer/metadata/MetadataGenerator.java Thu Oct 23 05:42:25 2014
@@ -36,7 +36,12 @@
import net.shibboleth.utilities.java.support.logic.Constraint;
import net.shibboleth.utilities.java.support.xml.XMLConstants;
+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.core.NameIDType;
import org.opensaml.saml.saml2.metadata.ArtifactResolutionService;
@@ -280,6 +285,7 @@
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(' ');
@@ -287,6 +293,7 @@
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(" entityID=\"");
writer.write(getEntityID());
@@ -303,6 +310,25 @@
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();
}
/**
@@ -430,40 +456,123 @@
}
/**
- * Write out any <Extensions&ht;Elements. Currently this is just the scope TODO: mdui TODO: entityAttributes
+ * Write out any <Extensions>Elements. Currently this is just the scope TODO: mdui TODO: entityAttributes
*
* @throws IOException if badness happens
*/
protected void writeExtensions() throws IOException {
+
+ writer.write(" <");
+ writer.write(Extensions.DEFAULT_ELEMENT_LOCAL_NAME);
+ writer.write('>');
+ writer.newLine();
+ writeScope();
+ writeMDUI();
+ writer.write(" </");
+ writer.write(Extensions.DEFAULT_ELEMENT_LOCAL_NAME);
+ writer.write('>');
+ writer.newLine();
+ }
+
+ /**
+ * Write out the <shibmd:Scope> element.
+ *
+ * @throws IOException if badness happens
+ */
+ protected void writeScope() throws IOException {
if (null == getScope() || getScope().isEmpty()) {
return;
}
- writer.write(" <");
- writer.write(Extensions.DEFAULT_ELEMENT_LOCAL_NAME);
- writer.write('>');
- writer.newLine();
writer.write(" <");
- writer.write(ExtensionsConstants.SHIB_MDEXT10_PREFIX);
- writer.write(':');
- writer.write(Scope.DEFAULT_ELEMENT_LOCAL_NAME);
+ writeNameSpaceQualified(ExtensionsConstants.SHIB_MDEXT10_PREFIX, Scope.DEFAULT_ELEMENT_LOCAL_NAME);
writer.write(" regexp=\"false\">");
writer.write(getScope());
writer.write("</");
- writer.write(ExtensionsConstants.SHIB_MDEXT10_PREFIX);
- writer.write(':');
- writer.write(Scope.DEFAULT_ELEMENT_LOCAL_NAME);
- writer.write('>');
- writer.newLine();
-
- writer.write(" </");
[... 172 lines stripped ...]
More information about the commits
mailing list