Add key_type to CertificateUploadInputSchema
Parse cert body to determine algo
This commit is contained in:
parent
bf7638937a
commit
7a226241db
|
@ -326,6 +326,7 @@ class CertificateUploadInputSchema(CertificateCreationSchema):
|
||||||
body = fields.String(required=True)
|
body = fields.String(required=True)
|
||||||
chain = fields.String(missing=None, allow_none=True)
|
chain = fields.String(missing=None, allow_none=True)
|
||||||
csr = fields.String(required=False, allow_none=True, validate=validators.csr)
|
csr = fields.String(required=False, allow_none=True, validate=validators.csr)
|
||||||
|
key_type = fields.String()
|
||||||
|
|
||||||
destinations = fields.Nested(AssociatedDestinationSchema, missing=[], many=True)
|
destinations = fields.Nested(AssociatedDestinationSchema, missing=[], many=True)
|
||||||
notifications = fields.Nested(AssociatedNotificationSchema, missing=[], many=True)
|
notifications = fields.Nested(AssociatedNotificationSchema, missing=[], many=True)
|
||||||
|
@ -373,6 +374,10 @@ class CertificateUploadInputSchema(CertificateCreationSchema):
|
||||||
# Throws ValidationError
|
# Throws ValidationError
|
||||||
validators.verify_cert_chain([cert] + chain)
|
validators.verify_cert_chain([cert] + chain)
|
||||||
|
|
||||||
|
@pre_load
|
||||||
|
def load_data(self, data):
|
||||||
|
data["key_type"] = utils.get_key_type_from_certificate(data["body"])
|
||||||
|
|
||||||
|
|
||||||
class CertificateExportInputSchema(LemurInputSchema):
|
class CertificateExportInputSchema(LemurInputSchema):
|
||||||
plugin = fields.Nested(PluginInputSchema)
|
plugin = fields.Nested(PluginInputSchema)
|
||||||
|
|
Loading…
Reference in New Issue