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

Introduce DocumentState for FIPSCertificate class #464

Open
adamjanovsky opened this issue Jan 13, 2025 · 3 comments
Open

Introduce DocumentState for FIPSCertificate class #464

adamjanovsky opened this issue Jan 13, 2025 · 3 comments
Labels
fips Related to FIPS 140 certification refactoring Need to cleanup and refactor

Comments

@adamjanovsky
Copy link
Collaborator

The DocumentState class is stored for various documents associated with CCCertificate class. The same class should be used to hold data in FIPSCertificate instances

@adamjanovsky adamjanovsky added the refactoring Need to cleanup and refactor label Jan 13, 2025
@J08nY J08nY added the fips Related to FIPS 140 certification label Jan 27, 2025
@J08nY
Copy link
Member

J08nY commented Feb 14, 2025

Connected to this, there is quite a bit of deduplication possible. See what I have done in 5e983ef. Essentially, all of the boilerplate functions on the certificate objects that get parallelized: download_pdf, convert_pdf, extract_pdf_meta, extract_keywords are essentially the same for CC and PP and the only thing that changes is the: link, DocumentState object they store the results to and PdfData object they store the filename to. With FIPS unifying to use DocumentState we could simplify this greatly.

@adamjanovsky
Copy link
Collaborator Author

Yes, I've seen that while copying the new functionality for PPs straight from the CC implementation. I didn't want to handle the abstraction at that time. Essentially, you just want to specify the action (download, convert, extract), the source attribute and the target attribute. Then you just execute.

@J08nY
Copy link
Member

J08nY commented Feb 14, 2025

The thing is that apart from DocumentState the methods set the "*_filename" attribute of PdfData. So basically there needs to be consistency between those two classes, and there is nothing enforcing it (be it typing or something at runtime) if we move to the getattr/setattr implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fips Related to FIPS 140 certification refactoring Need to cleanup and refactor
Projects
None yet
Development

No branches or pull requests

2 participants