Skip to content
This repository was archived by the owner on May 8, 2018. It is now read-only.

Commit 7187ad8

Browse files
committed
Merge pull request #23 from albrnick/master
Added auth_token to mws
2 parents 07a759e + a9fc8d6 commit 7187ad8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

mws/mws.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,11 @@ class MWS(object):
141141
# Which is the name of the parameter for that specific account type.
142142
ACCOUNT_TYPE = "SellerId"
143143

144-
def __init__(self, access_key, secret_key, account_id, region='US', domain='', uri="", version=""):
144+
def __init__(self, access_key, secret_key, account_id, region='US', domain='', uri="", version="", auth_token=""):
145145
self.access_key = access_key
146146
self.secret_key = secret_key
147147
self.account_id = account_id
148+
self.auth_token = auth_token
148149
self.version = version or self.VERSION
149150
self.uri = uri or self.URI
150151

@@ -175,6 +176,8 @@ def make_request(self, extra_data, method="GET", **kwargs):
175176
'Version': self.version,
176177
'SignatureMethod': 'HmacSHA256',
177178
}
179+
if self.auth_token:
180+
params['MWSAuthToken'] = self.auth_token
178181
params.update(extra_data)
179182
request_description = '&'.join(['%s=%s' % (k, urllib.quote(params[k], safe='-_.~').encode('utf-8')) for k in sorted(params)])
180183
signature = self.calc_signature(method, request_description)

0 commit comments

Comments
 (0)