You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@libcloud.apache.org by "Dave King (Created) (JIRA)" <ji...@apache.org> on 2012/02/16 20:01:00 UTC

[dev] [jira] [Created] (LIBCLOUD-154) Parameters For All Drivers and Base Connection Do Not Support Tuple Lists

Parameters For All Drivers and Base Connection Do Not Support Tuple Lists
-------------------------------------------------------------------------

                 Key: LIBCLOUD-154
                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-154
             Project: Libcloud
          Issue Type: Task
          Components: Core
            Reporter: Dave King
            Priority: Minor


Currently the parameters argument to the base connection's request method is required to be a dict.

This prevents passing multiple query-string arguments with the same key.

The code sometimes works 'as is' because urlencode supports either dicts/tuple lists, but throughout the libcloud codebase there is code like:

EC2Connection:

    def add_default_params(self, params):
        params['SignatureVersion'] = '2'
        params['SignatureMethod'] = 'HmacSHA256'
        params['AWSAccessKeyId'] = self.user_id
        params['Version'] = API_VERSION
        params['Timestamp'] = time.strftime('%Y-%m-%dT%H:%M:%SZ',
                                            time.gmtime())
        params['Signature'] = self._get_aws_auth_param(params, self.key,
                                                       self.action)
        return params

This prevents tuple lists being used for EC2 drivers, for example.

A solution here would be to add a _extend_parameters to the base connection object, make it work whether the parameters were a dict or a list, and then update all the parameter mutating parts of the codebase to use it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[dev] [jira] [Updated] (LIBCLOUD-154) Parameters For All Drivers and Base Connection Do Not Support Tuple Lists

Posted by "Tomaz Muraus (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LIBCLOUD-154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tomaz Muraus updated LIBCLOUD-154:
----------------------------------

    Labels: beginners  (was: )
    
> Parameters For All Drivers and Base Connection Do Not Support Tuple Lists
> -------------------------------------------------------------------------
>
>                 Key: LIBCLOUD-154
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-154
>             Project: Libcloud
>          Issue Type: Task
>          Components: Core
>            Reporter: Dave King
>            Priority: Minor
>              Labels: beginners
>
> Currently the parameters argument to the base connection's request method is required to be a dict.
> This prevents passing multiple query-string arguments with the same key.
> The code sometimes works 'as is' because urlencode supports either dicts/tuple lists, but throughout the libcloud codebase there is code like:
> EC2Connection:
>     def add_default_params(self, params):
>         params['SignatureVersion'] = '2'
>         params['SignatureMethod'] = 'HmacSHA256'
>         params['AWSAccessKeyId'] = self.user_id
>         params['Version'] = API_VERSION
>         params['Timestamp'] = time.strftime('%Y-%m-%dT%H:%M:%SZ',
>                                             time.gmtime())
>         params['Signature'] = self._get_aws_auth_param(params, self.key,
>                                                        self.action)
>         return params
> This prevents tuple lists being used for EC2 drivers, for example.
> A solution here would be to add a _extend_parameters to the base connection object, make it work whether the parameters were a dict or a list, and then update all the parameter mutating parts of the codebase to use it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[dev] [jira] [Commented] (LIBCLOUD-154) Parameters For All Drivers and Base Connection Do Not Support Tuple Lists

Posted by "Dave King (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LIBCLOUD-154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13224606#comment-13224606 ] 

Dave King commented on LIBCLOUD-154:
------------------------------------

I started looking at this a few weekends ago and found that EC2's requests don't support multiple parameters with the same value, so at least that is out of the way.
                
> Parameters For All Drivers and Base Connection Do Not Support Tuple Lists
> -------------------------------------------------------------------------
>
>                 Key: LIBCLOUD-154
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-154
>             Project: Libcloud
>          Issue Type: Task
>          Components: Core
>            Reporter: Dave King
>            Priority: Minor
>              Labels: beginners
>
> Currently the parameters argument to the base connection's request method is required to be a dict.
> This prevents passing multiple query-string arguments with the same key.
> The code sometimes works 'as is' because urlencode supports either dicts/tuple lists, but throughout the libcloud codebase there is code like:
> EC2Connection:
>     def add_default_params(self, params):
>         params['SignatureVersion'] = '2'
>         params['SignatureMethod'] = 'HmacSHA256'
>         params['AWSAccessKeyId'] = self.user_id
>         params['Version'] = API_VERSION
>         params['Timestamp'] = time.strftime('%Y-%m-%dT%H:%M:%SZ',
>                                             time.gmtime())
>         params['Signature'] = self._get_aws_auth_param(params, self.key,
>                                                        self.action)
>         return params
> This prevents tuple lists being used for EC2 drivers, for example.
> A solution here would be to add a _extend_parameters to the base connection object, make it work whether the parameters were a dict or a list, and then update all the parameter mutating parts of the codebase to use it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira