Closed TimoGlastra closed 1 year ago
Where do Aries RFC standards instruct implementations to ignore extra fields please? Aca-py is strict everywhere and introducing this novelty will invite a revamp of all sub-messages in all protocols to weaken the effect of having a standard at all.
Maybe I'm incorrect, that's just the general feeling I got from reading the RFCs. After searching trough the RFC repo I can't find it stated explicitly for all fields, only decorators and version mismatches.
I think this line in the decorators RFC threw me off:
- As with all other aspects of DIDComm messages, unrecognized fields in decorators must be ignored.
It's in the Protocols RFC in the Semver section - https://github.com/hyperledger/aries-rfcs/tree/master/concepts/0003-protocols#semver-rules-for-protocols
@swcurran what I get from that text is that it is OK to add new optional fields or to deprecate existing fields when bumping a minor version, not that implementations should ignore extra fields for an existing version.
I'm trying to figure out if we need to revamp our whole approach. I think it could mean small code changes with enormous semantic and testing implications if we have to accept what looks today like garbage and sift through it to find what we want. Hundreds of message types are in scope, but they all inherit from the same 2 or 3 ancestors ultimately.
My understanding is that when @nrempel did the "minor/major" version handling, this was part of it.
But you raise a great point - should we accept extra fields if we know the claimed version of the message? If it is a higher minor version then clearly yes, but if it is one we know what should be done? My understanding from the discussions around the "protocols" RFC was yes, we should ignore those as well, but I'm not so sure.
I can do up a prototype and see what damage there is to mitigate. I may be overreacting.
update: prototyping this is a big undertaking. Marshmallow. I'm parking this effort for now.
Either way, I think we should update the protocols RFC to explicitly state whether extra fields MAY, SHOULD or MUST be ignored / accepted as this clearly creates ambiguity.
Closing this. Clarifications have been made to RFC 0003 Protocols.
This issue came to surface when testing interoperability between framework .NET and ACA-Py.
Framework .NET includes an
@id
property in the Credential Preview sub message. This is not in line with the RFC, but from what I understand, fields that are not mentioned in the RFCs should be ignored instead of rejected. So maybe ACA-Py should also allow it?Corresponding .NET issue: https://github.com/hyperledger/aries-framework-dotnet/issues/117