CVS update: JGroups/src/org/jgroups/protocols S3_PING.java

"Bela Ban" <[email protected]> Thu, 16 Sep 2010 14:59:15 +0000
Newsgroups gmane.comp.java.javagroups.cvs
Message-ID <[email protected]>
  User: belaban 
  Date: 10/09/16 14:59:15

  Modified:    src/org/jgroups/protocols Tag: Branch_JGroups_2_10
                        S3_PING.java
  Log:
  if acccess or secret key is null --> no authorization (https://jira.jboss.org/browse/JGRP-1234)
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.11.2.1  +10 -8     JGroups/src/org/jgroups/protocols/S3_PING.java
  
  Index: S3_PING.java
  ===================================================================
  RCS file: /cvsroot/javagroups/JGroups/src/org/jgroups/protocols/S3_PING.java,v
  retrieving revision 1.11
  retrieving revision 1.11.2.1
  diff -u -r1.11 -r1.11.2.1
  --- S3_PING.java	18 Jun 2010 04:39:08 -0000	1.11
  +++ S3_PING.java	16 Sep 2010 14:59:15 -0000	1.11.2.1
  @@ -35,7 +35,7 @@
    * Discovery protocol using Amazon's S3 storage. The S3 access code reuses the example shipped by Amazon.
    * This protocol is unsupported and experimental !
    * @author Bela Ban
  - * @version $Id: S3_PING.java,v 1.11 2010/06/18 04:39:08 belaban Exp $
  + * @version $Id: S3_PING.java,v 1.11.2.1 2010/09/16 14:59:15 belaban Exp $
    */
   @Experimental
   public class S3_PING extends FILE_PING {
  @@ -55,8 +55,8 @@
     
       public void init() throws Exception {
           super.init();
  -        if(access_key == null || secret_access_key == null)
  -            throw new IllegalArgumentException("access_key and secret_access_key must be non-null");
  +        // if(access_key == null || secret_access_key == null)
  +           // throw new IllegalArgumentException("access_key and secret_access_key must be non-null");
   
           conn=new AWSAuthConnection(access_key, secret_access_key);
   
  @@ -697,11 +697,13 @@
                   connection.setRequestProperty("Content-Type", "");
               }
   
  -            String canonicalString=
  -                    Utils.makeCanonicalString(method, bucket, key, pathArgs, connection.getRequestProperties());
  -            String encodedCanonical=Utils.encode(this.awsSecretAccessKey, canonicalString, false);
  -            connection.setRequestProperty("Authorization",
  -                                          "AWS " + this.awsAccessKeyId + ":" + encodedCanonical);
  +            if(awsAccessKeyId != null && awsSecretAccessKey != null) {
  +                String canonicalString=
  +                        Utils.makeCanonicalString(method, bucket, key, pathArgs, connection.getRequestProperties());
  +                String encodedCanonical=Utils.encode(this.awsSecretAccessKey, canonicalString, false);
  +                connection.setRequestProperty("Authorization",
  +                                              "AWS " + this.awsAccessKeyId + ":" + encodedCanonical);
  +            }
           }
   
   
  
  
  

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev