Skip to content

feat(#231) : integrate pyhanko digital signature support on output PDFs - #699

Open
TheCoderGeekSquadLeader wants to merge 3 commits into
fireform-core:developmentfrom
TheCoderGeekSquadLeader:feature/digital-signatures-231
Open

TheCoderGeekSquadLeader wants to merge 3 commits into
fireform-core:developmentfrom
TheCoderGeekSquadLeader:feature/digital-signatures-231

Conversation

@TheCoderGeekSquadLeader

Copy link
Copy Markdown

Description

This pull request introduces digital signature support for generated output PDFs using pyhanko, addressing compliance requirements for legal incident reports submitted to public safety agencies.

Changes Made

  • Dependency : Added pyhanko to requirements.txt.
  • API Schemas : Updated FormFill and AsyncFormFill Pydantic models to accept an optional sign: bool = False flag.
  • Service Layer : Implemented cryptographic signing logic within FileManipulator._sign_pdf utilizing PKCS#12 certificates (.p12 / .pfx), with graceful fallbacks if no certificate path is provided.
  • Router Integration : Forwarded the sign parameter from API endpoints to the file manipulation controller.

Acceptance Criteria

  • Output PDFs can be optionally signed with a department-provided certificate (sign: true).
  • Unsigned behavior remains completely unchanged by default (sign: false).
  • Works seamlessly within the existing Docker and local environment setup.
  • Fully backward-compatible with all existing unit and benchmark tests (146/146 passing).

Closes #231

@marcvergees

Copy link
Copy Markdown
Member

Hi @TheCoderGeekSquadLeader again! That's definitely one of the most demanded issues in the industry right now based on what we've been talking with the people. We're just gonna keep that issue and pull request here for a little time cause we are right now focused on implementing and wiring, the frontend and the backend. But we're gonna come to this issue and pull request soon so that we can merge it.

As I was pointing out on the previous comment that you should have received in another issue, in open source projects, you might be first asking if issues can be assigned to yourself or not because there might be other people working on that simultaneously.

Thanks for your collaboration,
Marc

@marcvergees

Copy link
Copy Markdown
Member

Hi @TheCoderGeekSquadLeader!

I'm here back again! Since our frontend resulted to be smthg really functional we're back to this issue. Just let you know that you should create new branches in frontend and backend (maybe not backend cuz it's just front stuff) and implement the feature.

Basically, just let you know that in the frontend we should have a subtle new button somewhere before exporting the pdf so that the user could click it and say smthg like "Sign digitally" and then pop up a window or smthg like that so that you could select the certificate and decide where to add it.

Maybe it'd be interesting to think about if we could place digital signatures everywhere with fields "signature" automatically. Feel free to work on that, I can assign you the issue and you can create a respective issue in the frontend repo.

PD: how you feel about it @vharkins1?

Lmk if you have trouble.

Marc

@TheCoderGeekSquadLeader

Copy link
Copy Markdown
Author

Hi @marcvergees !

Thank you for the update and for trusting me with this ! I'd love to work on the digital signature feature using PyHanko.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT]: Digital Signature Support on Output PDFs

2 participants