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

Don't compact arrays #98

Merged
merged 3 commits into from
Dec 1, 2023
Merged

Don't compact arrays #98

merged 3 commits into from
Dec 1, 2023

Conversation

reinkrul
Copy link
Member

This makes it hard to predict what the marshalled JSON object will look like, meaning things like creating presentation submissions will be harder. E.g., input descriptor mapping path can be indexed or not, depending on the number of VCs in the VP.

We also incorrectly applied the principal to serviceEndpoint, fixed that as well.

We should still support parsing compacted arrays, of course.

Copy link
Member

@gerardsn gerardsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this break validation, signature checking, etc. on existing docs/VC/VP?

did/document.go Show resolved Hide resolved
@gerardsn
Copy link
Member

Does this break validation, signature checking, etc. on existing docs/VC/VP?

is that a no?

@reinkrul
Copy link
Member Author

reinkrul commented Dec 1, 2023

Does this break validation, signature checking, etc. on existing docs/VC/VP?

is that a no?

Now I think of it, we need to check whether JSON-LD signature validation now fails. If existing VCs are unmarshalled/marshalled again using the MarshalJSON methods, the signature might change (since a compacted array became uncompacted).

@woutslakhorst
Copy link
Member

Now I think of it, we need to check whether JSON-LD signature validation now fails. If existing VCs are unmarshalled/marshalled again using the MarshalJSON methods, the signature might change (since a compacted array became uncompacted).

The signature is computed over quads. The quads for an object or array of size 1 are the same. So "should" be ok.

@reinkrul
Copy link
Member Author

reinkrul commented Dec 1, 2023

Tested JSON-LD signatures, feeding the signature checking an uncompacted array does not influence the outcome.

@reinkrul reinkrul merged commit 3abeed3 into master Dec 1, 2023
1 check passed
@reinkrul reinkrul deleted the dont-compact-arrays branch December 1, 2023 09:12
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

Successfully merging this pull request may close these issues.

3 participants