Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Uncommitted) Usage of EDC EDR API (in case current E2E with EDC is not working) #575

Open
7 tasks
ds-jhartmann opened this issue Apr 30, 2024 · 2 comments
Open
7 tasks
Labels
3 - Maintenance & Improvements (EDC & EDC API) Improvements enhancement New feature or request hardening measurements to increase resiliency spill_over Issues which are not finished yet

Comments

@ds-jhartmann
Copy link
Contributor

ds-jhartmann commented Apr 30, 2024

As a developer,
I want to switch to the EDC EDR API,
so that the EDC flow gets simpler and more resilient.

Hints / Details

Acceptance Criteria

  • EDC client is switched to EDR API

Technical stuff

  • Triggering the EDR API
  • Contraction negotiation initiation will change
  • Trigger transfer process is removed
  • Addition request to get the EDR token for the EDR API
  • Reuse of EDR token (EDR reuse implementation - this could be realized leaner)

Testing

  • All integrations tests in green after API change

Out of Scope

  • ...
@github-project-automation github-project-automation bot moved this to inbox in IRS Apr 30, 2024
@jzbmw jzbmw added enhancement New feature or request hardening measurements to increase resiliency labels Apr 30, 2024
@mkanal mkanal moved this from inbox to backlog in IRS Apr 30, 2024
@mkanal mkanal changed the title Usage of EDC EDR API Usage of EDC EDR API (in case current E2E with EDC is not working) Apr 30, 2024
@mkanal mkanal moved this from backlog to next in IRS Apr 30, 2024
@ds-jhartmann
Copy link
Contributor Author

ds-jhartmann commented Apr 30, 2024

Planning 2:

EDR Negotiation request:

{
	"@context": [
		"https://w3id.org/tractusx/policy/v1.0.0",
		"http://www.w3.org/ns/odrl.jsonld",
		{
			"@vocab": "https://w3id.org/edc/v0.0.1/ns/"
		}
	],
	"@type": "ContractRequest",
	"counterPartyAddress": "{{ _.PROVIDER_CONTROLPLANE_1 }}/api/v1/dsp",
	"protocol": "dataspace-protocol-http",
	"policy": {
		"@id": "YTYxMjJlNTUtZWY2Ni00MWM4LWFjMjgtZDA5ODhlMmQ2YzRi:dXJuOnV1aWQ6ZWEzMmY2ZjctYzg4NC00YmZkLWFmNGEtNzc4NjY2YTFmZmZi:YjZkMzMzYWItZGI0Zi00M2MzLWE3YjAtM2I4Yjc3NWQzMmRh",
		"@type": "Offer",
		"assigner": "BPNL00000001CRHK",
		"odrl:permission": {
			"odrl:action": {
				"odrl:type": "USE"
			},
			"odrl:constraint": {
				"odrl:or": {
					"odrl:leftOperand": "PURPOSE",
					"odrl:operator": {
						"@id": "odrl:eq"
					},
					"odrl:rightOperand": "ID 3.1 Trace"
				}
			}
		},
		"prohibition": [],
		"obligation": [],
		"target": "urn:uuid:ea32f6f7-c884-4bfd-af4a-778666a1fffb"
	},
	"callbackAddresses": []
}

Query for EDR negotiation by edc asset id:

{
	"@context": {
		"@vocab": "https://w3id.org/edc/v0.0.1/ns/"
	},
	"@type": "QuerySpec",
	"filterExpression": [
		{
			"operandLeft": "assetId",
			"operator": "=",
			"operandRight": "urn:uuid:ea32f6f7-c884-4bfd-af4a-778666a1fffb"
		}
	]
}

@ds-ext-kmassalski ds-ext-kmassalski self-assigned this May 7, 2024
@ds-ext-kmassalski ds-ext-kmassalski moved this from next to wip in IRS May 7, 2024
@ds-ext-kmassalski ds-ext-kmassalski moved this from wip to next in IRS May 7, 2024
@ds-ext-kmassalski ds-ext-kmassalski moved this from next to backlog in IRS May 7, 2024
@mkanal mkanal added the spill_over Issues which are not finished yet label Jun 5, 2024
@mkanal mkanal moved this from backlog to next in IRS Jun 10, 2024
ds-jhartmann added a commit to ds-jhartmann/item-relationship-service that referenced this issue Jun 13, 2024
…654-update-documentation

feat(docs):[TRI-1654] Add section in building block view for subproto…
@dsmf dsmf moved this from next to wip in IRS Jun 20, 2024
@dsmf dsmf assigned dsmf and unassigned ds-ext-kmassalski Jun 20, 2024
@mkanal mkanal moved this from wip to next in IRS Jul 9, 2024
@mkanal mkanal unassigned dsmf Jul 9, 2024
@mkanal mkanal changed the title Usage of EDC EDR API (in case current E2E with EDC is not working) (Uncommitted) Usage of EDC EDR API (in case current E2E with EDC is not working) Jul 9, 2024
@dsmf
Copy link
Contributor

dsmf commented Jul 9, 2024

Notes how to get token:

get catalog:
EDC Req Get Catalog

then id from asset "registry-asset"

start EDR negotiation

id "registry-asset" goes into the field target

the id of the policy:

id: MjA1MTFkNzEtM2M5ZS00OTg1LTg4MjYtYjcwYjA4ODIzYzYx:cmVnaXN0cnktYXNzZXQ=:ZDQ0N2IwNGItYzEyOS00NTAzLTgwNmUtMDYyOTJlNWMxZDNh

permission:

	"odrl:permission": {
					"odrl:action": {
						"odrl:type": "use"
					},
					"odrl:constraint": {
						"odrl:and": [
							{
								"odrl:leftOperand": "cx-policy:FrameworkAgreement",
								"odrl:operator": {
									"@id": "odrl:eq"
								},
								"odrl:rightOperand": "traceability:1.0"
							},
							{
								"odrl:leftOperand": "cx-policy:UsagePurpose",
								"odrl:operator": {
									"@id": "odrl:eq"
								},
								"odrl:rightOperand": "cx.core.industrycore:1"
							}
						]
					}
				},

=>

{
	"@type": "IdResponse",
	"@id": "04713a04-b394-4f7d-b5a7-120111cc861f",
	"createdAt": 1719583149759,
	"@context": {
		"@vocab": "https://w3id.org/edc/v0.0.1/ns/",
		"edc": "https://w3id.org/edc/v0.0.1/ns/",
		"tx": "https://w3id.org/tractusx/v0.0.1/ns/",
		"tx-auth": "https://w3id.org/tractusx/auth/",
		"cx-policy": "https://w3id.org/catenax/policy/",
		"odrl": "http://www.w3.org/ns/odrl/2/"
	}
}

04713a04-b394-4f7d-b5a7-120111cc861f

{
	"@context": {
		"@vocab": "https://w3id.org/edc/v0.0.1/ns/"
	},
	"@type": "QuerySpec",
	"filterExpression": [
		{
			"operandLeft": "contractNegotiationId",
			"operator": "=",
			"operandRight": "{% response 'body', 'req_3a6a7b9bc74b474b8f6d3130958145f9', 'b64::JC5gQGlk::46b', 'never', 60 %}"
		}
	]
}

=>

[
	{
		"@id": "ea52b90b-de19-4919-b3af-109d2504a891",
		"@type": "EndpointDataReferenceEntry",
		"providerId": "BPNL00000001CRHK",
		"assetId": "registry-asset",
		"agreementId": "69651dc2-fe59-4c8b-92a3-0a835e5ef576",
		"transferProcessId": "ea52b90b-de19-4919-b3af-109d2504a891",
		"createdAt": 1719583159173,
		"contractNegotiationId": "04713a04-b394-4f7d-b5a7-120111cc861f",
		"@context": {
			"@vocab": "https://w3id.org/edc/v0.0.1/ns/",
			"edc": "https://w3id.org/edc/v0.0.1/ns/",
			"tx": "https://w3id.org/tractusx/v0.0.1/ns/",
			"tx-auth": "https://w3id.org/tractusx/auth/",
			"cx-policy": "https://w3id.org/catenax/policy/",
			"odrl": "http://www.w3.org/ns/odrl/2/"
		}
	}
]

get edr data address

"@id": "ea52b90b-de19-4919-b3af-109d2504a891",
with param auto_refresh = true

=> token

@mkanal mkanal moved this from next to backlog in IRS Jul 23, 2024
@mkanal mkanal removed the status in IRS Jul 23, 2024
@mkanal mkanal moved this to next in IRS Jul 23, 2024
@mkanal mkanal moved this from next to backlog in IRS Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Maintenance & Improvements (EDC & EDC API) Improvements enhancement New feature or request hardening measurements to increase resiliency spill_over Issues which are not finished yet
Projects
Status: backlog
Development

No branches or pull requests

5 participants