device_management.py supports application access keys

pull/13524/head
Norbert Dávid 2020-09-02 08:47:47 +03:00 committed by GitHub
parent 4ef38f95d8
commit bf1ba52083
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 8 deletions

View File

@ -114,17 +114,11 @@ def wrap_init(func):
# Get the currently in-use API key (may come from environment or
# configuration files, which is handled by the cloud SDK)
api_key_value = accounts.config.get("api_key")
api_key = next(accounts.list_api_keys(
filter={
"key": api_key_value
}
))
api_key = accounts.get_api_key("me")
certificates_owned = list(certs.list_certificates())
dev_cert_info = None
for certif in certificates_owned:
if certif.type == "developer" and (certif.owner_id == api_key.owner_id or
certif.owner_id == api_key.id):
if certif.type == "developer":
dev_cert_info = certs.get_certificate(certif.id)
LOG.info("Found developer certificate named %s",
dev_cert_info.name)