Skip to content

Commit

Permalink
Merge pull request #262 from catenax-ng/release/v2.3.0-industry-core-…
Browse files Browse the repository at this point in the history
…changes

Release/v2.3.0 industry core changes: updated dpp testdata script and testdata payload
  • Loading branch information
saudkhan116 authored Apr 17, 2024
2 parents 646e4f5 + 1c53734 commit 44dc62b
Show file tree
Hide file tree
Showing 10 changed files with 399 additions and 1,619 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ The changelog format is based on [Keep a Changelog](https://keepachangelog.com/e

## [Unreleased]

### Added
- Added the following Industry Core changes to the policy and digital twin:
- Added `manufacturerId` and `digitalTwinType` to the specificAssetIds in digital twin registry
- Added localIdentifiers to the SerialPart aspect model

### Updated
- Refactored workflows where required
- Moved frontend source files into dpp-frontend directory
Expand All @@ -37,10 +42,12 @@ The changelog format is based on [Keep a Changelog](https://keepachangelog.com/e
- Re-organized directory strcuture for docs and deployment folders
- Updated documentation references where required
- Updated infrastructure guide
- Updated testdata script to allow EDC constrained policy for the registry

### Deleted
- Deleted unused files/directories/docs/images
- Removed environment-specific values files from helm charts
- Removed MOCKed json payloads
- Removed docker directory


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
SPDX-License-Identifier: Apache-2.0
-->

<h1 style="display:flex; align-items: center;"><img src="./docs/catena-x-logo.svg"/>&nbsp;&nbsp;Digital Product Pass Application</h1>
<h1 style="display:flex; align-items: center;"><img src="./docs/media/catenaxLogo.svg"/>&nbsp;&nbsp;Digital Product Pass Application</h1>

[![Contributors][contributors-shield]][contributors-url]
[![Stargazers][stars-shield]][stars-url]
Expand Down
83 changes: 60 additions & 23 deletions deployment/local/testing/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,51 +69,60 @@ create_edc_asset () {
ASSET_ID=${UUID}

payload='{
"@context": {},
"asset": {
"@type": "Asset",
"@id": "'${ASSET_ID}'",
"properties": {
"description": "Digital Product Passport (DPP) test data"
"@context": {
"edc": "https://w3id.org/edc/v0.0.1/ns/",
"cx-common": "https://w3id.org/catenax/ontology/common#",
"cx-taxo": "https://w3id.org/catenax/taxonomy#",
"dct": "https://purl.org/dc/terms/"
},
"@id": "'${ASSET_ID}'",
"properties": {
"type": {
"@id": "Asset"
}
},
"dataAddress": {
"@type": "DataAddress",
"type": "HttpData",
"baseUrl": "'${SUBMODEL_SERVER}'",
"proxyQueryParams": "true",
"proxyPath": "true",
"proxyBody": "true",
"proxyMethod": "true",
"proxyQueryParams": "true",
"baseUrl": "'${SUBMODEL_SERVER}'"
"proxyBody": "true"
}
}'
HTTP_RESPONSE=$(curl -X POST -s -H 'Content-Type: application/json' --data "${payload}" --header 'X-Api-Key: '${API_KEY} -o /dev/null -w "%{http_code}\n" ${PROVIDER_EDC}/management/v2/assets)
HTTP_RESPONSE=$(curl -X POST -s -H 'Content-Type: application/json' --data "${payload}" --header 'X-Api-Key: '${API_KEY} -o /dev/null -w "%{http_code}\n" ${PROVIDER_EDC}/management/v3/assets)
check_status_code "[DPP] - edc asset created with uuid : ${ASSET_ID}"
}

create_registry_asset () {

PAYLOAD='{
"@context": {},
"asset": {
"@type": "data.core.digitalTwinRegistry",
"@id": "'${REGISTRY_ASSET_ID}'",
"properties": {
"type": "data.core.digitalTwinRegistry",
"description": "Digital Twin Registry for DPP",
"contenttype": "application/json"
}
"@context": {
"edc": "https://w3id.org/edc/v0.0.1/ns/",
"cx-common": "https://w3id.org/catenax/ontology/common#",
"cx-taxo": "https://w3id.org/catenax/taxonomy#",
"dct": "https://purl.org/dc/terms/"
},
"@id": "'${REGISTRY_ASSET_ID}'",
"properties": {
"type": {
"@id": "DigitalTwinRegistry"
},
"version": "3.0",
"asset:prop:type": "data.core.digitalTwinRegistry"
},
"dataAddress": {
"@type": "DataAddress",
"type": "HttpData",
"baseUrl": "'${REGISTRY_URL}'",
"proxyQueryParams": "true",
"proxyPath": "true",
"proxyBody": "true",
"proxyMethod": "true",
"proxyQueryParams": "true",
"baseUrl": "'${REGISTRY_URL}'"
"proxyBody": "true"
}
}'
HTTP_RESPONSE=$(curl -X POST -H 'Content-Type: application/json' -s --data "${PAYLOAD}" --header 'X-Api-Key: '${API_KEY} -o /dev/null -w "%{http_code}\n" ${PROVIDER_EDC}/management/v2/assets)
HTTP_RESPONSE=$(curl -X POST -H 'Content-Type: application/json' -s --data "${PAYLOAD}" --header 'X-Api-Key: '${API_KEY} -o /dev/null -w "%{http_code}\n" ${PROVIDER_EDC}/management/v3/assets)
check_status_code "registry asset created with uuid : registry-asset"
}

Expand All @@ -133,6 +142,15 @@ create_default_policy () {
check_status_code "policy created with uuid : default-policy"
}

create_registry_policy () {
policy=$1
POLICY_ID=$(echo "${policy}" | jq -r '.["@id"]')


HTTP_RESPONSE=$(curl -X POST -H 'Content-Type: application/json' -s --data "${policy}" --header 'X-Api-Key: '${API_KEY} -o /dev/null -w "%{http_code}\n" ${PROVIDER_EDC}/management/v2/policydefinitions)
check_status_code "policy created with uuid : registry-policy"
}

create_edc_policy () {

policy=$1
Expand Down Expand Up @@ -161,6 +179,25 @@ create_default_contractdefinition () {
check_status_code "contract created with uuid : default-contract-definition"
}

create_registry_contractdefinition () {

PAYLOAD='{
"@context": {},
"@id": "registry-contract-definition",
"@type": "ContractDefinition",
"accessPolicyId": "registry-policy",
"contractPolicyId": "registry-policy",
"assetsSelector" : {
"@type": "CriterionDto",
"operandLeft": "https://w3id.org/edc/v0.0.1/ns/id",
"operator": "=",
"operandRight": "'${REGISTRY_ASSET_ID}'"
}
}'
HTTP_RESPONSE=$(curl -X POST -H 'Content-Type: application/json' -s --data "${PAYLOAD}" --header 'X-Api-Key: '${API_KEY} -o /dev/null -w "%{http_code}\n" ${PROVIDER_EDC}/management/v2/contractdefinitions)
check_status_code "contract created with uuid : registry-contract-definition"
}

create_contractdefinition () {

# since contract id does not support urn:uuid as prefix, generate a new one with the prerfix
Expand Down
Loading

0 comments on commit 44dc62b

Please sign in to comment.