Skip to content

ThinEdge C8Y Proxy sent the Identity API GET request until ";" character of the actual request #3884

@Oezge-Akin

Description

@Oezge-Akin

Describe the bug

The issue is produced with the request to the Identity API but this might be applicable to all C8Y API requests.

Using the thinEdge as the C8Y proxy, when the URL contains ";" in the URL path, the thinEdge seems to send the request URL until ";" character to the platform.

To Reproduce

  • Have the thinEdge connected to your tenant.
  • Have a device in the C8Y platform and with identity containing ";" character in the value.
    This is what I have:
Image
  • Retrieve the device object from the external Id that contains ";" character in the value
    For this example:

GET http://localhost:8001/c8y/identity/externalIds/c8y_OpcuaDevice/tId%3A50175621%3BsId%3D37316412%3Bnsu%3Durn%3Acumulocity%3Aopcua%3Atest%3Aserver%3Bs%3DDynamic%20Playground

Expected behavior
It returns the result with the device managed object that is bound to, like the following:

{
    "self": "...",
    "externalId": "tId:50175621;sId=37316412;nsu=urn:cumulocity:opcua:test:server;s=Dynamic Playground",
    "type": "c8y_OpcuaDevice",
    "managedObject": {
        "self": "...",
        "id": "25314167"
    }
}

Actual behavior

It returns 404 Not Found with message, like the following:

{
    "message": "External id not found; external id = ID [type=c8y_OpcuaDevice, value=tId:50175621]",
    "error": "identity/Not Found",
    "info": "https://cumulocity.com/api/core/"
}

The external ID value from the error message is the substring of the actual value until the first ";" character.

Environment (please complete the following information):

  • thin-edge is targeting an eu-latest tenant.
  • tedge version is 1.6.0

Additional context

When doing the request to my tenant domain directly, it's able to return response correctly:

GET https://<myTenant>.eu-latest.cumulocity.com/identity/externalIds/c8y_OpcuaDevice/tId%3A50175621%3BsId%3D37316412%3Bnsu%3Durn%3Acumulocity%3Aopcua%3Atest%3Aserver%3Bs%3DDynamic%20Playground

{
    "self": "...",
    "externalId": "tId:50175621;sId=37316412;nsu=urn:cumulocity:opcua:test:server;s=Dynamic Playground",
    "type": "c8y_OpcuaDevice",
    "managedObject": {
        "self": "...",
        "id": "25314167"
    }
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtheme:c8yTheme: Cumulocity related topics

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions