Skip to content

interfaces

trestle.core.models.interfaces ¤

Interfaces for use within other trestle functions defined as pydantic data models.

Classes¤

OSCALAssembly ¤

Bases: TrestleBaseModel

Data model to represent an assembled set of OSCAL objects.

Here the assembly represents the constraints as expected by the current OSCAL schema. At this point in time a 'flat' model has been chosen rather than an tree.

Source code in trestle/core/models/interfaces.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
class OSCALAssembly(TrestleBaseModel):
    """Data model to represent an assembled set of OSCAL objects.

    Here the assembly represents the constraints as expected by the current OSCAL
    schema. At this point in time a 'flat' model has been chosen rather than an tree.
    """

    poam: Optional[o_poam.PlanOfActionAndMilestones] = None
    sar: Optional[o_ar.AssessmentResults] = None
    sap: Optional[o_ap.AssessmentPlan] = None
    ssp: Optional[o_ssp.SystemSecurityPlan] = None
    profiles: Optional[Dict[str, o_profile.Profile]] = None
    catalogs: Optional[Dict[str, o_catalog.Catalog]] = None
    components: Optional[Dict[str, o_component.ComponentDefinition]] = None

    class Config:
        """Pydantic config overrides."""

        allow_population_by_field_name = True
        # Enforce strict schema
        extra = Extra.forbid
        # Validate on assignment of variables to ensure no escapes
        validate_assignment = True
Attributes¤
catalogs: Optional[Dict[str, o_catalog.Catalog]] = None class-attribute instance-attribute ¤
components: Optional[Dict[str, o_component.ComponentDefinition]] = None class-attribute instance-attribute ¤
poam: Optional[o_poam.PlanOfActionAndMilestones] = None class-attribute instance-attribute ¤
profiles: Optional[Dict[str, o_profile.Profile]] = None class-attribute instance-attribute ¤
sap: Optional[o_ap.AssessmentPlan] = None class-attribute instance-attribute ¤
sar: Optional[o_ar.AssessmentResults] = None class-attribute instance-attribute ¤
ssp: Optional[o_ssp.SystemSecurityPlan] = None class-attribute instance-attribute ¤
Classes¤
Config ¤

Pydantic config overrides.

Source code in trestle/core/models/interfaces.py
44
45
46
47
48
49
50
51
class Config:
    """Pydantic config overrides."""

    allow_population_by_field_name = True
    # Enforce strict schema
    extra = Extra.forbid
    # Validate on assignment of variables to ensure no escapes
    validate_assignment = True
Attributes¤
allow_population_by_field_name = True class-attribute instance-attribute ¤
extra = Extra.forbid class-attribute instance-attribute ¤
validate_assignment = True class-attribute instance-attribute ¤

handler: python