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

Co-sign data validation serializer is not compatible with co-sign v2 flow. #4308

Open
Tracked by #4791
sergei-maertens opened this issue May 17, 2024 · 1 comment
Open
Tracked by #4791

Comments

@sergei-maertens
Copy link
Member

sergei-maertens commented May 17, 2024

Product versie / Product version

master / stable versions

Omschrijf het probleem / Describe the bug

Discovered in #4305

The serializer used for (model field) validation only supports the legacy co-sign flow:

co_sign_data = models.JSONField(
_("co-sign data"),
blank=True,
default=dict,
validators=[SerializerValidator(CoSignDataSerializer)],
help_text=_("Authentication details of a co-signer."),
)

This highlights that the serializer is outdated, but also that it's not being called to check the input data.

Related information: #3149 has a bullet about moving the co sign data into a proper model rather than using a JSONField. The main problem here is that the shape of data is ambiguous/not clear from looking at the data model. The wrong serializer even describes an incorrect shape of data, which makes developing with this feature harder than it should be.

When we enforce validation on save, about 20 tests fail, per this comment

@sergei-maertens sergei-maertens added bug Something isn't working triage Issue needs to be validated. Remove this label if the issue considered valid. labels May 17, 2024
@joeribekker
Copy link
Contributor

Refinement: Related to #3283

@joeribekker joeribekker removed the triage Issue needs to be validated. Remove this label if the issue considered valid. label May 27, 2024
sergei-maertens added a commit that referenced this issue Dec 5, 2024
The PDF was including the cosign data/component for version 1 of cosign,
which is not compatible at all with v2 (see #4308), causing crashes.

Generally this doesn't matter since the PDF is generated right after
submission is received and before its cosigned, and we don't usually
need to re-generate it except during development.
sergei-maertens added a commit that referenced this issue Dec 6, 2024
The PDF was including the cosign data/component for version 1 of cosign,
which is not compatible at all with v2 (see #4308), causing crashes.

Generally this doesn't matter since the PDF is generated right after
submission is received and before its cosigned, and we don't usually
need to re-generate it except during development.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants