Exemple #1
0
 def get_url(self, region_id, ak, secret):
     sign_params = self._get_sign_params()
     if 'RegionId' not in iterkeys(sign_params):
         sign_params['RegionId'] = region_id
     url = rpc_signer.get_signed_url(sign_params, ak, secret,
                                     self.get_accept_format(),
                                     self.get_method(),
                                     self.get_body_params(), self._signer)
     return url
Exemple #2
0
 def get_url(self, region_id, access_key_id, access_key_secret):
     sign_params = self._get_sign_params()
     if 'RegionId' not in iterkeys(sign_params):
         sign_params['RegionId'] = region_id
     url, string_to_sign = rpc_signer.get_signed_url(
         sign_params, access_key_id, access_key_secret,
         self.get_accept_format(), self.get_method(),
         self.get_body_params(), self._signer)
     self.string_to_sign = string_to_sign
     return url
Exemple #3
0
 def get_url(self, region_id, ak=None, secret=None):
     """
     Generate request url without domain
     :param region_id: String
     :return: String
     """
     sign_params = self.get_query_params()
     if 'RegionId' not in iterkeys(sign_params):
         sign_params['RegionId'] = region_id
     url = oss_signer.get_url(sign_params, self.get_uri_pattern(),
                              self.get_path_params())
     return url
Exemple #4
0
 def get_signed_header(
     self,
     region_id,
     ak,
     secret,
 ):
     """
     Compose signed headers.
     :param region_id: String
     :param ak: String
     :param secret: String
     :return:
     """
     sign_params = self.get_query_params()
     if 'RegionId' not in iterkeys(sign_params):
         sign_params['RegionId'] = region_id
     signed_headers = oss_signer.get_signature_headers(
         sign_params, ak, secret, self.get_accept_format(),
         self.get_headers(), self.get_uri_pattern(), self.get_path_params(),
         self.get_method(), self.__bucket)
     return signed_headers