-
-
Notifications
You must be signed in to change notification settings - Fork 65
[WIP] tests: check all enum completeness #992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
500f3cf
06f34c5
5efa460
8ddc37f
1dfe71f
20509fe
44a98ef
ec38b2e
f4ae307
4868e2d
b29e49c
4ff6db8
a3f5eea
9129d38
1860d13
e70a29f
d27a097
fef2e7c
0c54bb4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,6 +59,8 @@ class CryptoAssetType(str, Enum): | |
|
|
||
| @serializable.serializable_enum | ||
| class CryptoPrimitive(str, Enum): | ||
| # TODO: rename to `CryptoAlgorithmPrimitive` | ||
|
|
||
| """ | ||
| This is our internal representation of the cryptoPropertiesType.algorithmProperties.primitive ENUM type within the | ||
| CycloneDX standard. | ||
|
|
@@ -83,13 +85,16 @@ class CryptoPrimitive(str, Enum): | |
| SIGNATURE = 'signature' | ||
| STREAM_CIPHER = 'stream-cipher' | ||
| XOF = 'xof' | ||
| # TODO: add `key-wrap` - since CDX1.7key-wrap | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❗ TODO |
||
|
|
||
| OTHER = 'other' | ||
| UNKNOWN = 'unknown' | ||
|
|
||
|
|
||
| @serializable.serializable_enum | ||
| class CryptoExecutionEnvironment(str, Enum): | ||
| # TODO: rename to `CryptoAlgorithmExecutionEnvironment` | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❗ TODO |
||
|
|
||
| """ | ||
| This is our internal representation of the cryptoPropertiesType.algorithmProperties.executionEnvironment ENUM type | ||
| within the CycloneDX standard. | ||
|
|
@@ -112,6 +117,8 @@ class CryptoExecutionEnvironment(str, Enum): | |
|
|
||
| @serializable.serializable_enum | ||
| class CryptoImplementationPlatform(str, Enum): | ||
| # TODO: rename to `CryptoAlgorithmImplementationPlatform` | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❗ TODO |
||
|
|
||
| """ | ||
| This is our internal representation of the cryptoPropertiesType.algorithmProperties.implementationPlatform ENUM type | ||
| within the CycloneDX standard. | ||
|
|
@@ -129,7 +136,7 @@ class CryptoImplementationPlatform(str, Enum): | |
| ARMV8_M = 'armv8-m' | ||
| ARMV9_A = 'armv9-a' | ||
| ARMV9_M = 'armv9-m' | ||
| GENERIC = 'generic' | ||
| GENERIC = 'generic' # TODO: move down | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❗ TODO |
||
| PPC64 = 'ppc64' | ||
| PPC64LE = 'ppc64le' | ||
| S390X = 's390x' | ||
|
|
@@ -142,6 +149,8 @@ class CryptoImplementationPlatform(str, Enum): | |
|
|
||
| @serializable.serializable_enum | ||
| class CryptoCertificationLevel(str, Enum): | ||
| # TODO: move to `CryptoAlgorithmCertificationLevel` | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❗ TODO |
||
|
|
||
| """ | ||
| This is our internal representation of the cryptoPropertiesType.algorithmProperties.certificationLevel ENUM type | ||
| within the CycloneDX standard. | ||
|
|
@@ -188,6 +197,8 @@ class CryptoCertificationLevel(str, Enum): | |
|
|
||
| @serializable.serializable_enum | ||
| class CryptoMode(str, Enum): | ||
| # TODO: rename to `CryptoAlgorithmMode` | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❗ TODO |
||
|
|
||
| """ | ||
| This is our internal representation of the cryptoPropertiesType.algorithmProperties.mode ENUM type | ||
| within the CycloneDX standard. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,7 @@ | |
| OWN_DATA_DIRECTORY = path.join(_TESTDATA_DIRECTORY, 'own') | ||
| SNAPSHOTS_DIRECTORY = path.join(_TESTDATA_DIRECTORY, 'snapshots') | ||
|
|
||
| RECREATE_SNAPSHOTS = '1' == getenv('CDX_TEST_RECREATE_SNAPSHOTS') | ||
| RECREATE_SNAPSHOTS = True or '1' == getenv('CDX_TEST_RECREATE_SNAPSHOTS') | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❗ revert |
||
| if RECREATE_SNAPSHOTS: | ||
| print('!!! WILL RECREATE ALL SNAPSHOTS !!!') | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| <?xml version="1.0" ?> | ||
| <bom xmlns="http://cyclonedx.org/schema/bom/1.0" version="1"> | ||
| <components> | ||
| <component type="library"> | ||
| <name>dummy</name> | ||
| <version/> | ||
| <modified>false</modified> | ||
| </component> | ||
| </components> | ||
| </bom> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <?xml version="1.0" ?> | ||
| <bom xmlns="http://cyclonedx.org/schema/bom/1.1" serialNumber="urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac" version="1"> | ||
| <components> | ||
| <component type="library" bom-ref="dummy"> | ||
| <name>dummy</name> | ||
| <version/> | ||
| </component> | ||
| </components> | ||
| </bom> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "components": [ | ||
| { | ||
| "bom-ref": "dummy", | ||
| "name": "dummy", | ||
| "type": "library", | ||
| "version": "" | ||
| } | ||
| ], | ||
| "dependencies": [ | ||
| { | ||
| "ref": "dummy" | ||
| } | ||
| ], | ||
| "metadata": { | ||
| "timestamp": "2023-01-07T13:44:32.312678+00:00" | ||
| }, | ||
| "serialNumber": "urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac", | ||
| "version": 1, | ||
| "$schema": "http://cyclonedx.org/schema/bom-1.2b.schema.json", | ||
| "bomFormat": "CycloneDX", | ||
| "specVersion": "1.2" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <?xml version="1.0" ?> | ||
| <bom xmlns="http://cyclonedx.org/schema/bom/1.2" serialNumber="urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac" version="1"> | ||
| <metadata> | ||
| <timestamp>2023-01-07T13:44:32.312678+00:00</timestamp> | ||
| </metadata> | ||
| <components> | ||
| <component type="library" bom-ref="dummy"> | ||
| <name>dummy</name> | ||
| <version/> | ||
| </component> | ||
| </components> | ||
| <dependencies> | ||
| <dependency ref="dummy"/> | ||
| </dependencies> | ||
| </bom> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "components": [ | ||
| { | ||
| "bom-ref": "dummy", | ||
| "evidence": {}, | ||
| "name": "dummy", | ||
| "type": "library", | ||
| "version": "" | ||
| } | ||
| ], | ||
| "dependencies": [ | ||
| { | ||
| "ref": "dummy" | ||
| } | ||
| ], | ||
| "metadata": { | ||
| "timestamp": "2023-01-07T13:44:32.312678+00:00" | ||
| }, | ||
| "serialNumber": "urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac", | ||
| "version": 1, | ||
| "$schema": "http://cyclonedx.org/schema/bom-1.3a.schema.json", | ||
| "bomFormat": "CycloneDX", | ||
| "specVersion": "1.3" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <?xml version="1.0" ?> | ||
| <bom xmlns="http://cyclonedx.org/schema/bom/1.3" serialNumber="urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac" version="1"> | ||
| <metadata> | ||
| <timestamp>2023-01-07T13:44:32.312678+00:00</timestamp> | ||
| </metadata> | ||
| <components> | ||
| <component type="library" bom-ref="dummy"> | ||
| <name>dummy</name> | ||
| <version/> | ||
| <evidence/> | ||
| </component> | ||
| </components> | ||
| <dependencies> | ||
| <dependency ref="dummy"/> | ||
| </dependencies> | ||
| </bom> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "components": [ | ||
| { | ||
| "bom-ref": "dummy", | ||
| "evidence": {}, | ||
| "name": "dummy", | ||
| "type": "library" | ||
| } | ||
| ], | ||
| "dependencies": [ | ||
| { | ||
| "ref": "dummy" | ||
| } | ||
| ], | ||
| "metadata": { | ||
| "timestamp": "2023-01-07T13:44:32.312678+00:00" | ||
| }, | ||
| "serialNumber": "urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac", | ||
| "version": 1, | ||
| "$schema": "http://cyclonedx.org/schema/bom-1.4.schema.json", | ||
| "bomFormat": "CycloneDX", | ||
| "specVersion": "1.4" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <?xml version="1.0" ?> | ||
| <bom xmlns="http://cyclonedx.org/schema/bom/1.4" serialNumber="urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac" version="1"> | ||
| <metadata> | ||
| <timestamp>2023-01-07T13:44:32.312678+00:00</timestamp> | ||
| </metadata> | ||
| <components> | ||
| <component type="library" bom-ref="dummy"> | ||
| <name>dummy</name> | ||
| <evidence/> | ||
| </component> | ||
| </components> | ||
| <dependencies> | ||
| <dependency ref="dummy"/> | ||
| </dependencies> | ||
| </bom> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| { | ||
| "components": [ | ||
| { | ||
| "bom-ref": "dummy", | ||
| "evidence": { | ||
| "identity": { | ||
| "field": "name", | ||
| "methods": [ | ||
| { | ||
| "confidence": 1.0, | ||
| "technique": "ast-fingerprint", | ||
| "value": "AnalysisTechnique: AST_FINGERPRINT" | ||
| }, | ||
| { | ||
| "confidence": 1.0, | ||
| "technique": "attestation", | ||
| "value": "AnalysisTechnique: ATTESTATION" | ||
| }, | ||
| { | ||
| "confidence": 1.0, | ||
| "technique": "binary-analysis", | ||
| "value": "AnalysisTechnique: BINARY_ANALYSIS" | ||
| }, | ||
| { | ||
| "confidence": 1.0, | ||
| "technique": "dynamic-analysis", | ||
| "value": "AnalysisTechnique: DYNAMIC_ANALYSIS" | ||
| }, | ||
| { | ||
| "confidence": 1.0, | ||
| "technique": "filename", | ||
| "value": "AnalysisTechnique: FILENAME" | ||
| }, | ||
| { | ||
| "confidence": 1.0, | ||
| "technique": "hash-comparison", | ||
| "value": "AnalysisTechnique: HASH_COMPARISON" | ||
| }, | ||
| { | ||
| "confidence": 1.0, | ||
| "technique": "instrumentation", | ||
| "value": "AnalysisTechnique: INSTRUMENTATION" | ||
| }, | ||
| { | ||
| "confidence": 1.0, | ||
| "technique": "manifest-analysis", | ||
| "value": "AnalysisTechnique: MANIFEST_ANALYSIS" | ||
| }, | ||
| { | ||
| "confidence": 1.0, | ||
| "technique": "other", | ||
| "value": "AnalysisTechnique: OTHER" | ||
| }, | ||
| { | ||
| "confidence": 1.0, | ||
| "technique": "source-code-analysis", | ||
| "value": "AnalysisTechnique: SOURCE_CODE_ANALYSIS" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "name": "dummy", | ||
| "type": "library" | ||
| } | ||
| ], | ||
| "dependencies": [ | ||
| { | ||
| "ref": "dummy" | ||
| } | ||
| ], | ||
| "metadata": { | ||
| "timestamp": "2023-01-07T13:44:32.312678+00:00" | ||
| }, | ||
| "properties": [ | ||
| { | ||
| "name": "key1", | ||
| "value": "val1" | ||
| }, | ||
| { | ||
| "name": "key2", | ||
| "value": "val2" | ||
| } | ||
| ], | ||
| "serialNumber": "urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac", | ||
| "version": 1, | ||
| "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json", | ||
| "bomFormat": "CycloneDX", | ||
| "specVersion": "1.5" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| <?xml version="1.0" ?> | ||
| <bom xmlns="http://cyclonedx.org/schema/bom/1.5" serialNumber="urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac" version="1"> | ||
| <metadata> | ||
| <timestamp>2023-01-07T13:44:32.312678+00:00</timestamp> | ||
| </metadata> | ||
| <components> | ||
| <component type="library" bom-ref="dummy"> | ||
| <name>dummy</name> | ||
| <evidence> | ||
| <identity> | ||
| <field>name</field> | ||
| <methods> | ||
| <method> | ||
| <technique>ast-fingerprint</technique> | ||
| <confidence>1</confidence> | ||
| <value>AnalysisTechnique: AST_FINGERPRINT</value> | ||
| </method> | ||
| <method> | ||
| <technique>attestation</technique> | ||
| <confidence>1</confidence> | ||
| <value>AnalysisTechnique: ATTESTATION</value> | ||
| </method> | ||
| <method> | ||
| <technique>binary-analysis</technique> | ||
| <confidence>1</confidence> | ||
| <value>AnalysisTechnique: BINARY_ANALYSIS</value> | ||
| </method> | ||
| <method> | ||
| <technique>dynamic-analysis</technique> | ||
| <confidence>1</confidence> | ||
| <value>AnalysisTechnique: DYNAMIC_ANALYSIS</value> | ||
| </method> | ||
| <method> | ||
| <technique>filename</technique> | ||
| <confidence>1</confidence> | ||
| <value>AnalysisTechnique: FILENAME</value> | ||
| </method> | ||
| <method> | ||
| <technique>hash-comparison</technique> | ||
| <confidence>1</confidence> | ||
| <value>AnalysisTechnique: HASH_COMPARISON</value> | ||
| </method> | ||
| <method> | ||
| <technique>instrumentation</technique> | ||
| <confidence>1</confidence> | ||
| <value>AnalysisTechnique: INSTRUMENTATION</value> | ||
| </method> | ||
| <method> | ||
| <technique>manifest-analysis</technique> | ||
| <confidence>1</confidence> | ||
| <value>AnalysisTechnique: MANIFEST_ANALYSIS</value> | ||
| </method> | ||
| <method> | ||
| <technique>other</technique> | ||
| <confidence>1</confidence> | ||
| <value>AnalysisTechnique: OTHER</value> | ||
| </method> | ||
| <method> | ||
| <technique>source-code-analysis</technique> | ||
| <confidence>1</confidence> | ||
| <value>AnalysisTechnique: SOURCE_CODE_ANALYSIS</value> | ||
| </method> | ||
| </methods> | ||
| </identity> | ||
| </evidence> | ||
| </component> | ||
| </components> | ||
| <dependencies> | ||
| <dependency ref="dummy"/> | ||
| </dependencies> | ||
| <properties> | ||
| <property name="key1">val1</property> | ||
| <property name="key2">val2</property> | ||
| </properties> | ||
| </bom> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❗ TODO