mirror of https://github.com/ARMmbed/mbed-os.git
device_management.py supports application access keys
parent
4ef38f95d8
commit
bf1ba52083
|
@ -114,17 +114,11 @@ def wrap_init(func):
|
||||||
|
|
||||||
# Get the currently in-use API key (may come from environment or
|
# Get the currently in-use API key (may come from environment or
|
||||||
# configuration files, which is handled by the cloud SDK)
|
# configuration files, which is handled by the cloud SDK)
|
||||||
api_key_value = accounts.config.get("api_key")
|
api_key = accounts.get_api_key("me")
|
||||||
api_key = next(accounts.list_api_keys(
|
|
||||||
filter={
|
|
||||||
"key": api_key_value
|
|
||||||
}
|
|
||||||
))
|
|
||||||
certificates_owned = list(certs.list_certificates())
|
certificates_owned = list(certs.list_certificates())
|
||||||
dev_cert_info = None
|
dev_cert_info = None
|
||||||
for certif in certificates_owned:
|
for certif in certificates_owned:
|
||||||
if certif.type == "developer" and (certif.owner_id == api_key.owner_id or
|
if certif.type == "developer":
|
||||||
certif.owner_id == api_key.id):
|
|
||||||
dev_cert_info = certs.get_certificate(certif.id)
|
dev_cert_info = certs.get_certificate(certif.id)
|
||||||
LOG.info("Found developer certificate named %s",
|
LOG.info("Found developer certificate named %s",
|
||||||
dev_cert_info.name)
|
dev_cert_info.name)
|
||||||
|
|
Loading…
Reference in New Issue