Decision Point Objects
The ssvc.decision_points package provides a set of decision points for use in SSVC decision functions. Decision points are the basic building blocks of SSVC decision functions. Individual decision points describe a single aspect of the input to a decision function.
Defines the formatting for SSVC Decision Points.
DecisionPoint
Bases: _Registered
, _Valued
, _SchemaVersioned
, _GenericSsvcObject
, _Commented
, BaseModel
Models a single decision point as a list of values.
Decision points should have the following attributes:
- name (str): The name of the decision point
- description (str): A description of the decision point
- version (str): A semantic version string for the decision point
- namespace (str): The namespace (a short, unique string): For example, "ssvc" or "cvss" to indicate the source of the decision point
- key (str): A key (a short, unique string within the namespace) that can be used to identify the decision point in a shorthand way
- values (tuple): A tuple of DecisionPointValue objects
Source code in src/ssvc/decision_points/base.py
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 99 100 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 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|
str
property
Return the DecisionPoint represented as a short string.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A string representation of the DecisionPoint, in the format "namespace |
value_dict
property
Return a list of value IDs for the DecisionPoint.
Returns:
Name | Type | Description |
---|---|---|
list |
dict[str, DecisionPointValue]
|
A list of strings, each representing a value ID in the format "namespace |
value_summaries
property
Return a list of value summaries.
DecisionPointValue
Bases: _Commented
, _KeyedBaseModel
, BaseModel
Models a single value option for a decision point.
Each value should have the following attributes:
- name (str): A name
- description (str): A description
- key (str): A key (a short, unique string) that can be used to identify the value in a shorthand way
- _comment (str): An optional comment that will be included in the object.
Source code in src/ssvc/decision_points/base.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
Provides helper functions for working with SSVC decision points.
dp_diff(dp1, dp2)
Compares two decision points and returns a list of differences.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dp1
|
DecisionPoint
|
the first decision point to compare |
required |
dp2
|
DecisionPoint
|
the second decision point to compare |
required |
Returns:
Type | Description |
---|---|
list[str]
|
A list of differences between the two decision points |
Source code in src/ssvc/decision_points/helpers.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 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 99 100 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 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
|
print_versions_and_diffs(versions)
Prints the json representation of each version and then shows the diffs between each version.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
versions
|
Sequence[DecisionPoint]
|
a list of decision point versions |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/ssvc/decision_points/helpers.py
244 245 246 247 248 249 250 251 252 253 254 255 256 |
|