Skip to content

trestle.oscal.catalog

trestle.oscal.catalog ¤

Attributes¤

Classes¤

Catalog ¤

Bases: OscalBaseModel


              flowchart TD
              trestle.oscal.catalog.Catalog[Catalog]
              trestle.core.base_model.OscalBaseModel[OscalBaseModel]
              trestle.core.trestle_base_model.TrestleBaseModel[TrestleBaseModel]

                              trestle.core.base_model.OscalBaseModel --> trestle.oscal.catalog.Catalog
                                trestle.core.trestle_base_model.TrestleBaseModel --> trestle.core.base_model.OscalBaseModel
                



              click trestle.oscal.catalog.Catalog href "" "trestle.oscal.catalog.Catalog"
              click trestle.core.base_model.OscalBaseModel href "" "trestle.core.base_model.OscalBaseModel"
              click trestle.core.trestle_base_model.TrestleBaseModel href "" "trestle.core.trestle_base_model.TrestleBaseModel"
            

A structured, organized collection of control information.

Source code in trestle/oscal/catalog.py
142
143
144
145
146
147
148
149
150
151
152
153
154
155
class Catalog(OscalBaseModel):
    """
    A structured, organized collection of control information.
    """

    class Config:
        extra = Extra.forbid

    uuid: constr(regex=r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[45][0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$') = Field(..., description='Provides a globally unique means to identify a given catalog instance.', title='Catalog Universally Unique Identifier')
    metadata: common.Metadata
    params: list[common.Parameter] | None = Field(None)
    controls: list[Control] | None = Field(None)
    groups: list[Group1|Group2] | None = Field(None)
    back_matter: common.BackMatter | None = Field(None, alias='back-matter')
Attributes¤
back_matter = Field(None, alias='back-matter') class-attribute instance-attribute ¤
controls = Field(None) class-attribute instance-attribute ¤
groups = Field(None) class-attribute instance-attribute ¤
metadata instance-attribute ¤
params = Field(None) class-attribute instance-attribute ¤
uuid = Field(..., description='Provides a globally unique means to identify a given catalog instance.', title='Catalog Universally Unique Identifier') class-attribute instance-attribute ¤
Classes¤
Config ¤
Source code in trestle/oscal/catalog.py
147
148
class Config:
    extra = Extra.forbid
Attributes¤
extra = Extra.forbid class-attribute instance-attribute ¤

Control ¤

Bases: OscalBaseModel


              flowchart TD
              trestle.oscal.catalog.Control[Control]
              trestle.core.base_model.OscalBaseModel[OscalBaseModel]
              trestle.core.trestle_base_model.TrestleBaseModel[TrestleBaseModel]

                              trestle.core.base_model.OscalBaseModel --> trestle.oscal.catalog.Control
                                trestle.core.trestle_base_model.TrestleBaseModel --> trestle.core.base_model.OscalBaseModel
                



              click trestle.oscal.catalog.Control href "" "trestle.oscal.catalog.Control"
              click trestle.core.base_model.OscalBaseModel href "" "trestle.core.base_model.OscalBaseModel"
              click trestle.core.trestle_base_model.TrestleBaseModel href "" "trestle.core.trestle_base_model.TrestleBaseModel"
            

A structured object representing a requirement or guideline, which when implemented will reduce an aspect of risk related to an information system and its information.

Source code in trestle/oscal/catalog.py
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
class Control(OscalBaseModel):
    """
    A structured object representing a requirement or guideline, which when implemented will reduce an aspect of risk related to an information system and its information.
    """

    class Config:
        extra = Extra.forbid

    id: constr(regex=r'^[_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-\.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$') = Field(..., description='Identifies a control such that it can be referenced in the defining catalog and other OSCAL instances (e.g., profiles).', title='Control Identifier')
    class_: constr(regex=r'^[_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-\.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$') | None = Field(None, alias='class', description='A textual label that provides a sub-type or characterization of the control.', title='Control Class')
    title: constr(regex=r'^[^\n]+$') = Field(..., description='A name given to the control, which may be used by a tool for display and navigation.', title='Control Title')
    params: list[common.Parameter] | None = Field(None)
    props: list[common.Property] | None = Field(None)
    links: list[common.Link] | None = Field(None)
    parts: list[common.Part] | None = Field(None)
    controls: list[Control] | None = None
Attributes¤
class_ = Field(None, alias='class', description='A textual label that provides a sub-type or characterization of the control.', title='Control Class') class-attribute instance-attribute ¤
controls = None class-attribute instance-attribute ¤
id = Field(..., description='Identifies a control such that it can be referenced in the defining catalog and other OSCAL instances (e.g., profiles).', title='Control Identifier') class-attribute instance-attribute ¤
params = Field(None) class-attribute instance-attribute ¤
parts = Field(None) class-attribute instance-attribute ¤
props = Field(None) class-attribute instance-attribute ¤
title = Field(..., description='A name given to the control, which may be used by a tool for display and navigation.', title='Control Title') class-attribute instance-attribute ¤
Classes¤
Config ¤
Source code in trestle/oscal/catalog.py
47
48
class Config:
    extra = Extra.forbid
Attributes¤
extra = Extra.forbid class-attribute instance-attribute ¤

Group1 ¤

Bases: OscalBaseModel


              flowchart TD
              trestle.oscal.catalog.Group1[Group1]
              trestle.core.base_model.OscalBaseModel[OscalBaseModel]
              trestle.core.trestle_base_model.TrestleBaseModel[TrestleBaseModel]

                              trestle.core.base_model.OscalBaseModel --> trestle.oscal.catalog.Group1
                                trestle.core.trestle_base_model.TrestleBaseModel --> trestle.core.base_model.OscalBaseModel
                



              click trestle.oscal.catalog.Group1 href "" "trestle.oscal.catalog.Group1"
              click trestle.core.base_model.OscalBaseModel href "" "trestle.core.base_model.OscalBaseModel"
              click trestle.core.trestle_base_model.TrestleBaseModel href "" "trestle.core.trestle_base_model.TrestleBaseModel"
            

A group of controls, or of groups of controls.

Source code in trestle/oscal/catalog.py
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
class Group1(OscalBaseModel):
    """
    A group of controls, or of groups of controls.
    """

    class Config:
        extra = Extra.forbid

    id: constr(regex=r'^[_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-\.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$') | None = Field(None, description='Identifies the group for the purpose of cross-linking within the defining instance or from other instances that reference the catalog.', title='Group Identifier')
    class_: constr(regex=r'^[_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-\.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$') | None = Field(None, alias='class', description='A textual label that provides a sub-type or characterization of the group.', title='Group Class')
    title: constr(regex=r'^[^\n]+$') = Field(..., description='A name given to the group, which may be used by a tool for display and navigation.', title='Group Title')
    params: list[common.Parameter] | None = Field(None)
    props: list[common.Property] | None = Field(None)
    links: list[common.Link] | None = Field(None)
    parts: list[common.Part] | None = Field(None)
    groups: list[Group1|Group2] | None = Field(None)



    @classmethod
    def __get_validators__(cls):
        yield cls._smart_union_validator

    @classmethod
    def _smart_union_validator(cls, v):
        """Smart validator that chooses Group1 if data has groups, otherwise tries Group2."""
        if isinstance(v, dict):
            # If dict has 'groups' field, use Group1
            if 'groups' in v:
                return cls.parse_obj(v)
            # If dict has 'controls' field, use Group2
            elif 'controls' in v:
                return Group2.parse_obj(v)
        # For non-dict or ambiguous cases, try Group1 first (this class)
        try:
            return cls.parse_obj(v) if isinstance(v, dict) else v
        except Exception:
            # If Group1 fails, try Group2
            return Group2.parse_obj(v) if isinstance(v, dict) else v
Attributes¤
class_ = Field(None, alias='class', description='A textual label that provides a sub-type or characterization of the group.', title='Group Class') class-attribute instance-attribute ¤
groups = Field(None) class-attribute instance-attribute ¤
id = Field(None, description='Identifies the group for the purpose of cross-linking within the defining instance or from other instances that reference the catalog.', title='Group Identifier') class-attribute instance-attribute ¤
params = Field(None) class-attribute instance-attribute ¤
parts = Field(None) class-attribute instance-attribute ¤
props = Field(None) class-attribute instance-attribute ¤
title = Field(..., description='A name given to the group, which may be used by a tool for display and navigation.', title='Group Title') class-attribute instance-attribute ¤
Classes¤
Config ¤
Source code in trestle/oscal/catalog.py
106
107
class Config:
    extra = Extra.forbid
Attributes¤
extra = Extra.forbid class-attribute instance-attribute ¤
Functions¤
__get_validators__() classmethod ¤
Source code in trestle/oscal/catalog.py
120
121
122
@classmethod
def __get_validators__(cls):
    yield cls._smart_union_validator

Group2 ¤

Bases: OscalBaseModel


              flowchart TD
              trestle.oscal.catalog.Group2[Group2]
              trestle.core.base_model.OscalBaseModel[OscalBaseModel]
              trestle.core.trestle_base_model.TrestleBaseModel[TrestleBaseModel]

                              trestle.core.base_model.OscalBaseModel --> trestle.oscal.catalog.Group2
                                trestle.core.trestle_base_model.TrestleBaseModel --> trestle.core.base_model.OscalBaseModel
                



              click trestle.oscal.catalog.Group2 href "" "trestle.oscal.catalog.Group2"
              click trestle.core.base_model.OscalBaseModel href "" "trestle.core.base_model.OscalBaseModel"
              click trestle.core.trestle_base_model.TrestleBaseModel href "" "trestle.core.trestle_base_model.TrestleBaseModel"
            

A group of controls, or of groups of controls.

Source code in trestle/oscal/catalog.py
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
class Group2(OscalBaseModel):
    """
    A group of controls, or of groups of controls.
    """

    class Config:
        extra = Extra.forbid

    id: constr(regex=r'^[_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-\.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$') | None = Field(None, description='Identifies the group for the purpose of cross-linking within the defining instance or from other instances that reference the catalog.', title='Group Identifier')
    class_: constr(regex=r'^[_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-\.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$') | None = Field(None, alias='class', description='A textual label that provides a sub-type or characterization of the group.', title='Group Class')
    title: constr(regex=r'^[^\n]+$') = Field(..., description='A name given to the group, which may be used by a tool for display and navigation.', title='Group Title')
    params: list[common.Parameter] | None = Field(None)
    props: list[common.Property] | None = Field(None)
    links: list[common.Link] | None = Field(None)
    parts: list[common.Part] | None = Field(None)
    controls: list[Control] | None = Field(None)



    @classmethod
    def __get_validators__(cls):
        yield cls._smart_union_validator

    @classmethod
    def _smart_union_validator(cls, v):
        """Smart validator that chooses Group2 if data has controls, otherwise tries Group1."""
        if isinstance(v, dict):
            # If dict has 'controls' field, use Group2
            if 'controls' in v:
                return cls.parse_obj(v)
            # If dict has 'groups' field, use Group1
            elif 'groups' in v:
                return Group1.parse_obj(v)
        # For non-dict or ambiguous cases, try Group2 first (this class)
        try:
            return cls.parse_obj(v) if isinstance(v, dict) else v
        except Exception:
            # If Group2 fails, try Group1
            return Group1.parse_obj(v) if isinstance(v, dict) else v
Attributes¤
class_ = Field(None, alias='class', description='A textual label that provides a sub-type or characterization of the group.', title='Group Class') class-attribute instance-attribute ¤
controls = Field(None) class-attribute instance-attribute ¤
id = Field(None, description='Identifies the group for the purpose of cross-linking within the defining instance or from other instances that reference the catalog.', title='Group Identifier') class-attribute instance-attribute ¤
params = Field(None) class-attribute instance-attribute ¤
parts = Field(None) class-attribute instance-attribute ¤
props = Field(None) class-attribute instance-attribute ¤
title = Field(..., description='A name given to the group, which may be used by a tool for display and navigation.', title='Group Title') class-attribute instance-attribute ¤
Classes¤
Config ¤
Source code in trestle/oscal/catalog.py
65
66
class Config:
    extra = Extra.forbid
Attributes¤
extra = Extra.forbid class-attribute instance-attribute ¤
Functions¤
__get_validators__() classmethod ¤
Source code in trestle/oscal/catalog.py
79
80
81
@classmethod
def __get_validators__(cls):
    yield cls._smart_union_validator

Model ¤

Bases: OscalBaseModel


              flowchart TD
              trestle.oscal.catalog.Model[Model]
              trestle.core.base_model.OscalBaseModel[OscalBaseModel]
              trestle.core.trestle_base_model.TrestleBaseModel[TrestleBaseModel]

                              trestle.core.base_model.OscalBaseModel --> trestle.oscal.catalog.Model
                                trestle.core.trestle_base_model.TrestleBaseModel --> trestle.core.base_model.OscalBaseModel
                



              click trestle.oscal.catalog.Model href "" "trestle.oscal.catalog.Model"
              click trestle.core.base_model.OscalBaseModel href "" "trestle.core.base_model.OscalBaseModel"
              click trestle.core.trestle_base_model.TrestleBaseModel href "" "trestle.core.trestle_base_model.TrestleBaseModel"
            
Source code in trestle/oscal/catalog.py
158
159
class Model(OscalBaseModel):
    catalog: Catalog
Attributes¤
catalog instance-attribute ¤

handler: python