Merge pull request #353 from mikegrima/issue352

Fix for Issue #352.
This commit is contained in:
Mike Grima 2016-06-09 15:13:37 -07:00 committed by GitHub
commit 7d50e4d65f
2 changed files with 5 additions and 5 deletions

View File

@ -52,15 +52,15 @@ def sensitive_domain(domain):
to issue the certificate.'.format(domain))
def oid_type(oid_type):
def encoding(oid_encoding):
"""
Determines if the specified oid type is valid.
:param oid_type:
:param oid_encoding:
:return:
"""
valid_types = ['b64asn1', 'string', 'ia5string']
if oid_type.lower() not in [o_type.lower() for o_type in valid_types]:
raise ValidationError('Invalid Oid Type: {0} choose from {1}'.format(oid_type, ",".join(valid_types)))
if oid_encoding.lower() not in [o_type.lower() for o_type in valid_types]:
raise ValidationError('Invalid Oid Encoding: {0} choose from {1}'.format(oid_encoding, ",".join(valid_types)))
def sub_alt_type(alt_type):

View File

@ -196,7 +196,7 @@ class SubAltNamesSchema(BaseExtensionSchema):
class CustomOIDSchema(BaseExtensionSchema):
oid = fields.String()
oid_type = fields.String(validate=validators.oid_type)
encoding = fields.String(validate=validators.encoding)
value = fields.String()