Skip to content

Commit f8cd593

Browse files
authored
BUGFIX: Remove account management API calls
Developer API keys don't have the privileges required to get information about their owners. To correct for this, remove user name reporting and use the API key `owner_id` directly. Fixes: IOTAUTH-1686
1 parent 920db63 commit f8cd593

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tools/device_management.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,14 @@ def inner(options):
8585
api_key = accounts.list_api_keys(filter={
8686
'key': getenv("MBED_CLOUD_SDK_API_KEY")
8787
}).next()
88-
user = accounts.get_user(api_key.owner_id)
8988
certificates_owned = list(certs.list_certificates())
9089
dev_cert_info = None
9190
for certif in certificates_owned:
92-
if certif.type == "developer" and (certif.owner_id == user.id or
91+
if certif.type == "developer" and (certif.owner_id == api_key.owner_id or
9392
certif.owner_id == api_key.id):
9493
dev_cert_info = certs.get_certificate(certif.id)
95-
LOG.info("Found developer certificate onwed by %s named %s",
96-
user.full_name, dev_cert_info.name)
94+
LOG.info("Found developer certificate named %s",
95+
dev_cert_info.name)
9796
break
9897
else:
9998
LOG.warning(

0 commit comments

Comments
 (0)