Allow object in service endpoint #990
Open
+6,105
−7,170
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
According to did-core spec "The value of the serviceEndpoint property MUST be a string, a map, or a set composed of one or more strings and/or maps." This allows to use did dht with DIDComm protocol.
It still doesn't not handle "a set composed of more maps". I'm happy to add that to, but I wasn't sure about the approach. I see that txt data has this from:
but it felt a bit weird to add the stringified object to that
so I encoded the object as
base64Url
:Now, I don't know if the goal isn't to make the whole thing human readable, in that case it's not a good solution. On the other hand, if it's fine to use encoded values, it's a question if to encode the string also in the case it's a string or array of string separated by commas.
Happy to hear any thoughts or feedback on this.