request.message_builder.base

Provides the base classes for the message building step of the request pipeline.

Module Contents

class request.message_builder.base.BuildingComponent[source]

Bases: abc.ABC

Abstract base class for components in the composite building pattern.

This is the building counterpart to ParsingComponent in message_parser/base.py. Each component is responsible for one aspect of constructing a CMP PKI message (e.g. header, body, protection preparation) and stores its results in the context.

abstractmethod build(context)[source]

Execute building logic and store results in the context.

Parameters:

context (request.request_context.BaseRequestContext)

Return type:

None

class request.message_builder.base.CompositeBuilding[source]

Bases: BuildingComponent, trustpoint.logger.LoggerMixin

Composite builder to group multiple building components.

Mirrors the CompositeParsing class from message_parser/base.py.

components: list[BuildingComponent] = [][source]
add(component)[source]

Add a building component to the composite builder.

Parameters:

component (BuildingComponent)

Return type:

None

remove(component)[source]

Remove a building component from the composite builder.

Parameters:

component (BuildingComponent)

Return type:

None

build(context)[source]

Execute all child builders sequentially.

Parameters:

context (request.request_context.BaseRequestContext)

Return type:

None