You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When originally implmented, psatoken eschewed the "standard" marshaler/unmarshaler interfaces defined by the encoding libraries (e.g. UnmarshalCBOR) and defined its own methods (e.g FromCBOR) that tied validation and marshaling. This proved problematic in some situations, so "unvalidated" versions of the methods were later added (e.g. FromUnvalidatedCBOR), which did not do validation as part marshaling. As a result, the current marshaling solution deviates from Golang norms and is confusing.
Proposed solution: we should switch to standard (un)marshaler interface implementations (i.e. just implement MarshalCBOR, UnmarshalCBOR, MarshalJSON, and UnmarshalJSON), and perform validation as a distinct operation.
The text was updated successfully, but these errors were encountered:
When originally implmented,
psatoken
eschewed the "standard" marshaler/unmarshaler interfaces defined by the encoding libraries (e.g.UnmarshalCBOR
) and defined its own methods (e.gFromCBOR
) that tied validation and marshaling. This proved problematic in some situations, so "unvalidated" versions of the methods were later added (e.g.FromUnvalidatedCBOR
), which did not do validation as part marshaling. As a result, the current marshaling solution deviates from Golang norms and is confusing.Proposed solution: we should switch to standard (un)marshaler interface implementations (i.e. just implement
MarshalCBOR
,UnmarshalCBOR
,MarshalJSON
, andUnmarshalJSON
), and perform validation as a distinct operation.The text was updated successfully, but these errors were encountered: