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

Registry does not decode aasIds in URL-paths #154

Closed
arnoweiss opened this issue Jul 7, 2023 · 1 comment
Closed

Registry does not decode aasIds in URL-paths #154

arnoweiss opened this issue Jul 7, 2023 · 1 comment

Comments

@arnoweiss
Copy link

arnoweiss commented Jul 7, 2023

Bug

According to the specification, clients must base64-encode the identifiers that are part of the URL. The Registry decodes them and returns the data from a backend to the caller. The sldt-digital-twin-registry does not perform this decryption.

Reproduce

  1. Setup: start instance of sldt-digital-twin-registry v0.3.8
  2. Populate registry:
POST /api/v3.0/shell-descriptors HTTP/1.1
Host: dtreg.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer 
Content-Length: 1495
{
    "idShort": "idShortExample1233",
    "id": "123123b7-91f0-4dac-a730-eaa1d35e035c",
    "specificAssetIds": [
        {
            "name": "identifier1KeyExample",
            "value": "identifier1ValueExample3"
        }
    ],
    "submodelDescriptors": []
}
  1. GET the shell-descriptor from the registry
    Note that the aasId (123123b7-91f0-4dac-a730-eaa1d35e035c) is encoded (MTIzMTIzYjctOTFmMC00ZGFjLWE3MzAtZWFhMWQzNWUwMzVj)
GET /api/v3.0/shell-descriptors/MTIzMTIzYjctOTFmMC00ZGFjLWE3MzAtZWFhMWQzNWUwMzVj HTTP/1.1
Host: dtreg.com
Accept: application/json
Authorization: Bearer 

Expected behavior

HTTP 200 with the resource created in step 1.

{
    "idShort": "idShortExample1233",
    "id": "123123b7-91f0-4dac-a730-eaa1d35e035c",
    "specificAssetIds": [
        {
            "name": "identifier1KeyExample",
            "value": "identifier1ValueExample3"
        }
    ],
    "submodelDescriptors": []
}

Actual behavior

HTTP 404

{
    "messages": [
        {
            "messageType": "Error",
            "text": "Shell for identifier MTIzMTIzYjctOTFmMC00ZGFjLWE3MzAtZWFhMWQzNWUwMzVj not found"
        }
    ]
}

Additional context

If the URL contains the raw identifier, a resource is returned successfully. However, this only works if the id is a UUID.

@arnoweiss
Copy link
Author

Solved with #167 and this release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant