pki.tests.test_cert_profiles¶
Tests for the JSON template verification module.
Functions¶
Test that a valid profile instance can be created. |
|
Test that an invalid profile instance raises an error. |
|
Test that an incomplete profile instance raises an error. |
|
Test that a request with a prohibited CN fails verification. |
|
Test that a request with a prohibited CN is removed when reject_mods is False. |
|
Test that a request with an allowed CN passes verification. |
|
Test that a request with an allowed CN passes verification (alias 'cn' for 'common_name'). |
|
Test that a not explicitly allowed CN without implicit allow is removed from the request. |
|
Test that a not explicitly allowed CN with reject_mods=True fails verification. |
|
Test that the request CN takes precedence over the profile's default CN. |
|
Test that the profile's default CN is applied when the request CN is absent. |
|
Test that a request with implicit allow for all fields passes verification. |
|
Test that a request with an unknown field passes verification with implicit allow. |
|
Test that a request missing a required CN fails verification. |
|
Test that a request with a CN incompatible with the profile and reject_mods fails verification. |
|
Test that a request with a CN incompatible with the profile and no reject_mods uses the CN from the profile. |
|
Test that a request missing a required extension fails verification. |
|
Test that the request extension takes precedence over the profile's default extension. |
|
Test that the profile's default extension is applied when the request extension is absent. |
|
Test that a request with an extension incompatible with the profile and reject_mods fails verification. |
|
Test that a request with an extension incompatible with the profile (extra field in req) and reject_mods fails verification. |
|
Test that a request with an incompatible extension and no reject_mods uses the extension from the profile. |
|
Test that a request with a mutable extension value passes verification. |
|
Test that a request with a prohibited extension fails verification. |
|
Test that a request with an extension not explicitely allowed by the profile fails verification. |
|
Test that a request with an allowed extension passes verification. |
|
Test that a request with any extension passes verification when allow='*'. |
|
Test that a request with a SAN extension passes verification when allow='*' and SAN specified in profile. |
|
Test that a sample request generated from a profile includes default extension values. |
|
Regression test that a sample req. from a profile includes default ext values when allow='*'. |
|
Test that a request is normalized correctly. |
|
Test that the CSR to JSON adapter works correctly. |
|
Test that the JSON to Certificate Builder adapter works correctly. |
|
Test that the JSON to Certificate Builder adapter raises an error when validity is missing. |
Module Contents¶
- pki.tests.test_cert_profiles.test_valid_profile_instance()[source]¶
Test that a valid profile instance can be created.
- Return type:
None
- pki.tests.test_cert_profiles.test_invalid_profile_instance()[source]¶
Test that an invalid profile instance raises an error.
- Return type:
None
- pki.tests.test_cert_profiles.test_incomplete_profile_instance()[source]¶
Test that an incomplete profile instance raises an error.
Behavior (subject to change) when ‘subj’ field is missing: - Effectively prohibits subject, which is not valid in X.509 certs.
- Return type:
None
- pki.tests.test_cert_profiles.test_prohibited_cn_present()[source]¶
Test that a request with a prohibited CN fails verification.
- Return type:
None
- pki.tests.test_cert_profiles.test_prohibited_cn_present_no_reject()[source]¶
Test that a request with a prohibited CN is removed when reject_mods is False.
- Return type:
None
- pki.tests.test_cert_profiles.test_allowed_cn_present()[source]¶
Test that a request with an allowed CN passes verification.
- Return type:
None
- pki.tests.test_cert_profiles.test_allowed_cn_alias_present()[source]¶
Test that a request with an allowed CN passes verification (alias ‘cn’ for ‘common_name’).
- Return type:
None
- pki.tests.test_cert_profiles.test_unspecified_cn_present_no_reject()[source]¶
Test that a not explicitly allowed CN without implicit allow is removed from the request.
- Return type:
None
- pki.tests.test_cert_profiles.test_unspecified_cn_present_reject()[source]¶
Test that a not explicitly allowed CN with reject_mods=True fails verification.
- Return type:
None
- pki.tests.test_cert_profiles.test_default_cn_present_in_request()[source]¶
Test that the request CN takes precedence over the profile’s default CN.
- Return type:
None
- pki.tests.test_cert_profiles.test_default_cn_absent_in_request()[source]¶
Test that the profile’s default CN is applied when the request CN is absent.
- Return type:
None
- pki.tests.test_cert_profiles.test_implicit_allow_subject()[source]¶
Test that a request with implicit allow for all fields passes verification.
- Return type:
None
- pki.tests.test_cert_profiles.test_implicit_allow_unknown_field()[source]¶
Test that a request with an unknown field passes verification with implicit allow.
- Return type:
None
- pki.tests.test_cert_profiles.test_required_cn_absent()[source]¶
Test that a request missing a required CN fails verification.
- Return type:
None
- pki.tests.test_cert_profiles.test_incompatible_request_cn()[source]¶
Test that a request with a CN incompatible with the profile and reject_mods fails verification.
- Return type:
None
- pki.tests.test_cert_profiles.test_incompatible_request_cn_no_reject_mods()[source]¶
Test that a request with a CN incompatible with the profile and no reject_mods uses the CN from the profile.
- Return type:
None
- pki.tests.test_cert_profiles.test_required_ext_absent()[source]¶
Test that a request missing a required extension fails verification.
- Return type:
None
- pki.tests.test_cert_profiles.test_default_ext_present_in_req()[source]¶
Test that the request extension takes precedence over the profile’s default extension.
- Return type:
None
- pki.tests.test_cert_profiles.test_default_ext_absent_in_req()[source]¶
Test that the profile’s default extension is applied when the request extension is absent.
- Return type:
None
- pki.tests.test_cert_profiles.test_incompatible_ext()[source]¶
Test that a request with an extension incompatible with the profile and reject_mods fails verification.
- Return type:
None
- pki.tests.test_cert_profiles.test_incompatible_ext_extra_field()[source]¶
Test that a request with an extension incompatible with the profile (extra field in req) and reject_mods fails verification.
- Return type:
None
- pki.tests.test_cert_profiles.test_incompatible_ext_no_reject()[source]¶
Test that a request with an incompatible extension and no reject_mods uses the extension from the profile.
- Return type:
None
- pki.tests.test_cert_profiles.test_ext_value_mutable()[source]¶
Test that a request with a mutable extension value passes verification.
- Return type:
None
- pki.tests.test_cert_profiles.test_prohibited_ext_present()[source]¶
Test that a request with a prohibited extension fails verification.
- Return type:
None
- pki.tests.test_cert_profiles.test_not_allowed_ext_present()[source]¶
Test that a request with an extension not explicitely allowed by the profile fails verification.
- Return type:
None
- pki.tests.test_cert_profiles.test_allowed_ext_present()[source]¶
Test that a request with an allowed extension passes verification.
- Return type:
None
- pki.tests.test_cert_profiles.test_allowed_ext_allow_any()[source]¶
Test that a request with any extension passes verification when allow=’*’.
- Return type:
None
- pki.tests.test_cert_profiles.test_allowed_ext_allow_any_explicit_profile()[source]¶
Test that a request with a SAN extension passes verification when allow=’*’ and SAN specified in profile.
- Return type:
None
- pki.tests.test_cert_profiles.test_sample_request_contains_ext_defaults()[source]¶
Test that a sample request generated from a profile includes default extension values.
- Return type:
None
- pki.tests.test_cert_profiles.test_sample_request_contains_ext_defaults_allow_any()[source]¶
Regression test that a sample req. from a profile includes default ext values when allow=’*’.
- Return type:
None
- pki.tests.test_cert_profiles.test_request_normalization()[source]¶
Test that a request is normalized correctly.
- Return type:
None
- pki.tests.test_cert_profiles.test_csr_to_json_adapter()[source]¶
Test that the CSR to JSON adapter works correctly.
- Return type:
None