mirror of
https://github.com/laurivosandi/certidude
synced 2024-12-23 00:25:18 +00:00
api: Fix exception includes
This commit is contained in:
parent
661e7608ef
commit
b830ce7671
@ -4,7 +4,7 @@ import falcon
|
|||||||
import logging
|
import logging
|
||||||
import ipaddress
|
import ipaddress
|
||||||
import os
|
import os
|
||||||
from certidude import config, authority, helpers, push
|
from certidude import config, authority, helpers, push, errors
|
||||||
from certidude.auth import login_required, authorize_admin
|
from certidude.auth import login_required, authorize_admin
|
||||||
from certidude.decorators import serialize
|
from certidude.decorators import serialize
|
||||||
from certidude.wrappers import Request, Certificate
|
from certidude.wrappers import Request, Certificate
|
||||||
@ -68,10 +68,10 @@ class RequestListResource(object):
|
|||||||
# Attempt to save the request otherwise
|
# Attempt to save the request otherwise
|
||||||
try:
|
try:
|
||||||
csr = authority.store_request(body)
|
csr = authority.store_request(body)
|
||||||
except authority.RequestExists:
|
except errors.RequestExists:
|
||||||
# We should stil redirect client to long poll URL below
|
# We should stil redirect client to long poll URL below
|
||||||
pass
|
pass
|
||||||
except authority.DuplicateCommonNameError:
|
except errors.DuplicateCommonNameError:
|
||||||
# TODO: Certificate renewal
|
# TODO: Certificate renewal
|
||||||
logger.warning("Rejected signing request with overlapping common name from %s", req.env["REMOTE_ADDR"])
|
logger.warning("Rejected signing request with overlapping common name from %s", req.env["REMOTE_ADDR"])
|
||||||
raise falcon.HTTPConflict(
|
raise falcon.HTTPConflict(
|
||||||
|
Loading…
Reference in New Issue
Block a user