Skip to content

refactor: extract PKCS#12 credentials to separate interface - #8358

Open
Rolf39 wants to merge 2 commits into
LibreSign:mainfrom
Rolf39:refactor/pkcs12-contract
Open

refactor: extract PKCS#12 credentials to separate interface#8358
Rolf39 wants to merge 2 commits into
LibreSign:mainfrom
Rolf39:refactor/pkcs12-contract

Conversation

@Rolf39

@Rolf39 Rolf39 commented Sep 11, 2026

Copy link
Copy Markdown

Refactored PKCS#12 credential handling methods into a dedicated IPkcs12SignEngineHandler interface to separate concerns from ISignEngineHandler.

📋 Checklist

  • I have read and followed the contribution guide.

🤖 AI

  • The content of this PR was partially or fully generated using AI.

@Rolf39
Rolf39 requested a review from a team as a code owner September 11, 2026 02:52
@github-project-automation github-project-automation Bot moved this to 0. Backlog in Roadmap Sep 11, 2026
Comment thread lib/Handler/SignEngine/IPkcs12SignEngineHandler.php Outdated
Comment thread lib/Handler/SignEngine/IPkcs12SignEngineHandler.php
@github-project-automation github-project-automation Bot moved this from 0. Backlog to 1. to do in Roadmap Sep 11, 2026
@vitormattos

Copy link
Copy Markdown
Member

@Rolf39

Rolf39 commented Sep 11, 2026

Copy link
Copy Markdown
Author

Done! I updated the namespace to OCA\Libresign\Handler\SignEngine, added the declare(strict_types=1); statement along with the SPDX license header, and ensured a newline at the end of the file.

Rolf39 added a commit to Rolf39/libresign that referenced this pull request Sep 12, 2026
@Rolf39
Rolf39 force-pushed the refactor/pkcs12-contract branch from 7732c9a to 8f76f9d Compare September 12, 2026 02:12
@Rolf39

Rolf39 commented Sep 12, 2026

Copy link
Copy Markdown
Author

Done, aligned with project conventions and signed-off.

@Rolf39
Rolf39 requested a review from vitormattos September 12, 2026 02:19

@vitormattos vitormattos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the updates. There are several failing checks now, but many of them seem to be cascading from the same issue rather than being separate problems.

The namespace in IPkcs12SignEngineHandler.php is still not correct. Since the file is located at:

lib/Handler/SignEngine/IPkcs12SignEngineHandler.php

the namespace should be:

OCA\Libresign\Handler\SignEngine

It is currently:

OCA\Libresign\SignEngine\Handler

Because of this, Composer reports that the class does not follow the PSR-4 autoloading rules and skips it. Then other checks fail when LibreSign tries to load the interface, for example with:

Interface "OCA\Libresign\SignEngine\Handler\ISignEngineHandler" not found

This is also why some larger workflows, such as the Playwright tests, fail during setup before the actual tests can run.

I suggest fixing this namespace first and then letting CI run again. After that, we can check whether there are any remaining code failures that need separate fixes.

There are also two separate Git history checks that still need attention: the DCO sign-off and the commit that does not follow the Conventional Commits format. Those are independent from this code issue.

@Rolf39

Rolf39 commented Sep 12, 2026

Copy link
Copy Markdown
Author

Done, updated the namespace and merged main branch into this PR.

@vitormattos

Copy link
Copy Markdown
Member

The namespace is correct now, thanks.

There are still two blocking issues:

  1. Static analysis is failing because SignFileService still uses ISignEngineHandler while calling PKCS#12-specific methods such as readCertificate() and setCertificate(). Please update those type declarations to use the correct interface.

  2. The Conventional Commits check is still failing because of the commit:

complete libresign task Closes #8358

Since you need to rewrite the commit history anyway, please also prefer rebasing on main instead of merging main into the PR branch. This avoids unnecessary merge commits and keeps the history easier to review.

Please check the failing workflows and update the branch accordingly.

Rolf39 added a commit to Rolf39/libresign that referenced this pull request Sep 13, 2026
@Rolf39
Rolf39 force-pushed the refactor/pkcs12-contract branch from 33ada3d to 32dc58e Compare September 13, 2026 01:07
Signed-off-by: Rolf39 <ahmedrolf39@gmail.com>
@Rolf39
Rolf39 force-pushed the refactor/pkcs12-contract branch from 84214e5 to 87ef6b1 Compare September 13, 2026 01:20
@Rolf39

Rolf39 commented Sep 13, 2026

Copy link
Copy Markdown
Author

Hi @vitormattos, I have updated SignFileService to use IPkcs12SignEngineHandler and fixed the commit formatting along with the DCO sign-off. Could you please take another look? Thank you!

@Rolf39

Rolf39 commented Sep 13, 2026 via email

Copy link
Copy Markdown
Author

@Rolf39
Rolf39 requested a review from vitormattos September 13, 2026 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 1. to do

Development

Successfully merging this pull request may close these issues.

2 participants