fix: ASPA JSON deserialization failing on ASNs #134
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.
As far as I could tell, there is no consistent spec for how ASPA should be represented as JSON. Here are some examples i found in the wild:
#132 implements serialization to rpki-client notation, as well as serialization from rpki-client notation.
Unfortunately, this means that e.g. using RTRTR with Routinator leads to errors such as
Failed parsing source: invalid type: string "AS64500", expected u32
orFailed parsing source: missing field 'customer_asid'
.This PR implements support for deserializing all 3 notations, and changes serialization to krill notation, as it's the one with the most common ground between all, and therefore has the highest likeliness of a client being able to understand it.