request.request_validator.http_req ================================== .. py:module:: request.request_validator.http_req .. autoapi-nested-parse:: Provides the `HttpRequestValidator` class for validating HTTP requests. Module Contents --------------- .. py:class:: ValidationComponent Bases: :py:obj:`abc.ABC` Abstract base class to represent a component in composite validation. .. py:method:: validate(context) :abstractmethod: Execute validation logic and enrich context. .. py:class:: PayloadSizeValidation(max_payload_size) Bases: :py:obj:`ValidationComponent`, :py:obj:`trustpoint.logger.LoggerMixin` Validate payload size. .. py:attribute:: max_payload_size .. py:method:: validate(context) Validate the payload size against the maximum allowed size. .. py:class:: ContentTypeValidation(expected_content_type) Bases: :py:obj:`ValidationComponent`, :py:obj:`trustpoint.logger.LoggerMixin` Validate request content type. .. py:attribute:: expected_content_type .. py:method:: validate(context) Validate the presence of the 'Content-Type' header and check if it matches the expected type. .. py:class:: AcceptHeaderValidation(allowed_content_types) Bases: :py:obj:`ValidationComponent`, :py:obj:`trustpoint.logger.LoggerMixin` Validate the Accept header. .. py:attribute:: allowed_content_types .. py:method:: validate(context) Validate the presence of the 'Accept' header and check if it matches any of the allowed types. .. py:class:: ClientCertificateValidation Bases: :py:obj:`ValidationComponent`, :py:obj:`trustpoint.logger.LoggerMixin` Check and optionally process the SSL client certificate from the request headers. .. py:method:: validate(context) Check for the presence of the 'HTTP_SSL_CLIENT_CERT' header and set the cert in the context if present. .. py:class:: IntermediateCertificatesValidation Bases: :py:obj:`ValidationComponent`, :py:obj:`trustpoint.logger.LoggerMixin` Validate and process intermediate CA certificates from the request headers. .. py:method:: validate(context) Extract and validate intermediate CA certificates from the 'SSL_CLIENT_CERT_CHAIN_*' headers. .. py:class:: ContentTransferEncodingValidation Bases: :py:obj:`ValidationComponent`, :py:obj:`trustpoint.logger.LoggerMixin` Validate the Content-Transfer-Encoding header and decode base64-encoded messages if required. .. py:method:: validate(context) Validates and processes requests with a Content-Transfer-Encoding header set to 'base64'. .. py:class:: CompositeValidation Bases: :py:obj:`ValidationComponent`, :py:obj:`trustpoint.logger.LoggerMixin` Composite validator to group multiple validators. .. py:attribute:: components :type: list[ValidationComponent] :value: [] .. py:method:: add(component) Add a new component to the composite. .. py:method:: remove(component) Remove a component from the composite. .. py:method:: validate(context) Validate all child components. .. py:class:: CmpHttpRequestValidator Bases: :py:obj:`CompositeValidation` Validator for CMP-specific HTTP requests. .. py:class:: EstHttpRequestValidator Bases: :py:obj:`CompositeValidation` Validator for EST-specific HTTP requests.