Skip to content

fix: store the date that the file was signed #5230

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

vitormattos
Copy link
Member

Pull Request Description

The sign engine is used to sign the file and between the interval that the file was signed and the moment to save this at the database, is possible to be different. To prevent issues about different dates (seconds or milisseconds), I made a parse at signed file and after then, I fetch the last signature date to store this at signed field at the database.

The unit test that was changed don't validate this scenario because this test have a lot of mocks. I didn't implemented more tests because to sign a document will be necessary use the PKCS12 engine and to this will be necessary download a lot of dependencies making the unit test more slow.

Maybe would be good think more about how to implement more tests to cover this change.

Pull request checklist

  • Did you explain or provide a way of how can we test your code ?
  • If your pull request is related to frontend modifications provide a print of before and after screen
  • Did you provide a general summary of your changes ?
  • Try to limit your pull request to one type, submit multiple pull requests if needed
  • I implemented tests that cover my contribution

The sign engine is used to sign the file and between the interval that
the file was signed and the moment to save this at the database, is
possible to be different. To prevent issues about different dates
(seconds or milisseconds), I made a parse at signed file and after then,
I fetch the last signature date to store this at signed field at the
database.

Signed-off-by: Vitor Mattos <[email protected]>
@vitormattos vitormattos added this to the Next Major (32) milestone Jul 21, 2025
@vitormattos vitormattos self-assigned this Jul 21, 2025
@github-project-automation github-project-automation bot moved this to 0. Needs triage in Roadmap Jul 21, 2025
@vitormattos
Copy link
Member Author

/backport to stable31

@vitormattos
Copy link
Member Author

/backport to stable30

Copy link

@AntDavidLima AntDavidLima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there isn't any behat flow testing if this value is correct, it'd be nice to implement one, to alleviate the problem of not having a proper unit test.

Signed-off-by: Vitor Mattos <[email protected]>
@github-project-automation github-project-automation bot moved this from 0. Needs triage to 1. to do in Roadmap Jul 22, 2025
@vitormattos vitormattos marked this pull request as draft July 22, 2025 16:08
We will need to use the method generateCertificate at Pkcs7Handler that
is a child of SignEngineHandler.

Signed-off-by: Vitor Mattos <[email protected]>
Signed-off-by: Vitor Mattos <[email protected]>
@AntDavidLima AntDavidLima self-requested a review July 25, 2025 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 1. to do
Development

Successfully merging this pull request may close these issues.

3 participants