[java-shib-common COMMIT] in /branches/REL_1: doc/RELEASE-NOTES.txt src/main/java/edu/internet2/middleware/shibboleth...

noreply at shibboleth.net noreply at shibboleth.net
Tue Apr 10 03:24:37 BST 2012


Author: scantor
Date: Tue Apr 10 03:24:37 2012
New Revision: 1022

URL: http://svn.shibboleth.net/view/java-shib-common?rev=1022&view=rev
Log:
SC-176/SC-177: aacli fixes for linefeed and requester role

Modified:
    branches/REL_1/doc/RELEASE-NOTES.txt
    branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/AttributeAuthorityCLI.java

Modified: branches/REL_1/doc/RELEASE-NOTES.txt
URL: http://svn.shibboleth.net/view/java-shib-common/branches/REL_1/doc/RELEASE-NOTES.txt?rev=1022&r1=1021&r2=1022&view=diff
==============================================================================
--- branches/REL_1/doc/RELEASE-NOTES.txt (original)
+++ branches/REL_1/doc/RELEASE-NOTES.txt Tue Apr 10 03:24:37 2012
@@ -1,3 +1,8 @@
+Changes in Release 1.3.6
+=============================================
+[SC-176] - aacli utility doesn't set peer entity role metadata for requester
+[SC-177] - aacli utility generates extra linefeed in output
+
 Changes in Release 1.3.5
 =============================================
 [SC-169] - Velocity ErrorHandler doesn't set Content-Type of response

Modified: branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/AttributeAuthorityCLI.java
URL: http://svn.shibboleth.net/view/java-shib-common/branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/AttributeAuthorityCLI.java?rev=1022&r1=1021&r2=1022&view=diff
==============================================================================
--- branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/AttributeAuthorityCLI.java (original)
+++ branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/AttributeAuthorityCLI.java Tue Apr 10 03:24:37 2012
@@ -29,6 +29,8 @@
 
 import org.opensaml.Configuration;
 import org.opensaml.common.SAMLObject;
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.saml2.metadata.SPSSODescriptor;
 import org.opensaml.saml2.metadata.provider.MetadataProvider;
 import org.opensaml.saml2.metadata.provider.MetadataProviderException;
 import org.opensaml.util.resource.FilesystemResource;
@@ -78,6 +80,9 @@
     /** Loaded SAML 2 Attribute Authority. */
     private static SAML2AttributeAuthority saml2AA;
 
+    /** Protocol String. */
+    private static String protocol;
+    
     /**
      * Runs this application. Help message prints if no arguments are given or if the "help" argument is given.
      * 
@@ -98,8 +103,10 @@
         SAMLObject attributeStatement;
         Boolean saml1 = (Boolean) parser.getOptionValue(CLIParserBuilder.SAML1_ARG, Boolean.FALSE);
         if (saml1.booleanValue()) {
+            protocol = SAMLConstants.SAML11P_NS;
             attributeStatement = performSAML1AttributeResolution(parser, appCtx);
         } else {
+            protocol = SAMLConstants.SAML20P_NS;
             attributeStatement = performSAML2AttributeResolution(parser, appCtx);
         }
 
@@ -292,11 +299,15 @@
             requester = rpConfigManager.getAnonymousRelyingConfiguration().getRelyingPartyId();
             requestContext.setRelyingPartyConfiguration(rpConfigManager.getAnonymousRelyingConfiguration());
         }
-
+        
         try {
             requestContext.setInboundMessageIssuer(requester);
             requestContext.setPeerEntityId(requester);
             requestContext.setPeerEntityMetadata(requestContext.getMetadataProvider().getEntityDescriptor(requester));
+            if (requestContext.getPeerEntityMetadata() != null) {
+                requestContext.setPeerEntityRole(SPSSODescriptor.DEFAULT_ELEMENT_NAME);
+                requestContext.setPeerEntityRoleMetadata(requestContext.getPeerEntityMetadata().getSPSSODescriptor(protocol));
+            }
         } catch (MetadataProviderException e) {
             errorAndExit("Unable to query for metadata for requester " + requester, e);
         }
@@ -334,7 +345,6 @@
 
         try {
             Element statement = statementMarshaller.marshall(attributeStatement);
-            System.out.println();
             System.out.println(XMLHelper.prettyPrintXML(statement));
         } catch (MarshallingException e) {
             errorAndExit("Unable to marshall attribute statement", e);



More information about the commits mailing list