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

Removing Whitespaces before base64Url encoding #199

Open
1 task done
arnoweiss opened this issue Nov 7, 2023 · 2 comments
Open
1 task done

Removing Whitespaces before base64Url encoding #199

arnoweiss opened this issue Nov 7, 2023 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@arnoweiss
Copy link

What happens?

Base64url encoding is sensitive to whitespaces (like new lines). The spec makes no statements where Whitespaces in Base64Url-encoded json-payloads should be removed - serverside or clientside.

Why is this wrong?

If the servers assume that clients remove whitespaces, they will not match json-structures that are in fact equivalent.

How should it be fixed?

Make statement if server or client should remove whitespaces.

  • I have signed the required Developer Certificate of Origin (DCO) already.
@arnoweiss arnoweiss added the bug Something isn't working label Nov 7, 2023
@arnoweiss arnoweiss mentioned this issue Nov 9, 2023
@sebbader-sap
Copy link
Contributor

As we did not write anything demanding the removal of whitespaces, or line breaks etc., therefore I'd say adding a note like this should solve it:

Note 1: Clients may clean the serialised content by removing white spaces before applying the base64url encoding. However, servers must not expect it, therefore, must not expect that different encoded parameters map to different (unencoded) data objects. In fact, the same AAS data object could be encoded through different encoded values.

or similar...

@sebbader-sap sebbader-sap added this to the 3.1 milestone Nov 9, 2023
@arnoweiss
Copy link
Author

Yea, I like the approach. It should basically convey "Do the matching on the level of AAS-objects - not on encoded strings or unencoded json."

Adjacent topics:

  • Given order of unordered elements (like in assetIds) is something else that must be ignored. When matching on the json-level, order would be considered as json assumes it in every list.
  • Matching only a subset of the assetIds.
    • What happens when server holds object with specificAssetIds a, b, c and Client makes request for specificAssetIds a, b?
  • Is the existence of optional fields (like specificAssetId/semanticId) relevant for matching?
    • Server holds semanticId for specificAssetId a, Client makes request without semanticId
    • Server holds no semanticId for specificAssetId a. Client makes request with semanticId.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants