Fraunhofer-AISEC / ids-clearing-house-service

This is an implementation of the IDS Clearing House
Apache License 2.0
0 stars 11 forks source link

Consumer not set as PID owner #10

Closed sebplorenz closed 2 years ago

sebplorenz commented 2 years ago

When the DSC registers a new process id it sends an IDS message with payload (connector id of consumer and producer) to the clearing house. But the ClearingHouseCreatePidProcessor does not convert it into the message it sends to the clearing house api. Therefore, only the prodider connector is registered as the PID owner. Provider request message to clearing house:

--8b712f61-36b6-4cc2-ae5c-72c21c4fd933
Content-Disposition: form-data; name="header"
Content-Length: 2383

{
  "@context" : {
    "ids" : "https://w3id.org/idsa/core/",
    "idsc" : "https://w3id.org/idsa/code/"
  },
  "@type" : "ids:RequestMessage",
  "@id" : "https://w3id.org/idsa/autogen/requestMessage/cb79553f-fb53-40d1-9253-850a1f299740",
  "ids:issuerConnector" : {
    "@id" : "https://provider"
  },
  "ids:recipientConnector" : [ {
    "@id" : "http://tc-core:9999/process/b3f92843-7591-45dd-88be-73748148511f"
  } ],
  "ids:senderAgent" : {
    "@id" : "https://provider"
  },
  "ids:recipientAgent" : [ ],
  "ids:securityToken" : {
    "@type" : "ids:DynamicAttributeToken",
    "@id" : "https://w3id.org/idsa/autogen/dynamicAttributeToken/f1ee0ca3-d1c0-417b-af03-f41737b26965",
    "ids:tokenValue" : "...",
    "ids:tokenFormat" : {
      "@id" : "https://w3id.org/idsa/code/JWT"
    }
  },
  "ids:modelVersion" : "4.1.0",
  "ids:issued" : {
    "@value" : "2022-02-03T09:25:06.417Z",
    "@type" : "http://www.w3.org/2001/XMLSchema#dateTimeStamp"
  }
}
--8b712f61-36b6-4cc2-ae5c-72c21c4fd933
Content-Disposition: form-data; name="payload"
Content-Length: 50

{"owners":["https://provider","https://consumer"]}
--8b712f61-36b6-4cc2-ae5c-72c21c4fd933--

PID processor log:

2022-02-03 09:25:06.502 DEBUG 1 --- [qtp724400266-32] .f.a.i.c.ClearingHouseCreatePidProcessor : Build CH message: {"header":{"@type":"ids:RequestMessage","@id":"https://w3id.org/idsa/autogen/requestMessage/cb79553f-fb53-40d1-9253-850a1f299740","ids:issued":"2022-02-03T09:25:06.417UTC","ids:securityToken":{"@type":"ids:DynamicAttributeToken","@id":"https://w3id.org/idsa/autogen/dynamicAttributeToken/f1ee0ca3-d1c0-417b-af03-f41737b26965","ids:tokenValue":"...","ids:tokenFormat":{"@id":"https://w3id.org/idsa/code/JWT"}},"ids:issuerConnector":"https://provider","ids:recipientConnector":["http://tc-core:9999/process/b3f92843-7591-45dd-88be-73748148511f"],"ids:senderAgent":"https://provider","ids:modelVersion":"4.1.0"},"payload":"","payloadType":"text/plain"}, with payload  and payload type text/plain
kragall commented 2 years ago

If the content-type of the body is set to application/json, it should work. The PID processor checks the content-type and will ignore other content-types

sebplorenz commented 2 years ago

Will be fixed with: https://github.com/International-Data-Spaces-Association/DataspaceConnector/issues/885