[java-opensaml] branch main updated: OSJ-404 - MD generator creates invalid metadata

Scott Cantor cantor.2 at osu.edu
Wed May 15 15:54:40 UTC 2024


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

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

View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=52a7fb5712f044dd21cfa93567f0a3893c957953

The following commit(s) were added to refs/heads/main by this push:
     new 52a7fb571 OSJ-404 - MD generator creates invalid metadata
52a7fb571 is described below

commit 52a7fb5712f044dd21cfa93567f0a3893c957953
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed May 15 11:54:15 2024 -0400

    OSJ-404 - MD generator creates invalid metadata
    
    https://shibboleth.atlassian.net/browse/OSJ-404
    
    Fixed some other nits around emitting empty attributes as well.
---
 .../main/resources/templates/metadata/AttributeAuthorityDescriptor.vm | 2 +-
 .../src/main/resources/templates/metadata/EntityDescriptor.vm         | 2 +-
 .../src/main/resources/templates/metadata/Extensions.vm               | 4 ++--
 .../src/main/resources/templates/metadata/IDPSSODescriptor.vm         | 2 +-
 .../src/main/resources/templates/metadata/SPSSODescriptor.vm          | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/opensaml-saml-impl/src/main/resources/templates/metadata/AttributeAuthorityDescriptor.vm b/opensaml-saml-impl/src/main/resources/templates/metadata/AttributeAuthorityDescriptor.vm
index 0fd789e2a..79f427af4 100644
--- a/opensaml-saml-impl/src/main/resources/templates/metadata/AttributeAuthorityDescriptor.vm
+++ b/opensaml-saml-impl/src/main/resources/templates/metadata/AttributeAuthorityDescriptor.vm
@@ -1,5 +1,5 @@
 #set ($role = $params.AttributeAuthorityDescriptor)
-    <md:AttributeAuthorityDescriptor protocolSupportEnumeration="#foreach($p in $role.supportedProtocols)$p#if(!$foreach.last) #end#end">
+    <md:AttributeAuthorityDescriptor#if (!$role.supportedProtocols.empty) protocolSupportEnumeration="#foreach($p in $role.supportedProtocols)$p#if(!$foreach.last) #end#end"#end>
 #parse("$params.templatePath/Extensions.vm")
 #parse("$params.templatePath/KeyDescriptors.vm")
 #foreach ($endpoint in $role.attributeServices)
diff --git a/opensaml-saml-impl/src/main/resources/templates/metadata/EntityDescriptor.vm b/opensaml-saml-impl/src/main/resources/templates/metadata/EntityDescriptor.vm
index cc42f8743..be06f3383 100644
--- a/opensaml-saml-impl/src/main/resources/templates/metadata/EntityDescriptor.vm
+++ b/opensaml-saml-impl/src/main/resources/templates/metadata/EntityDescriptor.vm
@@ -1,4 +1,4 @@
-<md:EntityDescriptor entityID="$xmlattr.escape($params.entityID)"#if (!$params.omitNamespaceDeclarations)#foreach ($ns in $namespaces.entrySet()) xmlns:$ns.key="$ns.value"#end#end>
+<md:EntityDescriptor#if ($params.entityID)entityID="$xmlattr.escape($params.entityID)"#end#if (!$params.omitNamespaceDeclarations)#foreach ($ns in $namespaces.entrySet()) xmlns:$ns.key="$ns.value"#end#end>
 #if (!$params.tagAssignments.isEmpty())
 
     <md:Extensions>
diff --git a/opensaml-saml-impl/src/main/resources/templates/metadata/Extensions.vm b/opensaml-saml-impl/src/main/resources/templates/metadata/Extensions.vm
index ea9142e58..fbebea501 100644
--- a/opensaml-saml-impl/src/main/resources/templates/metadata/Extensions.vm
+++ b/opensaml-saml-impl/src/main/resources/templates/metadata/Extensions.vm
@@ -6,10 +6,10 @@
 #if ($params.displayName || $params.description || $params.logo)
             <mdui:UIInfo>
 #if ($params.displayName)
-                <mdui:DisplayName>$xmltext.escape($params.displayName)</mdui:DisplayName>
+                <mdui:DisplayName#if ($params.lang) xml:lang="$params.lang"#else xml:lang="en"#end>$xmltext.escape($params.displayName)</mdui:DisplayName>
 #end
 #if ($params.description)
-                <mdui:Description>$xmltext.escape($params.description)</mdui:Description>
+                <mdui:Description#if ($params.lang) xml:lang="$params.lang"#else xml:lang="en"#end>$xmltext.escape($params.description)</mdui:Description>
 #end
 #if ($params.logo)
                 <mdui:Logo#if ($params.lang) xml:lang="$params.lang"#end#if ($params.logo.width) width="$params.logo.width"#end#if ($params.logo.height) height="$params.logo.height"#end>$xmltext.escape($params.logo.URI)</mdui:Logo>
diff --git a/opensaml-saml-impl/src/main/resources/templates/metadata/IDPSSODescriptor.vm b/opensaml-saml-impl/src/main/resources/templates/metadata/IDPSSODescriptor.vm
index b8367bf7a..74017d357 100644
--- a/opensaml-saml-impl/src/main/resources/templates/metadata/IDPSSODescriptor.vm
+++ b/opensaml-saml-impl/src/main/resources/templates/metadata/IDPSSODescriptor.vm
@@ -1,5 +1,5 @@
 #set ($role = $params.IDPSSODescriptor)
-    <md:IDPSSODescriptor protocolSupportEnumeration="#foreach($p in $role.supportedProtocols)$p#if(!$foreach.last) #end#end">
+    <md:IDPSSODescriptor#if (!$role.supportedProtocols.empty) protocolSupportEnumeration="#foreach($p in $role.supportedProtocols)$p#if(!$foreach.last) #end#end"#end>
 #parse("$params.templatePath/Extensions.vm")
 #parse("$params.templatePath/KeyDescriptors.vm")
 #foreach ($endpoint in $role.artifactResolutionServices)
diff --git a/opensaml-saml-impl/src/main/resources/templates/metadata/SPSSODescriptor.vm b/opensaml-saml-impl/src/main/resources/templates/metadata/SPSSODescriptor.vm
index fcf75e486..bcb8a7da0 100644
--- a/opensaml-saml-impl/src/main/resources/templates/metadata/SPSSODescriptor.vm
+++ b/opensaml-saml-impl/src/main/resources/templates/metadata/SPSSODescriptor.vm
@@ -1,5 +1,5 @@
 #set ($role = $params.SPSSODescriptor)
-    <md:SPSSODescriptor #if ($role.wantAssertionsSigned)WantAssertionsSigned="true" #{end}protocolSupportEnumeration="#foreach($p in $role.supportedProtocols)$p#if(!$foreach.last) #end#end">
+    <md:SPSSODescriptor#if ($role.wantAssertionsSigned) WantAssertionsSigned="true"#end#if (!$role.supportedProtocols.empty) protocolSupportEnumeration="#foreach($p in $role.supportedProtocols)$p#if(!$foreach.last) #end#end"#end>
 #parse("$params.templatePath/Extensions.vm")
 #parse("$params.templatePath/KeyDescriptors.vm")
 #foreach ($endpoint in $role.artifactResolutionServices)

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


More information about the commits mailing list