Example #1
0
 def test_signature(self):
     expected = b("26NBxoKdsyly4EDv6inkoDft/yA=")
     headers = {
         "Content-MD5": "ODBGOERFMDMzQTczRUY3NUE3NzA5QzdFNUYzMDQxNEM=",
         "Content-Type": "text/html",
         "Expires": "Thu, 17 Nov 2005 18:49:58 GMT",
         "X-OSS-Meta-Author": "*****@*****.**",
         "X-OSS-Magic": "abracadabra",
         "Host": "oss-example.oss-cn-hangzhou.aliyuncs.com",
     }
     action = "/oss-example/nelson"
     actual = OSSConnection._get_auth_signature(
         "PUT", headers, {}, headers["Expires"], self.conn.key, action, "x-oss-"
     )
     self.assertEqual(expected, actual)
Example #2
0
 def test_signature(self):
     expected = b('26NBxoKdsyly4EDv6inkoDft/yA=')
     headers = {
         'Content-MD5': 'ODBGOERFMDMzQTczRUY3NUE3NzA5QzdFNUYzMDQxNEM=',
         'Content-Type': 'text/html',
         'Expires': 'Thu, 17 Nov 2005 18:49:58 GMT',
         'X-OSS-Meta-Author': '*****@*****.**',
         'X-OSS-Magic': 'abracadabra',
         'Host': 'oss-example.oss-cn-hangzhou.aliyuncs.com'
     }
     action = '/oss-example/nelson'
     actual = OSSConnection._get_auth_signature('PUT', headers, {},
                                                headers['Expires'],
                                                self.conn.key, action,
                                                'x-oss-')
     self.assertEqual(expected, actual)
Example #3
0
 def test_signature(self):
     expected = b('26NBxoKdsyly4EDv6inkoDft/yA=')
     headers = {
         'Content-MD5': 'ODBGOERFMDMzQTczRUY3NUE3NzA5QzdFNUYzMDQxNEM=',
         'Content-Type': 'text/html',
         'Expires': 'Thu, 17 Nov 2005 18:49:58 GMT',
         'X-OSS-Meta-Author': '*****@*****.**',
         'X-OSS-Magic': 'abracadabra',
         'Host': 'oss-example.oss-cn-hangzhou.aliyuncs.com'
     }
     action = '/oss-example/nelson'
     actual = OSSConnection._get_auth_signature('PUT', headers, {},
                                                headers['Expires'],
                                                self.conn.key,
                                                action,
                                                'x-oss-')
     self.assertEqual(expected, actual)
Example #4
0
 def setUp(self):
     self.conn = OSSConnection('44CF9590006BF252F707',
                               'OtxrzxIsfpFjA7SwPzILwy8Bw21TLhquhboDYROV')