@@ -59,7 +59,7 @@ class SignedUrlS3Connection(S3Connection):
59
59
Example of a presigned S3 Url declaring a `list all buckets` call:
60
60
https://s3-us-west-1.amazonaws.com/?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA23E77ZX2HVY76YGL%2F20210505%2Fus-west-1%2Fs3%2Faws4_request&X-Amz-Date=20210505T171457Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=994d0ec2ca19a00aa2925fe62cab0e727591b1951a8a47504b2b9124facbd6cf
61
61
"""
62
- def __init__ (self , aws_access_key_id = None , aws_secret_access_key = None ,
62
+ def __init__ (self , username , aws_access_key_id = None , aws_secret_access_key = None ,
63
63
is_secure = True , port = None , proxy = None , proxy_port = None ,
64
64
proxy_user = None , proxy_pass = None ,
65
65
host = NoHostProvided , debug = 0 , https_connection_factory = None ,
@@ -68,6 +68,8 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
68
68
suppress_consec_slashes = True , anon = False ,
69
69
validate_certs = None , profile_name = None ):
70
70
71
+ self .username = username
72
+
71
73
# No auth handler with RAZ
72
74
anon = RAZ .IS_ENABLED .get () and not IS_SELF_SIGNING_ENABLED .get ()
73
75
@@ -109,7 +111,6 @@ def make_request(self, method, bucket='', key='', headers=None, data='',
109
111
auth_path = self .calling_format .build_auth_path (bucket , key )
110
112
boto .log .debug ('auth_path=%s' % auth_path )
111
113
host = self .calling_format .build_host (self .server_name (), bucket )
112
- #host = self.calling_format.build_host(self.server_name(), '') # As using signed Url we keep the same hostname as there
113
114
if query_args :
114
115
path += '?' + query_args
115
116
boto .log .debug ('path=%s' % path )
@@ -130,7 +131,6 @@ def make_request(self, method, bucket='', key='', headers=None, data='',
130
131
LOG .debug ('Raz returned those headers: %s' % headers )
131
132
132
133
if headers is not None :
133
- # We override instead of re-creating an HTTPRequest
134
134
http_request .headers .update (headers )
135
135
else :
136
136
LOG .error ('We got back empty header from Raz for the request %s' % http_request )
@@ -142,7 +142,7 @@ def make_request(self, method, bucket='', key='', headers=None, data='',
142
142
143
143
144
144
def get_signed_url (self , action = 'GET' , url = None ):
145
- raz_client = S3RazClient ()
145
+ raz_client = S3RazClient (username = self . username )
146
146
147
147
return raz_client .get_url (action , url )
148
148
0 commit comments