Skip to content

Commit fe1bbcb

Browse files
committed
Fix bucket name mapping in RawSimulator.authorize_account
1 parent fa4a58b commit fe1bbcb

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

b2sdk/_internal/raw_simulator.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,14 @@ def authorize_account(self, realm_url, application_key_id, application_key):
14041404

14051405
allowed = key_sim.get_allowed()
14061406

1407+
buckets = allowed.get('buckets')
1408+
if buckets:
1409+
for item in buckets:
1410+
try:
1411+
item['name'] = self.bucket_id_to_bucket[item['id']].bucket_name
1412+
except KeyError:
1413+
item['name'] = None
1414+
14071415
return dict(
14081416
accountId=key_sim.account_id,
14091417
authorizationToken=auth_token,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bucket name mapping in `RawSimulator.authorize_account()`.

0 commit comments

Comments
 (0)