Ensuring a 404 is returned when we can't find the specified certificate
This commit is contained in:
parent
7ab3e27c79
commit
096d88bc9b
|
@ -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