[java-opensaml] branch main updated: JMETAGEN-5 - Metadata generation

Scott Cantor cantor.2 at osu.edu
Thu Jul 13 15:11:22 UTC 2023


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=55e85a119603b138b3631ee7c6f435bafbe7d278

The following commit(s) were added to refs/heads/main by this push:
     new 55e85a119 JMETAGEN-5 - Metadata generation
55e85a119 is described below

commit 55e85a119603b138b3631ee7c6f435bafbe7d278
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Jul 13 11:11:19 2023 -0400

    JMETAGEN-5 - Metadata generation
    
    https://shibboleth.atlassian.net/browse/JMETAGEN-5
    
    Add Scope extension.
---
 .../metadata/generator/impl/MetadataGeneratorParameters.java  | 11 ++++++++++-
 .../src/main/resources/templates/metadata/EntityDescriptor.vm |  3 +++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/generator/impl/MetadataGeneratorParameters.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/generator/impl/MetadataGeneratorParameters.java
index 17cd5f633..6366054dc 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/generator/impl/MetadataGeneratorParameters.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/generator/impl/MetadataGeneratorParameters.java
@@ -54,6 +54,15 @@ public interface MetadataGeneratorParameters {
     @Nullable default String getEntityID() {
         return null;
     }
+    
+    /**
+     * Get the {Scope} extension(s).
+     * 
+     * @return scope list
+     */
+    @Nonnull @Unmodifiable @NotLive default List<String> getScopes() {
+        return CollectionSupport.emptyList();
+    }
 
     /**
      * Whether to omit the namespace declarations on the root element.
@@ -70,7 +79,7 @@ public interface MetadataGeneratorParameters {
      * @return whether to include extensions element
      */
     default boolean isRequiresExtensions() {
-        return getDisplayName() != null || getDescription() != null || getLogo() != null
+        return !getScopes().isEmpty() || getDisplayName() != null || getDescription() != null || getLogo() != null
                 || !getTagAssignments().isEmpty();
     }
     
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 0cee3f67b..82a67279f 100644
--- a/opensaml-saml-impl/src/main/resources/templates/metadata/EntityDescriptor.vm
+++ b/opensaml-saml-impl/src/main/resources/templates/metadata/EntityDescriptor.vm
@@ -2,6 +2,9 @@
 #if ($params.requiresExtensions)
 
     <md:Extensions>
+#foreach ($scope in $params.scopes)
+        <shibmd:Scope regexp="false">$xmltext.escape($scope)</shibmd:Scope>
+#end
 #if ($params.displayName || $params.description || $params.logo)
         <mdui:UIInfo>
 #if ($params.displayName)

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


More information about the commits mailing list