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

Clarification GET /lookup/shells value for assetIds #239

Open
cbiehl30 opened this issue Apr 16, 2024 · 0 comments
Open

Clarification GET /lookup/shells value for assetIds #239

cbiehl30 opened this issue Apr 16, 2024 · 0 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@cbiehl30
Copy link

Hi, I wanted to ask if the current implementation of /lookup/shells in
https://github.com/eclipse-aaspe/aasx-server/blob/88dbef31fe83a7bc1a85f6ff68dbc5d94388d54f/src/IO.Swagger.Registry.Lib.V3/Controllers/AssetAdministrationShellRegistryAPIApi.cs#L532

meets the specification document IDTA-01002-3-0_SpecificationAssetAdministrationShell_Part2_API.pdf which says (page 114):

When retrieving AssetAdministrationShells (/shells, /lookup/shells), a query parameter “?assetids=” can be specified. Such assetId may be a globalAssetId or specificAssetId. The corresponding key�value-pair is first serialized to JSON and then base64url-encoded. The resulting encoded string is the value of “?assetids=”.

and

This encoding (serialize to JSON + base64url) is also used for SpecificAssetIds, i.e. for GetAllAssetAdministrationShellIdsByAssetLink (/lookup/shells). For the example “[{"key": "globalAssetId","value": "http://example.company/myAsset"},{"key": "myOwnInternalAssetId","value": "12345ABC"}]”, the resulting base64url-encoded value of the query parameter is “?assetIds=W3sia2V5IjogImdsb2JhbEFzc2V0SWQiLCJ2YWx1ZSI6ICJodHRwOi8vZXhhbXBsZS5jb21wYW55L215QXNzZXQifSx7ImtleSI6ICJteU93bkludGVybmFsQXNzZXRJZCIsInZhbHVlIjogIjEyMzQ1QUJDIn1d”. If several key-value-pairs are included, all must be part of the key-value-pairs on the server.

From what I can see the aasx-server expects a List<SpecificAssetId> where Value is base64url-encoded. If I understand the specification correctly, it should expect a List<string>, where each string is a key-value pair (or a SpecificAssetId) that is base64url-encoded.

For example

?assetIds=eyAibmFtZSI6ICJzb21lLWFzc2V0LWlkIiwgInZhbHVlIjogImh0dHA6Ly9leGFtcGxlLWNvbXBhbnkuY29tL215QXNzZXQiLCAiZXh0ZXJuYWxTdWJqZWN0SWQiOiB7ICJrZXlzIjogWyB7ICJ0eXBlIjogIkdsb2JhbFJlZmVyZW5jZSIsICJ2YWx1ZSI6ICJodHRwOi8vZXhhbXBsZS1jb21wYW55LmNvbS9leGFtcGxlLWNvbXBhbnlzLWFzc2V0LWtleXMiIH0gXSwgInR5cGUiOiAiR2xvYmFsUmVmZXJlbmNlIiB9IH0
&assetIds=eyAibmFtZSI6ICJzb21lLW90aGVyLWFzc2V0LWlkIiwgInZhbHVlIjogIjEyMzQ1QUJDIiwgImV4dGVybmFsU3ViamVjdElkIjogeyAia2V5cyI6IFsgeyAidHlwZSI6ICJHbG9iYWxSZWZlcmVuY2UiLCAidmFsdWUiOiAiaHR0cDovL215LW93bi1jb21wYW55LmNvbS9rZXlzIiB9IF0sICJ0eXBlIjogIkdsb2JhbFJlZmVyZW5jZSIgfSB9

would be decoded to

{ "name": "some-asset-id", "value": "http://example-company.com/myAsset", "externalSubjectId": { "keys": [ { "type": "GlobalReference", "value": "http://example-company.com/example-companys-asset-keys" } ], "type": "GlobalReference" } }

and

{ "name": "some-other-asset-id", "value": "12345ABC", "externalSubjectId": { "keys": [ { "type": "GlobalReference", "value": "http://my-own-company.com/keys" } ], "type": "GlobalReference" } }

Is this correct or am I missing something?

@cbiehl30 cbiehl30 added help wanted Extra attention is needed question Further information is requested labels Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant