Skip to content

Commit

Permalink
pr remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
wolf4ood committed May 29, 2023
1 parent 8b87269 commit 80e8afe
Show file tree
Hide file tree
Showing 5 changed files with 199 additions and 15 deletions.
192 changes: 189 additions & 3 deletions docs/development/postman/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"@context\": {},\n \"asset\": {\n \"@type\": \"Asset\",\n \"@id\": \"{{ASSET_ID}}\", \n \"properties\": {\n \"description\": \"Product EDC Demo Asset\"\n }\n },\n \"dataAddress\": {\n \"@type\": \"DataAddress\",\n \"type\": \"HttpData\",\n \"baseUrl\": \"https://jsonplaceholder.typicode.com/todos/1\"\n }\n}",
"raw": "{\n \"@context\": {},\n \"asset\": {\n \"@type\": \"Asset\",\n \"@id\": \"{{ASSET_ID}}\", \n \"properties\": {\n \"description\": \"Product EDC Demo Asset\"\n }\n },\n \"dataAddress\": {\n \"@type\": \"DataAddress\",\n \"type\": \"HttpData\",\n \"baseUrl\": \"https://jsonplaceholder.typicode.com/todos\"\n }\n}",
"options": {
"raw": {
"language": "json"
Expand Down Expand Up @@ -539,13 +539,13 @@
"method": "GET",
"header": [],
"url": {
"raw": "{{CONSUMER_DATAMGMT_URL}}/transferprocesses/764db319-0952-4d20-8feb-d8bee8e77a54",
"raw": "{{CONSUMER_DATAMGMT_URL}}/transferprocesses/8e428b80-46a5-4325-87e5-592518f7666b",
"host": [
"{{CONSUMER_DATAMGMT_URL}}"
],
"path": [
"transferprocesses",
"764db319-0952-4d20-8feb-d8bee8e77a54"
"8e428b80-46a5-4325-87e5-592518f7666b"
]
}
},
Expand Down Expand Up @@ -597,6 +597,187 @@
}
},
"response": []
},
{
"name": "Initiate EDR Negotation",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Body matches string\", function () {",
" var jsonData = pm.response.json();",
" pm.collectionVariables.set(\"NEGOTIATION_ID\", jsonData.id);",
"",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n\t\"@context\": {\n\t\t\"odrl\": \"http://www.w3.org/ns/odrl/2/\"\n\t},\n\t\"@type\": \"NegotiationInitiateRequestDto\",\n\t\"connectorAddress\": \"{{PROVIDER_IDS_URL}}\",\n\t\"protocol\": \"dataspace-protocol-http\",\n\t\"connectorId\": \"{{PROVIDER_ID}}\",\n\t\"providerId\": \"{{PROVIDER_ID}}\",\n\t\"offer\": {\n\t\t\"offerId\": \"1:1:9f9375e3-ed28-449a-8a98-a340f4c20c26\",\n\t\t\"assetId\": \"{{ASSET_ID}}\",\n\t\t\"policy\": {\n\t\t\t\"@type\": \"odrl:Set\",\n\t\t\t\"odrl:permission\": {\n\t\t\t\t\"odrl:target\": \"{{ASSET_ID}}\",\n\t\t\t\t\"odrl:action\": {\n\t\t\t\t\t\"odrl:type\": \"USE\"\n\t\t\t\t},\n\t\t\t\t\"odrl:constraint\": {\n\t\t\t\t\t\"odrl:or\": {\n\t\t\t\t\t\t\"odrl:leftOperand\": \"BusinessPartnerNumber\",\n\t\t\t\t\t\t\"odrl:operator\": \"EQ\",\n\t\t\t\t\t\t\"odrl:rightOperand\": \"{{POLICY_BPN}}\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"odrl:prohibition\": [],\n\t\t\t\"odrl:obligation\": [],\n\t\t\t\"odrl:target\": \"{{ASSET_ID}}\"\n\t\t}\n\t}\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{CONSUMER_ADAPTER_URL}}/edrs",
"host": [
"{{CONSUMER_ADAPTER_URL}}"
],
"path": [
"edrs"
]
}
},
"response": []
},
{
"name": "Query EDRs Cached",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Body matches string\", function () {",
" var jsonData = pm.response.json();",
" pm.collectionVariables.set(\"NEGOTIATION_ID\", jsonData.id);",
"",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{CONSUMER_ADAPTER_URL}}/edrs?assetId={{ASSET_ID}}",
"host": [
"{{CONSUMER_ADAPTER_URL}}"
],
"path": [
"edrs"
],
"query": [
{
"key": "assetId",
"value": "{{ASSET_ID}}"
}
]
}
},
"response": []
},
{
"name": "Get EDR by tp ID",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Body matches string\", function () {",
" var jsonData = pm.response.json();",
" pm.collectionVariables.set(\"NEGOTIATION_ID\", jsonData.id);",
"",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{CONSUMER_ADAPTER_URL}}/edrs/4b383155-9147-4912-819e-6172b4a3eb02",
"host": [
"{{CONSUMER_ADAPTER_URL}}"
],
"path": [
"edrs",
"4b383155-9147-4912-819e-6172b4a3eb02"
]
}
},
"response": []
},
{
"name": "Get Asset Data with proxy",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Body matches string\", function () {",
" var jsonData = pm.response.json();",
" pm.collectionVariables.set(\"NEGOTIATION_ID\", jsonData.id);",
"",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"assetId\": \"{{ASSET_ID}}\",\n \"endpointUrl\": \"http://plato-dataplane:8080/api/gateway/aas/1\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:8186/proxy/aas/request",
"protocol": "http",
"host": [
"localhost"
],
"port": "8186",
"path": [
"proxy",
"aas",
"request"
]
}
},
"response": []
}
],
"auth": {
Expand Down Expand Up @@ -715,6 +896,11 @@
"key": "EDC_NAMESPACE",
"value": "https://w3id.org/edc/v0.0.1/ns/",
"type": "string"
},
{
"key": "CONSUMER_ADAPTER_URL",
"value": "http://localhost:31364/management/adapter",
"type": "string"
}
]
}
4 changes: 4 additions & 0 deletions docs/migration/Version_0.3.4_0.4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ The Business tests were brittle, consumed a lot of resources and were quite cumb
Since the old Control-Plane-Adapter is incompatible with DSP, a new iteration was created.
**Due to time constraints with this release documentation for this feature will to be published subsequently**

## New Policies for expressing validity of the agreement

The dates in `ContractOffer` and `ContractAgreement` has been removed in favour of a policy based contract validity check, see [here](https://github.com/eclipse-edc/Connector/issues/2758)

## Other changes

- When using the EDR [HttpDynamicReceiverExtension](https://github.com/eclipse-edc/Connector/tree/main/extensions/control-plane/transfer/transfer-pull-http-dynamic-receiver) in the transfer process initiation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,7 @@ void setUp(ObjectFactory factory, ServiceExtensionContext context) {
@Test
void initialize() {
extension.initialize(context);
var attributes = Map.of(PARTICIPANT_IDENTITY, "BPNSOKRATES");
verify(agentService).register(isA(CxParticipantExtension.class));
var claims = ClaimToken.Builder.newInstance().claim(REFERRING_CONNECTOR_CLAIM, "http://sokrates-controlplane/BPNSOKRATES").build();


assertThat(extension.attributesFor(claims)).containsExactlyEntriesOf(attributes);

claims = ClaimToken.Builder.newInstance().claim(REFERRING_CONNECTOR_CLAIM, "http://sokrates-controlplane/BPNSOKRATES/").build();
assertThat(extension.attributesFor(claims)).containsExactlyEntriesOf(attributes);

claims = ClaimToken.Builder.newInstance().claim(REFERRING_CONNECTOR_CLAIM, "http://sokrates-controlplane/test/path/BPNSOKRATES/").build();
assertThat(extension.attributesFor(claims)).containsExactlyEntriesOf(attributes);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class AbstractHashicorpVaultExtension {
public HashicorpVaultClient createVaultClient(ServiceExtensionContext context, ObjectMapper mapper) {
var config = loadHashicorpVaultClientConfig(context);

final OkHttpClient okHttpClient = createOkHttpClient(config);
var okHttpClient = createOkHttpClient(config);

return new HashicorpVaultClient(config, okHttpClient, mapper);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ public class TestRuntimeConfiguration {
static final String SOKRATES_PUBLIC_API_PORT = String.valueOf(getFreePort());
static final String PLATO_PUBLIC_API_PORT = String.valueOf(getFreePort());
static final String PLATO_DATAPLANE_CONTROL_PORT = String.valueOf(getFreePort());
static final String PLATO_DATAPLANE_PROXY_PORT = String.valueOf(getFreePort());
static final String SOKRATES_DATAPLANE_CONTROL_PORT = String.valueOf(getFreePort());

static final String SOKRATES_DATAPLANE_PROXY_PORT = String.valueOf(getFreePort());

public static Map<String, String> sokratesPostgresqlConfiguration() {
var baseConfiguration = sokratesConfiguration();
var postgresConfiguration = postgresqlConfiguration(SOKRATES_NAME.toLowerCase());
Expand Down Expand Up @@ -113,6 +116,7 @@ public static Map<String, String> sokratesConfiguration() {
// embedded dataplane config
put("web.http.control.path", "/api/dataplane/control");
put("web.http.control.port", SOKRATES_DATAPLANE_CONTROL_PORT);
put("tx.dpf.consumer.proxy.port", SOKRATES_DATAPLANE_PROXY_PORT);
put("edc.dataplane.token.validation.endpoint", "http://localhost:" + SOKRATES_DATAPLANE_CONTROL_PORT + "/api/dataplane/control/token");
put("edc.dataplane.selector.httpplane.url", "http://localhost:" + SOKRATES_DATAPLANE_CONTROL_PORT + "/api/dataplane/control");
put("edc.dataplane.selector.httpplane.sourcetypes", "HttpData");
Expand Down Expand Up @@ -143,6 +147,7 @@ public static Map<String, String> platoConfiguration() {
// embedded dataplane config
put("web.http.control.path", "/api/dataplane/control");
put("web.http.control.port", PLATO_DATAPLANE_CONTROL_PORT);
put("tx.dpf.consumer.proxy.port", PLATO_DATAPLANE_PROXY_PORT);
put("edc.dataplane.token.validation.endpoint", "http://localhost:" + PLATO_DATAPLANE_CONTROL_PORT + "/api/dataplane/control/token");
put("edc.dataplane.selector.httpplane.url", "http://localhost:" + PLATO_DATAPLANE_CONTROL_PORT + "/api/dataplane/control");
put("edc.dataplane.selector.httpplane.sourcetypes", "HttpData");
Expand Down

0 comments on commit 80e8afe

Please sign in to comment.