request.tests.test_pki_message_parserΒΆ

Unit tests for PKI message parser components.

ClassesΒΆ

TestEstPkiMessageParsing

Test cases for EstPkiMessageParsing component.

TestEstCsrSignatureVerification

Test cases for EstCsrSignatureVerification component.

TestEstAuthorizationHeaderParsing

Test EstAuthorizationHeaderParsing class.

TestDomainParsing

Test cases for DomainParsing component.

TestCertProfileParsing

Test cases for CertProfileParsing component.

TestCmpPkiMessageParsing

Test cases for CmpPkiMessageParsing component.

TestCompositeParsing

Test cases for CompositeParsing component.

TestCmpMessageParser

Test cases for CmpMessageParser.

TestEstMessageParser

Test cases for EstMessageParser.

Module ContentsΒΆ

class request.tests.test_pki_message_parser.TestEstPkiMessageParsing[source]ΒΆ

Test cases for EstPkiMessageParsing component.

test_parse_pem_csr_success(test_csr_fixture)[source]ΒΆ

Test parsing a valid PEM-encoded CSR.

test_parse_base64_der_with_newlines_success(test_csr_fixture)[source]ΒΆ

Test parsing a valid Base64-encoded DER CSR with newlines.

test_parse_base64_der_csr_success(test_csr_fixture)[source]ΒΆ

Test parsing a valid Base64-encoded DER CSR.

test_parse_der_csr_success(test_csr_fixture)[source]ΒΆ

Test parsing a valid raw DER CSR.

test_parse_missing_raw_message()[source]ΒΆ

Test parsing with missing raw message.

test_parse_missing_message_body()[source]ΒΆ

Test parsing with missing message body.

test_parse_unsupported_format()[source]ΒΆ

Test parsing with unsupported CSR format.

test_parse_exception_handling()[source]ΒΆ

Test handling of parsing exceptions.

class request.tests.test_pki_message_parser.TestEstCsrSignatureVerification[source]ΒΆ

Test cases for EstCsrSignatureVerification component.

test_verify_rsa_signature_success(test_csr_fixture)[source]ΒΆ

Test successful RSA signature verification.

test_verify_missing_csr()[source]ΒΆ

Test verification with missing CSR.

test_verify_missing_hash_algorithm()[source]ΒΆ

Test verification with missing hash algorithm.

test_verify_unsupported_key_type()[source]ΒΆ

Test verification with unsupported key type.

test_verify_signature_failure()[source]ΒΆ

Test handling of signature verification failure.

class request.tests.test_pki_message_parser.TestEstAuthorizationHeaderParsing[source]ΒΆ

Test EstAuthorizationHeaderParsing class.

test_validate_success()[source]ΒΆ

Test successful validation and credential extraction.

test_validate_missing_authorization()[source]ΒΆ

Test that missing Authorization header passes.

test_validate_non_basic_auth()[source]ΒΆ

Test that non-Basic auth does not pass.

test_validate_malformed_basic_auth()[source]ΒΆ

Test ValueError for malformed Basic auth credentials.

test_validate_basic_auth_no_colon()[source]ΒΆ

Test ValueError for Basic auth without colon separator.

test_validate_missing_raw_message()[source]ΒΆ

Test ValueError when raw_message is None.

test_validate_missing_headers()[source]ΒΆ

Test ValueError when headers are missing.

class request.tests.test_pki_message_parser.TestDomainParsing[source]ΒΆ

Test cases for DomainParsing component.

test_parse_domain_success()[source]ΒΆ

Test successful domain parsing.

test_parse_missing_domain()[source]ΒΆ

Test parsing with missing domain string.

It is not mandatory to have a domain at this stage (e.g. general endpoint without path segment). Domain can be resolved from device in authentication step.

test_parse_domain_validation_error()[source]ΒΆ

Test domain validation error handling.

test_parse_domain_not_found()[source]ΒΆ

Test domain not found error handling.

test_extract_requested_domain_success()[source]ΒΆ

Test successful domain extraction.

test_extract_requested_domain_not_exist()[source]ΒΆ

Test domain extraction when domain doesn’t exist.

test_extract_requested_domain_multiple_found()[source]ΒΆ

Test domain extraction when multiple domains found.

class request.tests.test_pki_message_parser.TestCertProfileParsing[source]ΒΆ

Test cases for CertProfileParsing component.

test_parse_cert_profile_not_cert_request_context()[source]ΒΆ

Test missing cert profile string is ignored if not a certificate request context.

test_parse_cert_profile_str_success()[source]ΒΆ

Test successful certificate profile string parsing.

test_parse_missing_cert_profile_str()[source]ΒΆ

Test parsing with missing certificate template.

class request.tests.test_pki_message_parser.TestCmpPkiMessageParsing[source]ΒΆ

Test cases for CmpPkiMessageParsing component.

test_parse_cmp_message_success()[source]ΒΆ

Test successful CMP message parsing.

test_parse_missing_raw_message()[source]ΒΆ

Test parsing with missing raw message.

test_parse_missing_message_body()[source]ΒΆ

Test parsing with missing message body.

test_parse_decode_error()[source]ΒΆ

Test handling of decode errors.

test_parse_type_error()[source]ΒΆ

Test handling of type errors during decode.

class request.tests.test_pki_message_parser.TestCompositeParsing[source]ΒΆ

Test cases for CompositeParsing component.

test_add_component()[source]ΒΆ

Test adding a component to the composite parser.

test_remove_component()[source]ΒΆ

Test removing a component from the composite parser.

test_parse_calls_all_components()[source]ΒΆ

Test that parse calls all components in order.

test_parse_empty_components()[source]ΒΆ

Test parsing with no components.

class request.tests.test_pki_message_parser.TestCmpMessageParser[source]ΒΆ

Test cases for CmpMessageParser.

test_initialization()[source]ΒΆ

Test CmpMessageParser initialization.

test_parse_delegation()[source]ΒΆ

Test that parse method delegates to components.

class request.tests.test_pki_message_parser.TestEstMessageParser[source]ΒΆ

Test cases for EstMessageParser.

test_initialization()[source]ΒΆ

Test EstMessageParser initialization.

test_parse_delegation()[source]ΒΆ

Test that parse method delegates to all components.

test_parse_component_failure_stops_execution()[source]ΒΆ

Test that component failure stops execution of subsequent components.