From 4b97636eb478a69fdf19a8b6dd9c6b789a06d28f Mon Sep 17 00:00:00 2001 From: Mahmoud Alkhraishi Date: Thu, 19 Sep 2024 12:00:20 -0400 Subject: [PATCH 1/2] add NG env passport credential. update name of environmental impact credential --- ...edentials-with-issuer-dependent-terms.json | 18 +- ....yml => EnvironmentalImpactCredential.yml} | 16 +- ...roducerEnvironmentalPassportCredential.yml | 227 ++++++++++++++++++ docs/openapi/openapi.yml | 71 +++++- 4 files changed, 310 insertions(+), 22 deletions(-) rename docs/openapi/components/schemas/credentials/{environmentalImpactCredential.yml => EnvironmentalImpactCredential.yml} (91%) create mode 100644 docs/openapi/components/schemas/credentials/NaturalGasProducerEnvironmentalPassportCredential.yml diff --git a/docs/credentials-with-issuer-dependent-terms.json b/docs/credentials-with-issuer-dependent-terms.json index 6f27b4815..2f133f38f 100644 --- a/docs/credentials-with-issuer-dependent-terms.json +++ b/docs/credentials-with-issuer-dependent-terms.json @@ -1,11 +1,7 @@ [ - { - "type": "environmentalImpactCredential", - "count": 17 - }, { "type": "WebLeiCredential", - "count": 28 + "count": 22 }, { "type": "VerifiableScorecard", @@ -51,6 +47,10 @@ "type": "SIMASteelImportLicenseApplicationCredential", "count": 6 }, + { + "type": "QualifiedWebLeiIssuerCredential", + "count": 3 + }, { "type": "PurchaseOrderCredential", "count": 6 @@ -91,6 +91,10 @@ "type": "OilAndGasDeliveryTicketCredential", "count": 6 }, + { + "type": "NaturalGasProducerEnvironmentalPassportCredential", + "count": 34 + }, { "type": "MultiModalBillOfLadingCredential", "count": 0 @@ -219,6 +223,10 @@ "type": "EventCredential", "count": 9 }, + { + "type": "EnvironmentalImpactCredential", + "count": 17 + }, { "type": "EntryNumberCredential", "count": 0 diff --git a/docs/openapi/components/schemas/credentials/environmentalImpactCredential.yml b/docs/openapi/components/schemas/credentials/EnvironmentalImpactCredential.yml similarity index 91% rename from docs/openapi/components/schemas/credentials/environmentalImpactCredential.yml rename to docs/openapi/components/schemas/credentials/EnvironmentalImpactCredential.yml index 69f25cf65..46c5c1634 100644 --- a/docs/openapi/components/schemas/credentials/environmentalImpactCredential.yml +++ b/docs/openapi/components/schemas/credentials/EnvironmentalImpactCredential.yml @@ -1,6 +1,6 @@ $linkedData: - term: environmentalImpactCredential - '@id': https://w3id.org/traceability#environmentalImpactCredential + term: EnvironmentalImpactCredential + '@id': https://w3id.org/traceability#EnvironmentalImpactCredential title: Environmental Impact Credential tags: - Oil and Gas @@ -26,15 +26,15 @@ properties: readOnly: true const: - VerifiableCredential - - environmentalImpactCredential + - EnvironmentalImpactCredential default: - VerifiableCredential - - environmentalImpactCredential + - EnvironmentalImpactCredential items: type: string enum: - VerifiableCredential - - environmentalImpactCredential + - EnvironmentalImpactCredential id: type: string format: uri @@ -54,8 +54,8 @@ properties: description: The url of the schema file to validate the shape of the json object type: string format: uri - example: https://w3id.org/traceability/openapi/components/schemas/credentials/environmentalImpactCredential.yml - default: https://w3id.org/traceability/openapi/components/schemas/credentials/environmentalImpactCredential.yml + example: https://w3id.org/traceability/openapi/components/schemas/credentials/EnvironmentalImpactCredential.yml + default: https://w3id.org/traceability/openapi/components/schemas/credentials/EnvironmentalImpactCredential.yml readOnly: true type: title: Type @@ -124,7 +124,7 @@ example: |- "id": "http://example.com/dd0c6f9a-5df6-40a3-bb34-863cd1fda606", "type": [ "VerifiableCredential", - "environmentalImpactCredential" + "EnvironmentalImpactCredential" ], "issuer": { "type": [ diff --git a/docs/openapi/components/schemas/credentials/NaturalGasProducerEnvironmentalPassportCredential.yml b/docs/openapi/components/schemas/credentials/NaturalGasProducerEnvironmentalPassportCredential.yml new file mode 100644 index 000000000..b66f6a564 --- /dev/null +++ b/docs/openapi/components/schemas/credentials/NaturalGasProducerEnvironmentalPassportCredential.yml @@ -0,0 +1,227 @@ +$linkedData: + term: NaturalGasProducerEnvironmentalPassportCredential + '@id': https://w3id.org/traceability#NaturalGasProducerEnvironmentalPassportCredential +title: Natural Gas Producer Environmental Passport Credential +tags: + - Oil and Gas +description: A credential that represents the environmental passport of a natural gas producer +type: object +properties: + '@context': + type: array + readOnly: true + const: + - https://www.w3.org/2018/credentials/v1 + - https://w3id.org/traceability/v1 + default: + - https://www.w3.org/2018/credentials/v1 + - https://w3id.org/traceability/v1 + items: + type: string + enum: + - https://www.w3.org/2018/credentials/v1 + - https://w3id.org/traceability/v1 + type: + type: array + readOnly: true + const: + - VerifiableCredential + - NaturalGasProducerEnvironmentalPassportCredential + default: + - VerifiableCredential + - NaturalGasProducerEnvironmentalPassportCredential + items: + type: string + enum: + - VerifiableCredential + - NaturalGasProducerEnvironmentalPassportCredential + id: + type: string + format: uri + issuanceDate: + type: string + format: date-time + expirationDate: + type: string + format: date-time + issuer: + $ref: ../common/Organization.yml + credentialSchema: + type: object + properties: + id: + title: Id + description: The url of the schema file to validate the shape of the json object + type: string + format: uri + example: https://w3id.org/traceability/openapi/components/schemas/credentials/NaturalGasProducerEnvironmentalPassportCredential.yml + default: https://w3id.org/traceability/openapi/components/schemas/credentials/NaturalGasProducerEnvironmentalPassportCredential.yml + readOnly: true + type: + title: Type + description: The type of validation to be run against the defined schema + const: OpenApiSpecificationValidator2022 + credentialSubject: + title: Natural Gas Producer Environmental Passport Credential + description: A credential that represents the environmental passport of a natural gas producer + type: object + properties: + organization: + type: object + title: Organization + description: the organization the passport is issued to + properties: + legalName: + type: string + title: Organization Legal Name + description: Legal name of the Organization + dailyVolumeProduced: + type: string + title: Daily volume produced + description: Daily volume of Natural Gas produced in MMcf/d (Millions of cubic feet per day) + productionLocation: + type: object + description: the location of the production site + $ref: ../common/Place.yml + productionPhase: + type: string + enum: + - Active + - Inactive + - In development + required: + - legalName + - dailyVolumeProduced + - productionLocation + - productionPhase + certifications: + title: Certifications + type: array + items: + type: object + properties: + certificationPeriod: + type: string + format: date-time + title: Certification Period + description: the validity period of the certification + certificateIssuer: + type: string + title: Certificate Issuer + description: issuer of the certificate + certificateIdentifier: + type: string + title: CertificateIdentifier + description: the identifier of the certificate + certificationStandard: + type: string + title: CertificationStardard + description: the standard for the certification. + assessmentBody: + type: string + title: Assessment Body + description: The entity that conducts the assessment for the certification + observations: + title: Observations + description: >- + List of observations + type: array + items: + $ref: ./Observation.yml + required: + - certificationPeriod + - certificateIssuer + - certificateIdentifier + - certificationStandard + - observations + proof: + $ref: ../snippets/proof.yml +additionalProperties: false +required: + - '@context' + - type + - id + - issuanceDate + - issuer + - credentialSubject +example: |- + { + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://w3id.org/traceability/v1" + ], + "id": "http://example.com/dd0c6f9a-5df6-40a3-bb34-863cd1fda606", + "type": [ + "VerifiableCredential", + "NaturalGasProducerEnvironmentalPassportCredential" + ], + "issuer": { + "type": [ + "Organization" + ], + "id": "did:web:organization.example.com" + }, + "issuanceDate": "2022-11-01T10:58:45-04:00", + "credentialSubject": { + "organization": { + "legalName": "Example Company", + "dailyVolumeProduced": "200", + "productionLocation": { + "type": [ + "Place" + ], + "globalLocationNumber": "1111111111", + "geo": { + "type": [ + "GeoCoordinates" + ], + "latitude": "-79.6395", + "longitude": "178.5353" + }, + "address": { + "type": [ + "PostalAddress" + ], + "name": "Example Production Location", + "streetAddress": "100 main street", + "addressLocality": "Example locality", + "addressRegion": "Example Region", + "postalCode": "1X2Y3Z", + "addressCountry": "CA" + }, + "unLocode": "DKCPH" + }, + "productionPhase": "Active" + }, + "certifications": [ + { + "certificationPeriod": "2019-12-11T03:50:55Z", + "certificateIssuer": "MiQ", + "certificateIdentifier": "123456", + "certificationStandard": "MiQ", + "assessmentBody": "Example Body", + "observations": [ + { + "type": [ + "Observation" + ], + "date": "2019-12-11T03:50:55Z", + "property": { + "type": [ + "ChemicalProperty" + ], + "name": "Methane Intensity" + }, + "measurement": { + "type": [ + "MeasuredValue" + ], + "value": "00.00", + "unitCode": "UNKNOWN" + } + } + ] + } + ] + } + } \ No newline at end of file diff --git a/docs/openapi/openapi.yml b/docs/openapi/openapi.yml index d33779360..4a848cc82 100644 --- a/docs/openapi/openapi.yml +++ b/docs/openapi/openapi.yml @@ -2556,6 +2556,32 @@ paths: $ref: './components/schemas/credentials/EntryNumberCredential.yml' + /schemas/credentials/EnvironmentalImpactCredential.yml: + get: + tags: + - credentials + responses: + '200': + description: 'successfully issued EnvironmentalImpactCredential schema.' + content: + application/yml: + schema: + $ref: './components/schemas/credentials/EnvironmentalImpactCredential.yml' + + + /schemas/credentials/EnvironmentalPassportCredential.yml: + get: + tags: + - credentials + responses: + '200': + description: 'successfully issued EnvironmentalPassportCredential schema.' + content: + application/yml: + schema: + $ref: './components/schemas/credentials/EnvironmentalPassportCredential.yml' + + /schemas/credentials/EventCredential.yml: get: tags: @@ -2952,6 +2978,7 @@ paths: - credentials responses: '200': + description: 'successfully issued MonthlyAggregateDeliveryStatements schema.' content: application/yml: schema: @@ -3101,6 +3128,19 @@ paths: $ref: './components/schemas/credentials/PurchaseOrderCredential.yml' + /schemas/credentials/QualifiedWebLeiIssuerCredential.yml: + get: + tags: + - credentials + responses: + '200': + description: 'successfully issued QualifiedWebLeiIssuerCredential schema.' + content: + application/yml: + schema: + $ref: './components/schemas/credentials/QualifiedWebLeiIssuerCredential.yml' + + /schemas/credentials/SIMASteelImportLicenseApplicationCredential.yml: get: tags: @@ -3244,17 +3284,17 @@ paths: $ref: './components/schemas/credentials/VerifiableScorecard.yml' - /schemas/credentials/environmentalImpactCredential.yml: + /schemas/credentials/WebLeiCredential.yml: get: tags: - credentials responses: '200': - description: 'successfully issued environmentalImpactCredential schema.' + description: 'successfully issued WebLeiCredential schema.' content: application/yml: schema: - $ref: './components/schemas/credentials/environmentalImpactCredential.yml' + $ref: './components/schemas/credentials/WebLeiCredential.yml' /schemas/snippets/BuyerParty.yml: @@ -3452,30 +3492,43 @@ paths: $ref: './components/schemas/workflows/businesscard.yml' - /schemas/workflows/cbp-steel-tech-demo-2023.yml: + /schemas/workflows/cbp-ecommerce-apparel-tech-demo-2024.yml: get: tags: - workflows responses: '200': - description: 'successfully issued cbp-steel-tech-demo-2023 schema.' + description: 'successfully issued cbp-ecommerce-apparel-tech-demo-2024 schema.' content: application/yml: schema: - $ref: './components/schemas/workflows/cbp-steel-tech-demo-2023.yml' + $ref: './components/schemas/workflows/cbp-ecommerce-apparel-tech-demo-2024.yml' - /schemas/workflows/common-import-credentials.yml: + /schemas/workflows/cbp-ecommerce-pesticides-tech-demo-2024.yml: get: tags: - workflows responses: '200': - description: 'successfully issued common-import-credentials schema.' + description: 'successfully issued cbp-ecommerce-pesticides-tech-demo-2024 schema.' content: application/yml: schema: - $ref: './components/schemas/workflows/common-import-credentials.yml' + $ref: './components/schemas/workflows/cbp-ecommerce-pesticides-tech-demo-2024.yml' + + + /schemas/workflows/cbp-steel-tech-demo-2023.yml: + get: + tags: + - workflows + responses: + '200': + description: 'successfully issued cbp-steel-tech-demo-2023 schema.' + content: + application/yml: + schema: + $ref: './components/schemas/workflows/cbp-steel-tech-demo-2023.yml' /schemas/workflows/intent-to-import.yml: From 54b001e54a0a7fda39a5584db4bfb255d36d51af Mon Sep 17 00:00:00 2001 From: Mahmoud Alkhraishi Date: Thu, 19 Sep 2024 12:05:59 -0400 Subject: [PATCH 2/2] fix test --- ...roducerEnvironmentalPassportCredential.yml | 6 ++--- docs/openapi/openapi.yml | 26 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/openapi/components/schemas/credentials/NaturalGasProducerEnvironmentalPassportCredential.yml b/docs/openapi/components/schemas/credentials/NaturalGasProducerEnvironmentalPassportCredential.yml index b66f6a564..77db8c96a 100644 --- a/docs/openapi/components/schemas/credentials/NaturalGasProducerEnvironmentalPassportCredential.yml +++ b/docs/openapi/components/schemas/credentials/NaturalGasProducerEnvironmentalPassportCredential.yml @@ -127,7 +127,7 @@ properties: List of observations type: array items: - $ref: ./Observation.yml + $ref: ../common/Observation.yml required: - certificationPeriod - certificateIssuer @@ -170,7 +170,7 @@ example: |- "type": [ "Place" ], - "globalLocationNumber": "1111111111", + "globalLocationNumber": "1111111111111", "geo": { "type": [ "GeoCoordinates" @@ -224,4 +224,4 @@ example: |- } ] } - } \ No newline at end of file + } diff --git a/docs/openapi/openapi.yml b/docs/openapi/openapi.yml index 4a848cc82..5dc492f85 100644 --- a/docs/openapi/openapi.yml +++ b/docs/openapi/openapi.yml @@ -2569,19 +2569,6 @@ paths: $ref: './components/schemas/credentials/EnvironmentalImpactCredential.yml' - /schemas/credentials/EnvironmentalPassportCredential.yml: - get: - tags: - - credentials - responses: - '200': - description: 'successfully issued EnvironmentalPassportCredential schema.' - content: - application/yml: - schema: - $ref: './components/schemas/credentials/EnvironmentalPassportCredential.yml' - - /schemas/credentials/EventCredential.yml: get: tags: @@ -2998,6 +2985,19 @@ paths: $ref: './components/schemas/credentials/MultiModalBillOfLadingCredential.yml' + /schemas/credentials/NaturalGasProducerEnvironmentalPassportCredential.yml: + get: + tags: + - credentials + responses: + '200': + description: 'successfully issued NaturalGasProducerEnvironmentalPassportCredential schema.' + content: + application/yml: + schema: + $ref: './components/schemas/credentials/NaturalGasProducerEnvironmentalPassportCredential.yml' + + /schemas/credentials/OilAndGasDeliveryTicketCredential.yml: get: tags: