FraunhoferISST / DataspaceConnector

This is an IDS Connector reference implementation.
https://www.isst.fraunhofer.de/de/geschaeftsfelder/datenwirtschaft/technologien/Dataspace-Connector.html
Apache License 2.0
103 stars 80 forks source link

As an admin of the Dataspace Connector I cannot see from where a requested resource is being consumed #416

Closed sebplorenz closed 3 years ago

sebplorenz commented 3 years ago

As an admin of the Dataspace Connector I cannot see from which provider a requested resource is being consumed.

With the current DSC API there is no way to find out the connector from where a resource is being consumed. At least I didn't find any way to query that information.

Internally this information is stored in the artifact tables remote_address column. But it is important that this information can be queried by a DSC admin user.

Please make this information available to the admin. E.g. by adding it to the artifact.

thilo20 commented 3 years ago

I think this also applies to retrieval of remote artifacts. I as provider backend need to know which consumer is requesting the artifact data so that I can monitor usage per consumer/contract. Can this info maybe already be added to the get call as meta data in the http header?

juliapampus commented 3 years ago

@brianjahnke Isn't the remote id visible on a GET?

brianjahnke commented 3 years ago

It is.

grafik

sebplorenz commented 3 years ago

Hi @brianjahnke what I'm looking for is the accessURL of the connector that the resource is consumed from. Maybe I should have been more precise when raising the question. I just found out that this accessURL is contained in the resourceEndpoint of the description of the requested resource. Unfortunately the resourceEndpoint is not correctly added into the response object. Only the reference to the Java object is contained in the response. See the last lines of this example response of a call to /api/requests (DSC v5.1):

{
  "_embedded": {
    "requested": [
      {
        "creationDate": "2021-07-13T10:09:31.579+0000",
        "modificationDate": "2021-07-13T10:09:31.579+0000",
        "remoteId": "http://provider:8080/api/offers/6c6a2c63-dbe7-4892-a3d0-104976517dcb",
        "title": "\"DWD\"@DE",
        "description": "\"Weather data\"@DE",
        "keywords": [
          "string"
        ],
        "publisher": "DWD",
        "language": "https://w3id.org/idsa/code/DE",
        "licence": "https://www.dwd.de/DE/leistungen/opendata/faqs_opendata.html",
        "version": 1,
        "sovereign": "DWD",
        "endpointDocumentation": "none",
        "additional": {
          "ids:version": "1",
          "ids:created": "2021-07-13T10:06:35.837Z",
          "ids:modified": "2021-07-13T10:06:35.837Z",
          "ids:resourceEndpoint": "de.fraunhofer.iais.eis.ConnectorEndpointImpl@70c02d63"
        },

Maybe this is fixed already in a newer DSC version? If not then this would be a bug.

thilo20 commented 3 years ago

Hi @sebplorenz,

sebplorenz commented 3 years ago

Hi @thilo20, yes, I need to get the providers public endpoint of the providing connector. If this is contained in the ids:accessURL then it would be contained in the resource description.

sebplorenz commented 3 years ago

Hi, above, there was a question from @thilo20

I think this also applies to retrieval of remote artifacts. I as provider backend need to know which consumer is requesting the artifact data so that I can monitor usage per consumer/contract. Can this info maybe already be added to the get call as meta data in the http header?

Can this be achieved? Can a provider find out, who is consuming its artifacts and if yes, how?

EDIT: Is maybe this /api/contracts/{id}/requests the endpoint to get this information? If yes, please fix #529.

juliapampus commented 3 years ago

/api/contracts/{id}/requests No, these are not the endpoints. We will hide/deactivate them as they have no functionality.

sebplorenz commented 3 years ago

But is there a way to find out, which consumer is consuming my provided resources?

juliapampus commented 3 years ago

Indirectly. First of all, you can access the agreements of an artifact. There, all consumer with access to the data can be viewed. Furthermore, you can have a look at the logs. In addition, we log incoming and outgoing ArtifactRequestMessages and ArtifactResponseMessages to the Clearing House. One attribute inside the logged ids message is the issuerConnector.