Skip to content

Add a FakeSignatureVerifier for development mode and TESTING builds (PR 21247 follow-up)#21543

Merged
Snuffleupagus merged 1 commit into
mozilla:masterfrom
Snuffleupagus:FakeSignatureVerifier
Jul 5, 2026
Merged

Add a FakeSignatureVerifier for development mode and TESTING builds (PR 21247 follow-up)#21543
Snuffleupagus merged 1 commit into
mozilla:masterfrom
Snuffleupagus:FakeSignatureVerifier

Conversation

@Snuffleupagus

@Snuffleupagus Snuffleupagus commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

Despite the enableSignatureVerification option/preference being enabled in development mode and TESTING builds, the lack of any SignatureVerifier implementation still renders the UI disabled.
This seems unfortunate, since it makes it more difficult to check that the digital signature UI works correctly:

  • That the button is visible when it's supposed to be, and that the panel can be opened/closed.
  • That the UI looks correct, w.r.t. the HTML elements and their CSS rules.
  • Currently the viewer JS code is effectively uncovered, with overall test-coverage dropping from 90 to 89 percent when PR Digital Signature and Certificate verification #21247 landed.

To improve the current situation this patch adds a FakeSignatureVerifier class, limited to only development mode and TESTING builds, that treats every digital signature as invalid.
This allows easier manual testing, and also the addition of a few very rudimentary integration-tests.

Note: It probably wouldn't be all that difficult to add additional integration-tests for valid certificates, by having the test-cases instruct (during setup) the FakeSignatureVerifier how to respond to simulate verified certificates.

@Snuffleupagus Snuffleupagus requested a review from calixteman July 5, 2026 11:30
@Snuffleupagus Snuffleupagus force-pushed the FakeSignatureVerifier branch from 5cbb331 to 08af15d Compare July 5, 2026 11:32
@codecov-commenter

codecov-commenter commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.72%. Comparing base (330cc4f) to head (c188012).
⚠️ Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
web/genericcom.js 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21543      +/-   ##
==========================================
+ Coverage   89.41%   89.72%   +0.31%     
==========================================
  Files         262      262              
  Lines       66738    66747       +9     
==========================================
+ Hits        59675    59890     +215     
+ Misses       7063     6857     -206     
Flag Coverage Δ
browsertest 66.53% <ø> (+0.03%) ⬆️
integrationtest 69.21% <75.00%> (+0.48%) ⬆️
unittest 57.34% <ø> (+<0.01%) ⬆️
unittestcli 56.29% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

… (PR 21247 follow-up)

Despite the `enableSignatureVerification` option/preference being enabled in development mode and TESTING builds, the lack of any `SignatureVerifier` implementation still renders the UI disabled.
This seems unfortunate, since it makes it more difficult to check that the digital signature UI works correctly:
 - That the button is visible when it's supposed to be, and that the panel can be opened/closed.
 - That the UI looks correct, w.r.t. the HTML elements and their CSS rules.
 - Currently the viewer JS code is effectively uncovered, with overall test-coverage dropping from `90` to `89` percent when PR 21247 landed.

To improve the current situation this patch adds a `FakeSignatureVerifier` class, limited to only development mode and TESTING builds, that treats every digital signature as invalid.
This allows easier manual testing, and also the addition of a few *very rudimentary* integration-tests.

*Note:* It probably wouldn't be all that difficult to add additional integration-tests for *valid* certificates, by having the test-cases instruct (during setup) the `FakeSignatureVerifier` how to respond to simulate verified certificates.

@timvandermeij timvandermeij left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me. Thank you for improving the coverage on this functionality!

@Snuffleupagus Snuffleupagus merged commit 6689097 into mozilla:master Jul 5, 2026
16 of 17 checks passed
@Snuffleupagus Snuffleupagus removed the request for review from calixteman July 5, 2026 21:21
@Snuffleupagus Snuffleupagus deleted the FakeSignatureVerifier branch July 5, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants