From e929099863a30f09efe4042a7552a7168732420d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Linn=C3=A9r?= Date: Wed, 14 Aug 2024 08:16:12 +0200 Subject: [PATCH] Add Integrity protection for Persistent Logs (#401) --- definition_loader.py | 6 +- .../EiffelActivityFinishedEvent/4.1.0.yml | 160 ++++++++++ .../EiffelArtifactCreatedEvent/4.0.1.yml | 227 +++++++++++++ .../1.0.0.yml | 46 +++ .../EiffelPersistentLogsProperty/1.0.0.yml | 49 +++ .../EiffelTestCaseFinishedEvent/4.1.0.yml | 200 ++++++++++++ .../EiffelTestSuiteFinishedEvent/4.1.0.yml | 163 ++++++++++ .../EiffelActivityFinishedEvent.md | 21 +- .../EiffelArtifactCreatedEvent.md | 3 +- .../EiffelTestCaseFinishedEvent.md | 21 +- .../EiffelTestSuiteFinishedEvent.md | 21 +- requirements.txt | 2 +- .../EiffelActivityFinishedEvent/4.1.0.json | 273 ++++++++++++++++ schemas/EiffelArtifactCreatedEvent/4.0.1.json | 267 ++++++++++++++++ .../EiffelTestCaseFinishedEvent/4.1.0.json | 299 ++++++++++++++++++ .../EiffelTestSuiteFinishedEvent/4.1.0.json | 275 ++++++++++++++++ 16 files changed, 2025 insertions(+), 8 deletions(-) create mode 100644 definitions/EiffelActivityFinishedEvent/4.1.0.yml create mode 100644 definitions/EiffelArtifactCreatedEvent/4.0.1.yml create mode 100644 definitions/EiffelIntegrityProtectionProperty/1.0.0.yml create mode 100644 definitions/EiffelPersistentLogsProperty/1.0.0.yml create mode 100644 definitions/EiffelTestCaseFinishedEvent/4.1.0.yml create mode 100644 definitions/EiffelTestSuiteFinishedEvent/4.1.0.yml create mode 100644 schemas/EiffelActivityFinishedEvent/4.1.0.json create mode 100644 schemas/EiffelArtifactCreatedEvent/4.0.1.json create mode 100644 schemas/EiffelTestCaseFinishedEvent/4.1.0.json create mode 100644 schemas/EiffelTestSuiteFinishedEvent/4.1.0.json diff --git a/definition_loader.py b/definition_loader.py index 33362954..e24a2481 100644 --- a/definition_loader.py +++ b/definition_loader.py @@ -21,7 +21,7 @@ from urllib.parse import urlparse from urllib.request import url2pathname -from jsonref import JsonRef +import jsonref from ruamel import yaml @@ -30,7 +30,7 @@ def load(input_path: Path) -> Dict: all references resolved. """ with input_path.open() as input_file: - return JsonRef.replace_refs( + return jsonref.replace_refs( yaml.YAML().load(input_file), base_uri=input_path.resolve().as_uri(), loader=_yaml_loader, @@ -42,7 +42,7 @@ def _yaml_loader(uri: str) -> Dict: input_path = Path(url2pathname(parsed_uri.path)) with input_path.open() as input_file: # Maybe JsonRef fixes recursion on its own? - schema = JsonRef.replace_refs( + schema = jsonref.replace_refs( yaml.YAML().load(input_file), base_uri=input_path.resolve().as_uri(), loader=_yaml_loader, diff --git a/definitions/EiffelActivityFinishedEvent/4.1.0.yml b/definitions/EiffelActivityFinishedEvent/4.1.0.yml new file mode 100644 index 00000000..e91ae9b2 --- /dev/null +++ b/definitions/EiffelActivityFinishedEvent/4.1.0.yml @@ -0,0 +1,160 @@ +# Copyright 2017-2024 Ericsson AB and others. +# For a full list of individual contributors, please see the commit history. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- +$schema: https://json-schema.org/draft/2020-12/schema# +_name: EiffelActivityFinishedEvent +_version: 4.1.0 +_abbrev: ActF +_description: The EiffelActivityFinishedEvent declares that a previously + started activity (declared by [EiffelActivityTriggeredEvent](./EiffelActivityTriggeredEvent.md) + followed by [EiffelActivityStartedEvent](./EiffelActivityStartedEvent.md)) + has finished. +type: object +properties: + meta: + $ref: ../EiffelMetaProperty/4.0.0.yml + data: + type: object + properties: + outcome: + _description: The outcome of the activity. + type: object + properties: + conclusion: + _description: |- + A terse standardized conclusion of the activity, designed to be machine readable. + SUCCESSFUL signifies that the activity was concluded and the outcome matched expectations. + UNSUCCESSFUL signifies that the activity was concluded, but the outcome did not match expectations. To exemplify, a compilation job was successfully invoked, but compilation failed. + FAILED signifies that the activity could not be successfully executed. To exemplify, a compilation could not be invoked, e.g. due to misconfiguration or environment issues. + ABORTED signifies that the activity was aborted before it could be concluded. + TIMED_OUT signifies that the activity did not conclude within the allowed time frame. + INCONCLUSIVE signifies that the outcome of the activity could not be determined. + type: string + enum: + - SUCCESSFUL + - UNSUCCESSFUL + - FAILED + - ABORTED + - TIMED_OUT + - INCONCLUSIVE + description: + _description: A verbose description of the activity outcome, + designed to provide human readers with further information. + type: string + required: + - conclusion + persistentLogs: + $ref: ../EiffelPersistentLogsProperty/1.0.0.yml + customData: + type: array + items: + $ref: ../EiffelCustomDataProperty/2.0.0.yml + additionalProperties: false + required: + - outcome + links: + type: array + contains: + type: object + properties: + type: + enum: + - ACTIVITY_EXECUTION + items: + $ref: ../EiffelEventLink/2.0.0.yml +required: + - meta + - data + - links +additionalProperties: false +_links: + ACTIVITY_EXECUTION: + description: Declares the activity execution that was finished. + In other words, [EiffelActivityTriggeredEvent](../eiffel-vocabulary/EiffelActivityTriggeredEvent.md) + acts as a handle for the activity execution. This differs from + __CONTEXT__. In __ACTIVITY_EXECUTION__ the source carries information + pertaining to the target (i.e. the activity started, finished + or was canceled). In __CONTEXT__, on the other hand, the source + constitutes a subset of the target (e.g. this test case was executed + as part of that activity or test suite). + required: true + multiple: false + targets: + any_type: false + types: + - EiffelActivityTriggeredEvent + CAUSE: + description: 'Identifies a cause of the event occurring. SHOULD + not be used in conjunction with __CONTEXT__: individual events + providing __CAUSE__ within a larger context gives rise to ambiguity. + It is instead recommended to let the root event of the context + declare __CAUSE__.' + required: false + multiple: true + targets: + any_type: true + types: [] + CONTEXT: + description: Identifies the activity or test suite of which this + event constitutes a part. + required: false + multiple: false + targets: + any_type: false + types: + - EiffelActivityTriggeredEvent + - EiffelTestSuiteStartedEvent + FLOW_CONTEXT: + description: 'Identifies the flow context of the event: which is + the continuous integration and delivery flow in which this occurred + – e.g. which product, project, track or version this is applicable + to.' + required: false + multiple: true + targets: + any_type: false + types: + - EiffelFlowContextDefinedEvent +_history: + - version: 4.1.0 + changes: Add `data.persistentLogs.integrityProtection.{alg, digest}` (see [Issue 358](https://github.com/eiffel-community/eiffel/issues/358)). + - version: 4.0.0 + changes: Update meta schema to Draft 2020-12 and add link validation. + - version: 3.3.0 + introduced_in: edition-arica + changes: Add schema URL to the meta object (see [Issue 280](https://github.com/eiffel-community/eiffel/issues/280)). + - version: 3.2.0 + introduced_in: edition-lyon + changes: Add links.domainId member (see [Issue 233](https://github.com/eiffel-community/eiffel/issues/233)). + - version: 3.1.0 + introduced_in: edition-lyon + changes: Add `data.persistentLogs.{mediaType,tags}`. + - version: 3.0.0 + introduced_in: edition-agen + changes: Improved information integrity protection (see [Issue + 185](https://github.com/eiffel-community/eiffel/issues/185)). + - version: 2.0.0 + introduced_in: edition-agen + changes: Introduced purl identifiers instead of GAVs (see [Issue + 182](https://github.com/eiffel-community/eiffel/issues/182)) + - version: 1.1.0 + introduced_in: edition-toulouse + changes: Multiple links of type FLOW_CONTEXT allowed. + - version: 1.0.0 + introduced_in: edition-bordeaux + changes: Initial version. +_examples: + - title: Simple example + url: ../examples/events/EiffelActivityFinishedEvent/simple.json diff --git a/definitions/EiffelArtifactCreatedEvent/4.0.1.yml b/definitions/EiffelArtifactCreatedEvent/4.0.1.yml new file mode 100644 index 00000000..285e07c2 --- /dev/null +++ b/definitions/EiffelArtifactCreatedEvent/4.0.1.yml @@ -0,0 +1,227 @@ +# Copyright 2017-2024 Ericsson AB and others. +# For a full list of individual contributors, please see the commit history. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- +$schema: https://json-schema.org/draft/2020-12/schema# +_name: EiffelArtifactCreatedEvent +_version: 4.0.1 +_abbrev: ArtC +_description: The EiffelArtifactCreatedEvent declares that a software + artifact has been created, what its coordinates are, what it contains + and how it was created. +type: object +properties: + meta: + $ref: ../EiffelMetaProperty/4.0.0.yml + data: + type: object + properties: + identity: + _description: The identity of the created artifact, in [purl + format](https://github.com/package-url/purl-spec). + _format: '[purl specification](https://github.com/package-url/purl-spec)' + type: string + pattern: '^pkg:' + fileInformation: + _description: A list of the artifact file contents. This information + is optional and, when included, MAY include a complete or + incomplete list of contents. In other words, it may be used + to highlight only particular files of interest, such as launcher + binaries or other entry-points. + type: array + items: + type: object + properties: + name: + _description: The name (including relative path from + the root of the artifact) on syntax appropriate for + the artifact packaging type. + type: string + tags: + _description: Any tags associated with the file, to support + navigation and identification of items of interest. + type: array + items: + type: string + integrityProtection: + $ref: ../EiffelIntegrityProtectionProperty/1.0.0.yml + required: + - name + additionalProperties: false + buildCommand: + _description: The command used to build the artifact within + the identified environment. Used for reproducability purposes. + type: string + requiresImplementation: + _description: |- + Defines whether this artifact requires an implementing artifact. This is typically used for interfaces requiring some backend implementation, although the interface does not presume to define _which_ implementation. Implicitly interpreted as "ANY" if undefined. + NONE signifies that there SHALL no implementations of this artifact. In other words, a composition containing another artifact identifying it in __data.implements__ would be illegal. + ANY signifies that there may or may not be implementations of this artifact. + EXACTLY_ONE signifies that a legal composition must contain one and only one implementation of this artifact. + AT_LEAST_ONE signifies that a legal composition must contain one or more implementations of this artifact. + type: string + enum: + - NONE + - ANY + - EXACTLY_ONE + - AT_LEAST_ONE + dependsOn: + _description: An array of [purl identified](https://github.com/package-url/purl-spec) + entities this artifact depends on. While not included in + the purl specification itself, the Eiffel protocol allows + version range notation according to [Maven syntax](https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm#MAVEN402) + to be used for the version component of the package identity. + Note that the purl specification always requires the version + component to be percent-encoded. + _format: '[purl specification](https://github.com/package-url/purl-spec)' + type: array + items: + type: string + pattern: '^pkg:' + implements: + _description: An array of [purl identified](https://github.com/package-url/purl-spec) + entities this artifact implements. The typical use case of + this is to identify interfaces implemented by this artifact. + While not included in the purl specification itself, the + Eiffel protocol allows version range notation according to + [Maven syntax](https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm#MAVEN402) + to be used for the version component of the package identity. + Note that the purl specification always requires the version + component to be percent-encoded. + _format: '[purl specification](https://github.com/package-url/purl-spec)' + type: array + items: + type: string + pattern: '^pkg:' + name: + _description: Any (colloquial) name of the artifact. Unlike + __data.identity__, this is not intended as an unambiguous + identifier of the artifact, but as a descriptive and human + readable name. + type: string + customData: + type: array + items: + $ref: ../EiffelCustomDataProperty/2.0.0.yml + required: + - identity + additionalProperties: false + links: + type: array + items: + $ref: ../EiffelEventLink/2.0.0.yml +required: + - meta + - data + - links +additionalProperties: false +_links: + CAUSE: + description: 'Identifies a cause of the event occurring. SHOULD + not be used in conjunction with __CONTEXT__: individual events + providing __CAUSE__ within a larger context gives rise to ambiguity. + It is instead recommended to let the root event of the context + declare __CAUSE__.' + required: false + multiple: true + targets: + any_type: true + types: [] + COMPOSITION: + description: Identifies the composition from which this artifact + was built. + required: false + multiple: false + targets: + any_type: false + types: + - EiffelCompositionDefinedEvent + CONTEXT: + description: Identifies the activity or test suite of which this + event constitutes a part. + required: false + multiple: false + targets: + any_type: false + types: + - EiffelActivityTriggeredEvent + - EiffelTestSuiteStartedEvent + ENVIRONMENT: + description: Identifies the environment in which this artifact + was built. + required: false + multiple: false + targets: + any_type: false + types: + - EiffelEnvironmentDefinedEvent + FLOW_CONTEXT: + description: 'Identifies the flow context of the event: which is + the continuous integration and delivery flow in which this occurred + – e.g. which product, project, track or version this is applicable + to.' + required: false + multiple: true + targets: + any_type: false + types: + - EiffelFlowContextDefinedEvent + PREVIOUS_VERSION: + description: Identifies a latest previous version (there may be + more than one in case of merges) of the artifact the event represents. + required: false + multiple: true + targets: + any_type: false + types: + - EiffelArtifactCreatedEvent +_history: + - version: 4.0.1 + changes: Use common fragment for Integrity Protection. + - version: 4.0.0 + changes: Update meta schema to Draft 2020-12 and add link validation. + - version: 3.3.0 + introduced_in: edition-arica + changes: Added data.fileInformation.integrityProtection member (see [Issue 290](https://github.com/eiffel-community/eiffel/issues/290)). + - version: 3.2.0 + introduced_in: edition-arica + changes: Add schema URL to the meta object (see [Issue 280](https://github.com/eiffel-community/eiffel/issues/280)). + - version: 3.1.0 + introduced_in: edition-lyon + changes: Add links.domainId member (see [Issue 233](https://github.com/eiffel-community/eiffel/issues/233)). + - version: 3.0.0 + introduced_in: edition-agen + changes: Improved information integrity protection (see [Issue + 185](https://github.com/eiffel-community/eiffel/issues/185)). + - version: 2.0.0 + introduced_in: edition-agen + changes: Introduced purl identifiers instead of GAVs (see [Issue + 182](https://github.com/eiffel-community/eiffel/issues/182)) + - version: 1.1.0 + introduced_in: edition-toulouse + changes: Multiple links of type FLOW_CONTEXT allowed. + - version: 1.0.0 + introduced_in: edition-bordeaux + changes: Initial version. +_examples: + - title: Simple example + url: ../examples/events/EiffelArtifactCreatedEvent/simple.json + - title: Interface example + url: ../examples/events/EiffelArtifactCreatedEvent/interface.json + - title: Backend example + url: ../examples/events/EiffelArtifactCreatedEvent/backend.json + - title: Dependent example + url: ../examples/events/EiffelArtifactCreatedEvent/dependent.json + - title: Checksum example + url: ../examples/events/EiffelArtifactCreatedEvent/checksum.json diff --git a/definitions/EiffelIntegrityProtectionProperty/1.0.0.yml b/definitions/EiffelIntegrityProtectionProperty/1.0.0.yml new file mode 100644 index 00000000..f6bffd9c --- /dev/null +++ b/definitions/EiffelIntegrityProtectionProperty/1.0.0.yml @@ -0,0 +1,46 @@ +# Copyright 2024 Ericsson AB. +# For a full list of individual contributors, please see the commit history. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- +$schema: https://json-schema.org/draft/draft-2020-12/schema# +_name: EiffelIntegrityProtectionProperty +_version: 1.0.0 +_description: An optional object containing a digest of + the file's contents, i.e. a checksum, computed using + the specified algorithm. +type: object +properties: + alg: + _description: The cryptographic algorithm used to compute + the digest of the file's contents. + _format: One of the hash algorithms listed in section 1 of + [NIST FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf), + excluding "SHA-1". + type: string + enum: + - SHA-224 + - SHA-256 + - SHA-384 + - SHA-512 + - SHA-512/224 + - SHA-512/256 + digest: + _description: The digest of the file contents. + _format: A lowercase string of hexadecimal digits. + type: string + pattern: ^[0-9a-f]+$ +required: + - alg + - digest +additionalProperties: false diff --git a/definitions/EiffelPersistentLogsProperty/1.0.0.yml b/definitions/EiffelPersistentLogsProperty/1.0.0.yml new file mode 100644 index 00000000..d149b46e --- /dev/null +++ b/definitions/EiffelPersistentLogsProperty/1.0.0.yml @@ -0,0 +1,49 @@ +# Copyright 2024 Ericsson AB. +# For a full list of individual contributors, please see the commit history. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- +$schema: https://json-schema.org/draft/draft-2020-12/schema# +_name: EiffelPersistentLogsProperty +_version: 1.0.0 +_description: An array of persistent log files generated during + execution. +type: array +items: + type: object + properties: + mediaType: + _description: The [media type](https://en.wikipedia.org/wiki/Media_type) + of the URI's payload. Can be used to differentiate + between various representations of the same log, e.g. + text/html for human consumption and text/plain or application/json + for the machine-readable form. + type: string + name: + _description: The name of the log file. + type: string + tags: + _description: Arbitrary tags and keywords that describe + this log. + type: array + items: + type: string + uri: + _description: The URI at which the log can be retrieved. + type: string + integrityProtection: + $ref: ../EiffelIntegrityProtectionProperty/1.0.0.yml + required: + - name + - uri + additionalProperties: false diff --git a/definitions/EiffelTestCaseFinishedEvent/4.1.0.yml b/definitions/EiffelTestCaseFinishedEvent/4.1.0.yml new file mode 100644 index 00000000..31acbf6c --- /dev/null +++ b/definitions/EiffelTestCaseFinishedEvent/4.1.0.yml @@ -0,0 +1,200 @@ +# Copyright 2017-2024 Ericsson AB and others. +# For a full list of individual contributors, please see the commit history. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- +$schema: https://json-schema.org/draft/2020-12/schema# +_name: EiffelTestCaseFinishedEvent +_version: 4.1.0 +_abbrev: TCF +_description: |- + The EiffelTestCaseFinishedEvent declares that a previously started test case (declared by [EiffelTestCaseStartedEvent](./EiffelTestCaseStartedEvent.md)) has finished and reports the outcome. + + Note that while similar, the __data.outcome__ object is different from that of [EiffelActivityFinishedEvent](./EiffelActivityFinishedEvent.md). The outcome of the test case reports not only the conclusion of the test case execution - whether the test case was successfully executed - but also passes a verdict on the implementation under test. To highlight this conceptual difference, both __data.outcome.verdict__ and __data.outcome.conclusion__ are included. + + Also note that unlike [EiffelTestSuiteFinishedEvent](./EiffelTestSuiteFinishedEvent.md), EiffelTestCaseFinishedEvent must report both __data.outcome.verdict__ and __data.outcome.conclusion__. +type: object +properties: + meta: + $ref: ../EiffelMetaProperty/4.0.0.yml + data: + type: object + properties: + outcome: + _description: The outcome of the test case. + type: object + properties: + verdict: + _description: |- + A terse standardized verdict on the item or items under test. + PASSED signifies that the item or items under test successfully passed the test case. + FAILED signifies that the item or items under test failed to pass the test case. + INCONCLUSIVE signifies that the verdict of the test case was inconclusive. This SHOULD be the case if __data.outcome.conclusion__ is not __SUCCESSFUL__, but may in combination with a __SUCCESSFUL__ conclusion be used to represent unreliability or flakiness. + type: string + enum: + - PASSED + - FAILED + - INCONCLUSIVE + conclusion: + _description: |- + A terse standardized conclusion of the test case, designed to be machine readable. + SUCCESSFUL signifies that the test case was successfully concluded. Note that this does not imply that the implementation under test passed the tests. + FAILED signifies that the test case could not be successfully executed. To exemplify, one or more tests failed to run due to required environments being unavailable. + ABORTED signifies that the test case was aborted before it could be concluded. + TIMED_OUT signifies that the test case did not conclude within the allowed time frame. + INCONCLUSIVE signifies that the outcome of the test case could not be determined. + type: string + enum: + - SUCCESSFUL + - FAILED + - ABORTED + - TIMED_OUT + - INCONCLUSIVE + description: + _description: A verbose description of the test case outcome, + designed to provide human readers with further information. + type: string + metrics: + _description: A list of metrics collected during the test + case execution. Note that while complete freedom is allowed + in metrics names and value types, it is highly recommended + to keep reported metrics concise and consistent. In other + words, do not include excessive amounts of data (use + __data.persistentLogs__ for that), and avoid unnecessary + variations in value names or types over time. + type: array + items: + type: object + properties: + name: + _description: The metrics name. + type: string + value: + _description: The metrics value. + required: + - name + - value + additionalProperties: false + required: + - verdict + - conclusion + additionalProperties: false + persistentLogs: + $ref: ../EiffelPersistentLogsProperty/1.0.0.yml + customData: + type: array + items: + $ref: ../EiffelCustomDataProperty/2.0.0.yml + required: + - outcome + additionalProperties: false + links: + type: array + contains: + type: object + properties: + type: + enum: + - TEST_CASE_EXECUTION + items: + $ref: ../EiffelEventLink/2.0.0.yml +required: + - meta + - data + - links +additionalProperties: false +_links: + CAUSE: + description: 'Identifies a cause of the event occurring. SHOULD + not be used in conjunction with __CONTEXT__: individual events + providing __CAUSE__ within a larger context gives rise to ambiguity. + It is instead recommended to let the root event of the context + declare __CAUSE__.' + required: false + multiple: true + targets: + any_type: true + types: [] + CONTEXT: + description: Identifies the activity or test suite of which this + event constitutes a part. + required: false + multiple: false + targets: + any_type: false + types: + - EiffelActivityTriggeredEvent + - EiffelTestSuiteStartedEvent + FLOW_CONTEXT: + description: 'Identifies the flow context of the event: which is + the continuous integration and delivery flow in which this occurred + – e.g. which product, project, track or version this is applicable + to.' + required: false + multiple: true + targets: + any_type: false + types: + - EiffelFlowContextDefinedEvent + TEST_CASE_EXECUTION: + description: Identifies the relevant test case execution. In other + words, [EiffelTestCaseTriggeredEvent](../eiffel-vocabulary/EiffelTestCaseTriggeredEvent.md) + acts as a handle for a particular test case execution. This differs + from __CONTEXT__. In __TEST_CASE_EXECUTION__ the source carries + information pertaining to the target (i.e. the test case execution + started, finished or was canceled). In __CONTEXT__, on the other + hand, the source constitutes a subset of the target (e.g. this + test case was executed as part of that activity or test suite). + required: true + multiple: false + targets: + any_type: false + types: + - EiffelTestCaseTriggeredEvent +_history: + - version: 4.1.0 + changes: Add `data.persistentLogs.integrityProtection.{alg, digest}` (see [Issue 358](https://github.com/eiffel-community/eiffel/issues/358)). + - version: 4.0.0 + changes: Update meta schema to Draft 2020-12 and add link validation. + - version: 3.3.1 + changes: Change IUT to Implementation Under Test (see [Issue 235](https://github.com/eiffel-community/eiffel/issues/359)). + - version: 3.3.0 + introduced_in: edition-arica + changes: Add schema URL to the meta object (see [Issue 280](https://github.com/eiffel-community/eiffel/issues/280)). + - version: 3.2.0 + introduced_in: edition-lyon + changes: Add links.domainId member (see [Issue 233](https://github.com/eiffel-community/eiffel/issues/233)). + - version: 3.1.0 + introduced_in: edition-lyon + changes: Add `data.persistentLogs.{mediaType,tags}`. + - version: 3.0.0 + introduced_in: edition-agen + changes: Improved information integrity protection (see [Issue + 185](https://github.com/eiffel-community/eiffel/issues/185)). + - version: 2.0.0 + introduced_in: edition-agen + changes: Introduced purl identifiers instead of GAVs (see [Issue + 182](https://github.com/eiffel-community/eiffel/issues/182)) + - version: 1.1.0 + introduced_in: edition-toulouse + changes: Multiple links of type FLOW_CONTEXT allowed. + - version: 1.0.1 + introduced_in: edition-toulouse + changes: data.outcome.metrics.value and data.outcome.metrics.name + made mandatory. + - version: 1.0.0 + introduced_in: edition-bordeaux + changes: Initial version. +_examples: + - title: Simple example + url: ../examples/events/EiffelTestCaseFinishedEvent/simple.json diff --git a/definitions/EiffelTestSuiteFinishedEvent/4.1.0.yml b/definitions/EiffelTestSuiteFinishedEvent/4.1.0.yml new file mode 100644 index 00000000..c6e3030f --- /dev/null +++ b/definitions/EiffelTestSuiteFinishedEvent/4.1.0.yml @@ -0,0 +1,163 @@ +# Copyright 2017-2024 Ericsson AB and others. +# For a full list of individual contributors, please see the commit history. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- +$schema: https://json-schema.org/draft/2020-12/schema# +_name: EiffelTestSuiteFinishedEvent +_version: 4.1.0 +_abbrev: TSF +_description: |- + The EiffelTestSuiteFinishedEvent declares that a previously started test suite (declared by [EiffelTestSuiteStartedEvent](./EiffelTestSuiteStartedEvent.md)) has finished and reports the outcome. + + Note that while similar, the __data.outcome__ object is different from that of [EiffelActivityFinishedEvent](./EiffelActivityFinishedEvent.md). The outcome of the test suite reports not only the conclusion of the test suite execution - whether the tests were successfully executed - but also passes a verdict on the item or items under test. To highlight this conceptual difference, both __data.outcome.verdict__ and __data.outcome.conclusion__ are included. +type: object +properties: + meta: + $ref: ../EiffelMetaProperty/4.0.0.yml + data: + type: object + properties: + outcome: + _description: The outcome of the test suite. + type: object + properties: + verdict: + _description: |- + A terse standardized verdict on the item or items under test. Unlike in [EiffelTestCaseFinishedEvent](./EiffelTestCaseFinishedEvent.md), this property is optional. It offers a method of summarizing the verdict of the test suite as a whole, but may be skipped. + PASSED signifies that the item or items under test successfully passed the test suite. + FAILED signifies that the item or items under test failed to pass the test suite. + INCONCLUSIVE signifies that the verdict of the test suite was inconclusive. This SHOULD be the case if __data.outcome.conclusion__ is not __SUCCESSFUL__, but may in combination with a __SUCCESSFUL__ conclusion be used to represent unreliability or flakiness. + type: string + enum: + - PASSED + - FAILED + - INCONCLUSIVE + conclusion: + _description: |- + A terse standardized conclusion of the test suite, designed to be machine readable. Unlike in [EiffelTestCaseFinishedEvent](./EiffelTestCaseFinishedEvent.md), this property is optional. It offers a method of summarizing the conclusion of the test suite as a whole, but may be skipped. + SUCCESSFUL signifies that the test suite was successfully concluded. Note that this does not imply that the implementation under test passed the tests. + FAILED signifies that the test suite could not be successfully executed. To exemplify, one or more tests failed to run due to required environments being unavailable. + ABORTED signifies that the test suite was aborted before it could be concluded. + TIMED_OUT signifies that the test suite did not conclude within the allowed time frame. + INCONCLUSIVE signifies that the outcome of the test suite could not be determined. + type: string + enum: + - SUCCESSFUL + - FAILED + - ABORTED + - TIMED_OUT + - INCONCLUSIVE + description: + _description: A verbose description of the test suite outcome, + designed to provide human readers with further information. + type: string + additionalProperties: false + persistentLogs: + $ref: ../EiffelPersistentLogsProperty/1.0.0.yml + customData: + type: array + items: + $ref: ../EiffelCustomDataProperty/2.0.0.yml + additionalProperties: false + links: + type: array + contains: + type: object + properties: + type: + enum: + - TEST_SUITE_EXECUTION + items: + $ref: ../EiffelEventLink/2.0.0.yml +required: + - meta + - data + - links +additionalProperties: false +_links: + CAUSE: + description: 'Identifies a cause of the event occurring. SHOULD + not be used in conjunction with __CONTEXT__: individual events + providing __CAUSE__ within a larger context gives rise to ambiguity. + It is instead recommended to let the root event of the context + declare __CAUSE__.' + required: false + multiple: true + targets: + any_type: true + types: [] + CONTEXT: + description: Identifies the activity or test suite of which this + event constitutes a part. + required: false + multiple: false + targets: + any_type: false + types: + - EiffelActivityTriggeredEvent + - EiffelTestSuiteStartedEvent + FLOW_CONTEXT: + description: 'Identifies the flow context of the event: which is + the continuous integration and delivery flow in which this occurred + – e.g. which product, project, track or version this is applicable + to.' + required: false + multiple: true + targets: + any_type: false + types: + - EiffelFlowContextDefinedEvent + TEST_SUITE_EXECUTION: + description: Identifies the relevant test suite execution. In other + words, [EiffelTestSuiteStartedEvent](../eiffel-vocabulary/EiffelTestSuiteStartedEvent.md) + acts as a handle for a particular test suite execution. + required: true + multiple: false + targets: + any_type: false + types: + - EiffelTestSuiteStartedEvent +_history: + - version: 4.1.0 + changes: Add `data.persistentLogs.integrityProtection.{alg, digest}` (see [Issue 358](https://github.com/eiffel-community/eiffel/issues/358)). + - version: 4.0.0 + changes: Update meta schema to Draft 2020-12 and add link validation. + - version: 3.3.1 + changes: Change IUT to Implementation Under Test (see [Issue 235](https://github.com/eiffel-community/eiffel/issues/359)). + - version: 3.3.0 + introduced_in: edition-arica + changes: Add schema URL to the meta object (see [Issue 280](https://github.com/eiffel-community/eiffel/issues/280)). + - version: 3.2.0 + introduced_in: edition-lyon + changes: Add links.domainId member (see [Issue 233](https://github.com/eiffel-community/eiffel/issues/233)). + - version: 3.1.0 + introduced_in: edition-lyon + changes: Add `data.persistentLogs.{mediaType,tags}`. + - version: 3.0.0 + introduced_in: edition-agen + changes: Improved information integrity protection (see [Issue + 185](https://github.com/eiffel-community/eiffel/issues/185)). + - version: 2.0.0 + introduced_in: edition-agen + changes: Introduced purl identifiers instead of GAVs (see [Issue + 182](https://github.com/eiffel-community/eiffel/issues/182)) + - version: 1.1.0 + introduced_in: edition-toulouse + changes: Multiple links of type FLOW_CONTEXT allowed. + - version: 1.0.0 + introduced_in: edition-bordeaux + changes: Initial version. +_examples: + - title: Simple example + url: ../examples/events/EiffelTestSuiteFinishedEvent/simple.json diff --git a/eiffel-vocabulary/EiffelActivityFinishedEvent.md b/eiffel-vocabulary/EiffelActivityFinishedEvent.md index ba8811fa..b074fee4 100644 --- a/eiffel-vocabulary/EiffelActivityFinishedEvent.md +++ b/eiffel-vocabulary/EiffelActivityFinishedEvent.md @@ -1,5 +1,5 @@ @@ -56,6 +56,24 @@ __Type:__ String __Required:__ Yes __Description:__ The URI at which the log can be retrieved. +#### data.persistentLogs.integrityProtection +__Type:__ Object +__Required:__ No +__Description:__ An optional object containing a digest of the file's contents, i.e. a checksum, computed using the specified algorithm. + +##### data.persistentLogs.integrityProtection.alg +__Type:__ String +__Format:__ One of the hash algorithms listed in section 1 of [NIST FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf), excluding "SHA-1". +__Required:__ Yes +__Legal values:__ SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, SHA-512/256 +__Description:__ The cryptographic algorithm used to compute the digest of the file's contents. + +##### data.persistentLogs.integrityProtection.digest +__Type:__ String +__Format:__ A lowercase string of hexadecimal digits. +__Required:__ Yes +__Description:__ The digest of the file contents. + ## Links This section describes which link types are valid for this event type. For details on how to express the link objects themselves see [The Links Object](../eiffel-syntax-and-usage/the-links-object.md). @@ -219,6 +237,7 @@ __Description:__ A URI pointing at a location from where the schema used when cr | Version | Introduced in | Changes | | ------- | ------------- | ------- | +| 4.1.0 | Not yet released in an edition | Add `data.persistentLogs.integrityProtection.{alg, digest}` (see [Issue 358](https://github.com/eiffel-community/eiffel/issues/358)). | | 4.0.0 | Not yet released in an edition | Update meta schema to Draft 2020-12 and add link validation. | | 3.3.0 | [edition-arica](../../../tree/edition-arica) | Add schema URL to the meta object (see [Issue 280](https://github.com/eiffel-community/eiffel/issues/280)). | | 3.2.0 | [edition-lyon](../../../tree/edition-lyon) | Add links.domainId member (see [Issue 233](https://github.com/eiffel-community/eiffel/issues/233)). | diff --git a/eiffel-vocabulary/EiffelArtifactCreatedEvent.md b/eiffel-vocabulary/EiffelArtifactCreatedEvent.md index 272e96d9..ace8dae5 100644 --- a/eiffel-vocabulary/EiffelArtifactCreatedEvent.md +++ b/eiffel-vocabulary/EiffelArtifactCreatedEvent.md @@ -1,5 +1,5 @@ @@ -255,6 +255,7 @@ __Description:__ A URI pointing at a location from where the schema used when cr | Version | Introduced in | Changes | | ------- | ------------- | ------- | +| 4.0.1 | Not yet released in an edition | Use common fragment for Integrity Protection. | | 4.0.0 | Not yet released in an edition | Update meta schema to Draft 2020-12 and add link validation. | | 3.3.0 | [edition-arica](../../../tree/edition-arica) | Added data.fileInformation.integrityProtection member (see [Issue 290](https://github.com/eiffel-community/eiffel/issues/290)). | | 3.2.0 | [edition-arica](../../../tree/edition-arica) | Add schema URL to the meta object (see [Issue 280](https://github.com/eiffel-community/eiffel/issues/280)). | diff --git a/eiffel-vocabulary/EiffelTestCaseFinishedEvent.md b/eiffel-vocabulary/EiffelTestCaseFinishedEvent.md index 4cb79f3a..95964db4 100644 --- a/eiffel-vocabulary/EiffelTestCaseFinishedEvent.md +++ b/eiffel-vocabulary/EiffelTestCaseFinishedEvent.md @@ -1,5 +1,5 @@ @@ -83,6 +83,24 @@ __Type:__ String __Required:__ Yes __Description:__ The URI at which the log can be retrieved. +#### data.persistentLogs.integrityProtection +__Type:__ Object +__Required:__ No +__Description:__ An optional object containing a digest of the file's contents, i.e. a checksum, computed using the specified algorithm. + +##### data.persistentLogs.integrityProtection.alg +__Type:__ String +__Format:__ One of the hash algorithms listed in section 1 of [NIST FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf), excluding "SHA-1". +__Required:__ Yes +__Legal values:__ SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, SHA-512/256 +__Description:__ The cryptographic algorithm used to compute the digest of the file's contents. + +##### data.persistentLogs.integrityProtection.digest +__Type:__ String +__Format:__ A lowercase string of hexadecimal digits. +__Required:__ Yes +__Description:__ The digest of the file contents. + ## Links This section describes which link types are valid for this event type. For details on how to express the link objects themselves see [The Links Object](../eiffel-syntax-and-usage/the-links-object.md). @@ -246,6 +264,7 @@ __Description:__ A URI pointing at a location from where the schema used when cr | Version | Introduced in | Changes | | ------- | ------------- | ------- | +| 4.1.0 | Not yet released in an edition | Add `data.persistentLogs.integrityProtection.{alg, digest}` (see [Issue 358](https://github.com/eiffel-community/eiffel/issues/358)). | | 4.0.0 | Not yet released in an edition | Update meta schema to Draft 2020-12 and add link validation. | | 3.3.1 | Not yet released in an edition | Change IUT to Implementation Under Test (see [Issue 235](https://github.com/eiffel-community/eiffel/issues/359)). | | 3.3.0 | [edition-arica](../../../tree/edition-arica) | Add schema URL to the meta object (see [Issue 280](https://github.com/eiffel-community/eiffel/issues/280)). | diff --git a/eiffel-vocabulary/EiffelTestSuiteFinishedEvent.md b/eiffel-vocabulary/EiffelTestSuiteFinishedEvent.md index 541ef178..9eba2834 100644 --- a/eiffel-vocabulary/EiffelTestSuiteFinishedEvent.md +++ b/eiffel-vocabulary/EiffelTestSuiteFinishedEvent.md @@ -1,5 +1,5 @@ @@ -66,6 +66,24 @@ __Type:__ String __Required:__ Yes __Description:__ The URI at which the log can be retrieved. +#### data.persistentLogs.integrityProtection +__Type:__ Object +__Required:__ No +__Description:__ An optional object containing a digest of the file's contents, i.e. a checksum, computed using the specified algorithm. + +##### data.persistentLogs.integrityProtection.alg +__Type:__ String +__Format:__ One of the hash algorithms listed in section 1 of [NIST FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf), excluding "SHA-1". +__Required:__ Yes +__Legal values:__ SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, SHA-512/256 +__Description:__ The cryptographic algorithm used to compute the digest of the file's contents. + +##### data.persistentLogs.integrityProtection.digest +__Type:__ String +__Format:__ A lowercase string of hexadecimal digits. +__Required:__ Yes +__Description:__ The digest of the file contents. + ## Links This section describes which link types are valid for this event type. For details on how to express the link objects themselves see [The Links Object](../eiffel-syntax-and-usage/the-links-object.md). @@ -229,6 +247,7 @@ __Description:__ A URI pointing at a location from where the schema used when cr | Version | Introduced in | Changes | | ------- | ------------- | ------- | +| 4.1.0 | Not yet released in an edition | Add `data.persistentLogs.integrityProtection.{alg, digest}` (see [Issue 358](https://github.com/eiffel-community/eiffel/issues/358)). | | 4.0.0 | Not yet released in an edition | Update meta schema to Draft 2020-12 and add link validation. | | 3.3.1 | Not yet released in an edition | Change IUT to Implementation Under Test (see [Issue 235](https://github.com/eiffel-community/eiffel/issues/359)). | | 3.3.0 | [edition-arica](../../../tree/edition-arica) | Add schema URL to the meta object (see [Issue 280](https://github.com/eiffel-community/eiffel/issues/280)). | diff --git a/requirements.txt b/requirements.txt index 5974c46e..6e919959 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ Jinja2==3.1.4 -jsonref==0.2 +jsonref==1.1.0 jsonschema ruamel.yaml==0.17.21 semver diff --git a/schemas/EiffelActivityFinishedEvent/4.1.0.json b/schemas/EiffelActivityFinishedEvent/4.1.0.json new file mode 100644 index 00000000..87f724fd --- /dev/null +++ b/schemas/EiffelActivityFinishedEvent/4.1.0.json @@ -0,0 +1,273 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema#", + "type": "object", + "properties": { + "meta": { + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" + }, + "type": { + "type": "string", + "enum": [ + "EiffelActivityFinishedEvent" + ] + }, + "version": { + "type": "string", + "enum": [ + "4.1.0" + ], + "default": "4.1.0" + }, + "time": { + "type": "integer" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "source": { + "type": "object", + "properties": { + "domainId": { + "type": "string" + }, + "host": { + "type": "string" + }, + "name": { + "type": "string" + }, + "serializer": { + "type": "string", + "pattern": "^pkg:" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false + }, + "security": { + "type": "object", + "properties": { + "authorIdentity": { + "type": "string" + }, + "integrityProtection": { + "type": "object", + "properties": { + "signature": { + "type": "string" + }, + "alg": { + "type": "string", + "enum": [ + "HS256", + "HS384", + "HS512", + "RS256", + "RS384", + "RS512", + "ES256", + "ES384", + "ES512", + "PS256", + "PS384", + "PS512" + ] + }, + "publicKey": { + "type": "string" + } + }, + "required": [ + "signature", + "alg" + ], + "additionalProperties": false + }, + "sequenceProtection": { + "type": "array", + "items": { + "type": "object", + "properties": { + "sequenceName": { + "type": "string" + }, + "position": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "sequenceName", + "position" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "authorIdentity" + ] + }, + "schemaUri": { + "type": "string" + } + }, + "required": [ + "id", + "type", + "version", + "time" + ], + "additionalProperties": false + }, + "data": { + "type": "object", + "properties": { + "outcome": { + "type": "object", + "properties": { + "conclusion": { + "type": "string", + "enum": [ + "SUCCESSFUL", + "UNSUCCESSFUL", + "FAILED", + "ABORTED", + "TIMED_OUT", + "INCONCLUSIVE" + ] + }, + "description": { + "type": "string" + } + }, + "required": [ + "conclusion" + ] + }, + "persistentLogs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "mediaType": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "uri": { + "type": "string" + }, + "integrityProtection": { + "type": "object", + "properties": { + "alg": { + "type": "string", + "enum": [ + "SHA-224", + "SHA-256", + "SHA-384", + "SHA-512", + "SHA-512/224", + "SHA-512/256" + ] + }, + "digest": { + "type": "string", + "pattern": "^[0-9a-f]+$" + } + }, + "required": [ + "alg", + "digest" + ], + "additionalProperties": false + } + }, + "required": [ + "name", + "uri" + ], + "additionalProperties": false + } + }, + "customData": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": {} + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + } + } + }, + "additionalProperties": false, + "required": [ + "outcome" + ] + }, + "links": { + "type": "array", + "contains": { + "type": "object", + "properties": { + "type": { + "enum": [ + "ACTIVITY_EXECUTION" + ] + } + } + }, + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "target": { + "type": "string", + "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" + }, + "domainId": { + "type": "string" + } + }, + "required": [ + "type", + "target" + ], + "additionalProperties": false + } + } + }, + "required": [ + "meta", + "data", + "links" + ], + "additionalProperties": false +} diff --git a/schemas/EiffelArtifactCreatedEvent/4.0.1.json b/schemas/EiffelArtifactCreatedEvent/4.0.1.json new file mode 100644 index 00000000..28ef2c60 --- /dev/null +++ b/schemas/EiffelArtifactCreatedEvent/4.0.1.json @@ -0,0 +1,267 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema#", + "type": "object", + "properties": { + "meta": { + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" + }, + "type": { + "type": "string", + "enum": [ + "EiffelArtifactCreatedEvent" + ] + }, + "version": { + "type": "string", + "enum": [ + "4.0.1" + ], + "default": "4.0.1" + }, + "time": { + "type": "integer" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "source": { + "type": "object", + "properties": { + "domainId": { + "type": "string" + }, + "host": { + "type": "string" + }, + "name": { + "type": "string" + }, + "serializer": { + "type": "string", + "pattern": "^pkg:" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false + }, + "security": { + "type": "object", + "properties": { + "authorIdentity": { + "type": "string" + }, + "integrityProtection": { + "type": "object", + "properties": { + "signature": { + "type": "string" + }, + "alg": { + "type": "string", + "enum": [ + "HS256", + "HS384", + "HS512", + "RS256", + "RS384", + "RS512", + "ES256", + "ES384", + "ES512", + "PS256", + "PS384", + "PS512" + ] + }, + "publicKey": { + "type": "string" + } + }, + "required": [ + "signature", + "alg" + ], + "additionalProperties": false + }, + "sequenceProtection": { + "type": "array", + "items": { + "type": "object", + "properties": { + "sequenceName": { + "type": "string" + }, + "position": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "sequenceName", + "position" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "authorIdentity" + ] + }, + "schemaUri": { + "type": "string" + } + }, + "required": [ + "id", + "type", + "version", + "time" + ], + "additionalProperties": false + }, + "data": { + "type": "object", + "properties": { + "identity": { + "type": "string", + "pattern": "^pkg:" + }, + "fileInformation": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "integrityProtection": { + "type": "object", + "properties": { + "alg": { + "type": "string", + "enum": [ + "SHA-224", + "SHA-256", + "SHA-384", + "SHA-512", + "SHA-512/224", + "SHA-512/256" + ] + }, + "digest": { + "type": "string", + "pattern": "^[0-9a-f]+$" + } + }, + "required": [ + "alg", + "digest" + ], + "additionalProperties": false + } + }, + "required": [ + "name" + ], + "additionalProperties": false + } + }, + "buildCommand": { + "type": "string" + }, + "requiresImplementation": { + "type": "string", + "enum": [ + "NONE", + "ANY", + "EXACTLY_ONE", + "AT_LEAST_ONE" + ] + }, + "dependsOn": { + "type": "array", + "items": { + "type": "string", + "pattern": "^pkg:" + } + }, + "implements": { + "type": "array", + "items": { + "type": "string", + "pattern": "^pkg:" + } + }, + "name": { + "type": "string" + }, + "customData": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": {} + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + } + } + }, + "required": [ + "identity" + ], + "additionalProperties": false + }, + "links": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "target": { + "type": "string", + "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" + }, + "domainId": { + "type": "string" + } + }, + "required": [ + "type", + "target" + ], + "additionalProperties": false + } + } + }, + "required": [ + "meta", + "data", + "links" + ], + "additionalProperties": false +} diff --git a/schemas/EiffelTestCaseFinishedEvent/4.1.0.json b/schemas/EiffelTestCaseFinishedEvent/4.1.0.json new file mode 100644 index 00000000..75656bbd --- /dev/null +++ b/schemas/EiffelTestCaseFinishedEvent/4.1.0.json @@ -0,0 +1,299 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema#", + "type": "object", + "properties": { + "meta": { + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" + }, + "type": { + "type": "string", + "enum": [ + "EiffelTestCaseFinishedEvent" + ] + }, + "version": { + "type": "string", + "enum": [ + "4.1.0" + ], + "default": "4.1.0" + }, + "time": { + "type": "integer" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "source": { + "type": "object", + "properties": { + "domainId": { + "type": "string" + }, + "host": { + "type": "string" + }, + "name": { + "type": "string" + }, + "serializer": { + "type": "string", + "pattern": "^pkg:" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false + }, + "security": { + "type": "object", + "properties": { + "authorIdentity": { + "type": "string" + }, + "integrityProtection": { + "type": "object", + "properties": { + "signature": { + "type": "string" + }, + "alg": { + "type": "string", + "enum": [ + "HS256", + "HS384", + "HS512", + "RS256", + "RS384", + "RS512", + "ES256", + "ES384", + "ES512", + "PS256", + "PS384", + "PS512" + ] + }, + "publicKey": { + "type": "string" + } + }, + "required": [ + "signature", + "alg" + ], + "additionalProperties": false + }, + "sequenceProtection": { + "type": "array", + "items": { + "type": "object", + "properties": { + "sequenceName": { + "type": "string" + }, + "position": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "sequenceName", + "position" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "authorIdentity" + ] + }, + "schemaUri": { + "type": "string" + } + }, + "required": [ + "id", + "type", + "version", + "time" + ], + "additionalProperties": false + }, + "data": { + "type": "object", + "properties": { + "outcome": { + "type": "object", + "properties": { + "verdict": { + "type": "string", + "enum": [ + "PASSED", + "FAILED", + "INCONCLUSIVE" + ] + }, + "conclusion": { + "type": "string", + "enum": [ + "SUCCESSFUL", + "FAILED", + "ABORTED", + "TIMED_OUT", + "INCONCLUSIVE" + ] + }, + "description": { + "type": "string" + }, + "metrics": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": {} + }, + "required": [ + "name", + "value" + ], + "additionalProperties": false + } + } + }, + "required": [ + "verdict", + "conclusion" + ], + "additionalProperties": false + }, + "persistentLogs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "mediaType": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "uri": { + "type": "string" + }, + "integrityProtection": { + "type": "object", + "properties": { + "alg": { + "type": "string", + "enum": [ + "SHA-224", + "SHA-256", + "SHA-384", + "SHA-512", + "SHA-512/224", + "SHA-512/256" + ] + }, + "digest": { + "type": "string", + "pattern": "^[0-9a-f]+$" + } + }, + "required": [ + "alg", + "digest" + ], + "additionalProperties": false + } + }, + "required": [ + "name", + "uri" + ], + "additionalProperties": false + } + }, + "customData": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": {} + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + } + } + }, + "required": [ + "outcome" + ], + "additionalProperties": false + }, + "links": { + "type": "array", + "contains": { + "type": "object", + "properties": { + "type": { + "enum": [ + "TEST_CASE_EXECUTION" + ] + } + } + }, + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "target": { + "type": "string", + "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" + }, + "domainId": { + "type": "string" + } + }, + "required": [ + "type", + "target" + ], + "additionalProperties": false + } + } + }, + "required": [ + "meta", + "data", + "links" + ], + "additionalProperties": false +} diff --git a/schemas/EiffelTestSuiteFinishedEvent/4.1.0.json b/schemas/EiffelTestSuiteFinishedEvent/4.1.0.json new file mode 100644 index 00000000..f26b5906 --- /dev/null +++ b/schemas/EiffelTestSuiteFinishedEvent/4.1.0.json @@ -0,0 +1,275 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema#", + "type": "object", + "properties": { + "meta": { + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" + }, + "type": { + "type": "string", + "enum": [ + "EiffelTestSuiteFinishedEvent" + ] + }, + "version": { + "type": "string", + "enum": [ + "4.1.0" + ], + "default": "4.1.0" + }, + "time": { + "type": "integer" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "source": { + "type": "object", + "properties": { + "domainId": { + "type": "string" + }, + "host": { + "type": "string" + }, + "name": { + "type": "string" + }, + "serializer": { + "type": "string", + "pattern": "^pkg:" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false + }, + "security": { + "type": "object", + "properties": { + "authorIdentity": { + "type": "string" + }, + "integrityProtection": { + "type": "object", + "properties": { + "signature": { + "type": "string" + }, + "alg": { + "type": "string", + "enum": [ + "HS256", + "HS384", + "HS512", + "RS256", + "RS384", + "RS512", + "ES256", + "ES384", + "ES512", + "PS256", + "PS384", + "PS512" + ] + }, + "publicKey": { + "type": "string" + } + }, + "required": [ + "signature", + "alg" + ], + "additionalProperties": false + }, + "sequenceProtection": { + "type": "array", + "items": { + "type": "object", + "properties": { + "sequenceName": { + "type": "string" + }, + "position": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "sequenceName", + "position" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "authorIdentity" + ] + }, + "schemaUri": { + "type": "string" + } + }, + "required": [ + "id", + "type", + "version", + "time" + ], + "additionalProperties": false + }, + "data": { + "type": "object", + "properties": { + "outcome": { + "type": "object", + "properties": { + "verdict": { + "type": "string", + "enum": [ + "PASSED", + "FAILED", + "INCONCLUSIVE" + ] + }, + "conclusion": { + "type": "string", + "enum": [ + "SUCCESSFUL", + "FAILED", + "ABORTED", + "TIMED_OUT", + "INCONCLUSIVE" + ] + }, + "description": { + "type": "string" + } + }, + "additionalProperties": false + }, + "persistentLogs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "mediaType": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "uri": { + "type": "string" + }, + "integrityProtection": { + "type": "object", + "properties": { + "alg": { + "type": "string", + "enum": [ + "SHA-224", + "SHA-256", + "SHA-384", + "SHA-512", + "SHA-512/224", + "SHA-512/256" + ] + }, + "digest": { + "type": "string", + "pattern": "^[0-9a-f]+$" + } + }, + "required": [ + "alg", + "digest" + ], + "additionalProperties": false + } + }, + "required": [ + "name", + "uri" + ], + "additionalProperties": false + } + }, + "customData": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": {} + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + } + } + }, + "additionalProperties": false + }, + "links": { + "type": "array", + "contains": { + "type": "object", + "properties": { + "type": { + "enum": [ + "TEST_SUITE_EXECUTION" + ] + } + } + }, + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "target": { + "type": "string", + "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" + }, + "domainId": { + "type": "string" + } + }, + "required": [ + "type", + "target" + ], + "additionalProperties": false + } + } + }, + "required": [ + "meta", + "data", + "links" + ], + "additionalProperties": false +}