Ensuring a 404 is returned when we can't find the specified certificate
This commit is contained in:
parent
c8cbc82062
commit
1f9d943a4c
|
@ -437,6 +437,9 @@ class CertificatePrivateKey(AuthenticatedResource):
|
||||||
:statuscode 403: unauthenticated
|
:statuscode 403: unauthenticated
|
||||||
"""
|
"""
|
||||||
cert = service.get(certificate_id)
|
cert = service.get(certificate_id)
|
||||||
|
if not cert:
|
||||||
|
return dict(message="Cannot find specified certificate"), 404
|
||||||
|
|
||||||
role = role_service.get_by_name(cert.owner)
|
role = role_service.get_by_name(cert.owner)
|
||||||
|
|
||||||
permission = ViewKeyPermission(certificate_id, hasattr(role, 'id'))
|
permission = ViewKeyPermission(certificate_id, hasattr(role, 'id'))
|
||||||
|
|
Loading…
Reference in New Issue