Combining Authority Key Identifier extension options in the schema. (#651)

* Combining Authority Key Identifier extension options in the schema.
This makes processing them in the cert/csr generation stage make more sense because they are two options in the same x.509 extension. They were already in the same part of the schema for authorities, but this makes the certificates follow the same pattern, and it allows them to share the same schema/validation layout.

* Updating schema tests to match changes

* Fixing an idiot typo

* I promise to stop using Travis as a typo-corrector soon.
This commit is contained in:
Neil Schelly
2017-01-18 17:16:19 -05:00
committed by kevgliss
parent 7f2b44db04
commit 25340fd744
3 changed files with 11 additions and 25 deletions

View File

@ -65,27 +65,19 @@ def test_certificate_edit_schema(session):
assert len(data['notifications']) == 3
def test_authority_identifier_schema():
from lemur.schemas import AuthorityIdentifierSchema
input_data = {'useAuthorityCert': True}
data, errors = AuthorityIdentifierSchema().load(input_data)
assert data == {'use_authority_cert': True}
assert not errors
data, errors = AuthorityIdentifierSchema().dumps(data)
assert not errors
assert data == json.dumps(input_data)
def test_authority_key_identifier_schema():
from lemur.schemas import AuthorityKeyIdentifierSchema
input_data = {'useKeyIdentifier': True}
input_data = {
'useKeyIdentifier': True,
'useAuthorityCert': True
}
data, errors = AuthorityKeyIdentifierSchema().load(input_data)
assert data == {'use_key_identifier': True}
assert data == {
'use_key_identifier': True,
'use_authority_cert': True
}
assert not errors
data, errors = AuthorityKeyIdentifierSchema().dumps(data)