From 1c11939885b2c83daf8f56077fb527ba5f3d41f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Linn=C3=A9r?= Date: Fri, 9 Aug 2024 16:12:17 +0200 Subject: [PATCH] Combine logs breakout and integrity protection into one version and step ArtC --- .../EiffelActivityFinishedEvent/4.0.0.yml | 30 +- .../EiffelActivityFinishedEvent/4.1.0.yml | 2 +- .../EiffelArtifactCreatedEvent/4.0.0.yml | 29 +- .../EiffelArtifactCreatedEvent/4.0.1.yml | 227 +++++++++++++++ definitions/EiffelPersistentLogs/1.0.0.yml | 3 +- definitions/EiffelPersistentLogs/1.1.0.yml | 49 ---- .../EiffelTestCaseFinishedEvent/4.0.0.yml | 30 +- .../EiffelTestCaseFinishedEvent/4.1.0.yml | 2 +- .../EiffelTestSuiteFinishedEvent/4.0.0.yml | 30 +- .../EiffelTestSuiteFinishedEvent/4.1.0.yml | 2 +- .../EiffelArtifactCreatedEvent.md | 3 +- schemas/EiffelArtifactCreatedEvent/4.0.1.json | 267 ++++++++++++++++++ 12 files changed, 616 insertions(+), 58 deletions(-) create mode 100644 definitions/EiffelArtifactCreatedEvent/4.0.1.yml delete mode 100644 definitions/EiffelPersistentLogs/1.1.0.yml create mode 100644 schemas/EiffelArtifactCreatedEvent/4.0.1.json diff --git a/definitions/EiffelActivityFinishedEvent/4.0.0.yml b/definitions/EiffelActivityFinishedEvent/4.0.0.yml index 04bf7bd7..ffcb29df 100644 --- a/definitions/EiffelActivityFinishedEvent/4.0.0.yml +++ b/definitions/EiffelActivityFinishedEvent/4.0.0.yml @@ -56,7 +56,35 @@ properties: required: - conclusion persistentLogs: - $ref: ../EiffelPersistentLogs/1.0.0.yml + _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 + required: + - name + - uri + additionalProperties: false customData: type: array items: diff --git a/definitions/EiffelActivityFinishedEvent/4.1.0.yml b/definitions/EiffelActivityFinishedEvent/4.1.0.yml index 01f6b31d..fd5014bc 100644 --- a/definitions/EiffelActivityFinishedEvent/4.1.0.yml +++ b/definitions/EiffelActivityFinishedEvent/4.1.0.yml @@ -56,7 +56,7 @@ properties: required: - conclusion persistentLogs: - $ref: ../EiffelPersistentLogs/1.1.0.yml + $ref: ../EiffelPersistentLogs/1.0.0.yml customData: type: array items: diff --git a/definitions/EiffelArtifactCreatedEvent/4.0.0.yml b/definitions/EiffelArtifactCreatedEvent/4.0.0.yml index 6451cc6b..3f046805 100644 --- a/definitions/EiffelArtifactCreatedEvent/4.0.0.yml +++ b/definitions/EiffelArtifactCreatedEvent/4.0.0.yml @@ -55,7 +55,34 @@ properties: items: type: string integrityProtection: - $ref: ../EiffelIntegrityProtection/1.0.0.yml + _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 required: - name additionalProperties: false diff --git a/definitions/EiffelArtifactCreatedEvent/4.0.1.yml b/definitions/EiffelArtifactCreatedEvent/4.0.1.yml new file mode 100644 index 00000000..eced3d8d --- /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: ../EiffelIntegrityProtection/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/EiffelPersistentLogs/1.0.0.yml b/definitions/EiffelPersistentLogs/1.0.0.yml index c5b615ff..82d0c0af 100644 --- a/definitions/EiffelPersistentLogs/1.0.0.yml +++ b/definitions/EiffelPersistentLogs/1.0.0.yml @@ -41,8 +41,9 @@ items: uri: _description: The URI at which the log can be retrieved. type: string + integrityProtection: + $ref: ../EiffelIntegrityProtection/1.0.0.yml required: - name - uri additionalProperties: false - \ No newline at end of file diff --git a/definitions/EiffelPersistentLogs/1.1.0.yml b/definitions/EiffelPersistentLogs/1.1.0.yml deleted file mode 100644 index ad45f9fe..00000000 --- a/definitions/EiffelPersistentLogs/1.1.0.yml +++ /dev/null @@ -1,49 +0,0 @@ -# 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: EiffelPersistentLogs -_version: 1.1.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: ../EiffelIntegrityProtection/1.0.0.yml - required: - - name - - uri - additionalProperties: false diff --git a/definitions/EiffelTestCaseFinishedEvent/4.0.0.yml b/definitions/EiffelTestCaseFinishedEvent/4.0.0.yml index ee777b9e..6d4717c1 100644 --- a/definitions/EiffelTestCaseFinishedEvent/4.0.0.yml +++ b/definitions/EiffelTestCaseFinishedEvent/4.0.0.yml @@ -90,7 +90,35 @@ properties: - conclusion additionalProperties: false persistentLogs: - $ref: ../EiffelPersistentLogs/1.0.0.yml + _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 + required: + - name + - uri + additionalProperties: false customData: type: array items: diff --git a/definitions/EiffelTestCaseFinishedEvent/4.1.0.yml b/definitions/EiffelTestCaseFinishedEvent/4.1.0.yml index ba3f5309..ab2d2392 100644 --- a/definitions/EiffelTestCaseFinishedEvent/4.1.0.yml +++ b/definitions/EiffelTestCaseFinishedEvent/4.1.0.yml @@ -90,7 +90,7 @@ properties: - conclusion additionalProperties: false persistentLogs: - $ref: ../EiffelPersistentLogs/1.1.0.yml + $ref: ../EiffelPersistentLogs/1.0.0.yml customData: type: array items: diff --git a/definitions/EiffelTestSuiteFinishedEvent/4.0.0.yml b/definitions/EiffelTestSuiteFinishedEvent/4.0.0.yml index 7579f141..7dc5153f 100644 --- a/definitions/EiffelTestSuiteFinishedEvent/4.0.0.yml +++ b/definitions/EiffelTestSuiteFinishedEvent/4.0.0.yml @@ -64,7 +64,35 @@ properties: type: string additionalProperties: false persistentLogs: - $ref: ../EiffelPersistentLogs/1.0.0.yml + _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 + required: + - name + - uri + additionalProperties: false customData: type: array items: diff --git a/definitions/EiffelTestSuiteFinishedEvent/4.1.0.yml b/definitions/EiffelTestSuiteFinishedEvent/4.1.0.yml index beaa95a7..8ab2591b 100644 --- a/definitions/EiffelTestSuiteFinishedEvent/4.1.0.yml +++ b/definitions/EiffelTestSuiteFinishedEvent/4.1.0.yml @@ -64,7 +64,7 @@ properties: type: string additionalProperties: false persistentLogs: - $ref: ../EiffelPersistentLogs/1.1.0.yml + $ref: ../EiffelPersistentLogs/1.0.0.yml customData: type: array items: 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/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 +}