Merge pull request #47 from kevgliss/keys
Fixing issue with a certificate with no role not being viewable
This commit is contained in:
commit
3df50f15f7
|
@ -446,8 +446,7 @@ class CertificatePrivateKey(AuthenticatedResource):
|
|||
|
||||
role = role_service.get_by_name(cert.owner)
|
||||
|
||||
if role:
|
||||
permission = ViewKeyPermission(certificate_id, role.name)
|
||||
permission = ViewKeyPermission(certificate_id, getattr(role, 'name', None))
|
||||
|
||||
if permission.can():
|
||||
response = make_response(jsonify(key=cert.private_key), 200)
|
||||
|
|
|
@ -17,4 +17,5 @@ def get_key():
|
|||
try:
|
||||
return current_app.config.get('LEMUR_ENCRYPTION_KEY').strip()
|
||||
except RuntimeError:
|
||||
print("No Encryption Key Found")
|
||||
return ''
|
||||
|
|
Loading…
Reference in New Issue