Skip to content

Feat/community enhancements and fixes - #2347

Open
snxRCS wants to merge 253 commits into
OpenSignLabs:stagingfrom
snxRCS:feat/community-enhancements-and-fixes
Open

snxRCS wants to merge 253 commits into
OpenSignLabs:stagingfrom
snxRCS:feat/community-enhancements-and-fixes

Conversation

@snxRCS

@snxRCS snxRCS commented Nov 19, 2026

Copy link
Copy Markdown
## Overview
This PR consolidates critical community bug fixes, security remediations, UX parity enhancements, and format
integrations into a cohesive, fully-tested release branch.

All changes have been validated through end-to-end unit test suites and verified production builds in automated
GitHub Actions CI.

---

### Key Improvements & Fixes

#### 1. Security & Authorization Hardening
- **#2253 / #2281:** Removed default hardcoded Parse Server Master Key from configuration and templates.
- **#2205 / #2311:** Secured `getsignedurl` to mandate document lookups and prevent unauthorized token minting.
- **#2218 / #2290:** Restricted `getDocument` queries to an allowlist to prevent PII and metadata leaks.
- **#2271 / #2283:** Added strict expiration, rate limiting, and single-use enforcement to guest OTP
authentication.
- **#2181:** Prevented path traversal in PDF decryption upload by employing randomized UUID storage.
- **#2198:** Enforced email normalization (lowercased & trimmed) during user registration.

#### 2. Signing Workflow & PDF Integrity
- **#2340 / #2339:** Preserved certificate issuer intact in CMS signer identifier when containing non-ASCII
characters.
- **#2341:** Preserved document metadata when rebuilding uploaded PDFs.
- **#2267 / #2284 & #2269:** Enforced document expiry and prevented re-signing of completed documents via
`signPdf`.
- **#2270 / #2282:** Fixed audit trail race condition where "Viewed" actions could overwrite "Signed" status.
- **#2272 / #2285:** Ensured idempotent retry for completion certificate generation.
- **#2090 / #2305:** Preserved existing digital signatures during PDF flattening.
- **#2016 / #2312:** Hardened signing flow resilience against malformed PDFs.
- **#2239:** Replaced fragile `print-js` with isolated iframe blob printing for reliable document printing across
browsers.

#### 3. Field UX & PandaDoc Parity
- **#2275 & #2274:** Inline in-field editing for text, dropdowns, and checkboxes, plus keyboard copy/paste and
linked fields.
- **#2263:** Multiline support and proportional line height (1.25) calculation for prefill widgets.
- **#2342:** Synchronized dark mode preference across user devices and sessions.
- **#2185 / #2314:** Allowed updating user profile email with OTP verification.
- **#2197 / #2299:** Confirmation modal now properly aborts sending if declined.

#### 4. New Formats & Integrations
- **#2155:** Native Excel spreadsheet upload (`.xlsx`, `.xls`) with automated LibreOffice PDF conversion and
concurrency queuing.
- **#2154:** Resilient webhook dispatcher with HMAC-SHA256 payload signing and retry backoff.
- **#2261 / #2280:** Lazy S3 client initialization on startup (prevents crashes when running `USE_LOCAL=true`).

#### 5. Internationalization (i18n)
- **#2252:** Added Simplified Chinese (`zh`) language support.
- **#2112:** Added Japanese (`ja`) language support.

---

### Verification & Testing
- Automated Jasmine unit tests for backend: **Passed**
- Automated Vitest unit tests & Vite production bundle for frontend: **Passed**
- Container images built and tested successfully.

alfonsodg and others added 30 commits October 19, 2026 16:43
…Labs#2274)

Sub-phase A: text widgets (text, textInput, name, company, job title, email)
become directly editable in the template/placeholder authoring flow, updating
the underlying widget value in place instead of only via the lower panel.
Signing flow keeps read-only guided behavior.

Ref OpenSignLabs#2274

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Sub-phase B (part 1): dropdown widgets become directly selectable in the
template/placeholder authoring flow, updating the value in place.

Ref OpenSignLabs#2274

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Sub-phase B (part 2): checkbox widgets become directly toggleable in the
template/placeholder authoring flow.

Ref OpenSignLabs#2274

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
- Add ignoreEncryption to PDFDocument.load calls (client + server)
- Import missing PDFName in acroFieldExtractor
- Remove manual multipart content-type (decryptPdf, docxtopdf)

Ref OpenSignLabs#2259

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
…ow (OpenSignLabs#2274)

Inline editing: clicking a widget in template/placeholder authoring no longer
opens the WidgetsValueModal bottom panel; value editing happens in the field.
Settings remain available via the gear icon.

Ref OpenSignLabs#2274

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
…bs#2274)

Text widgets are now directly editable in the signing (filling) flow; the
bottom WidgetsValueModal no longer auto-opens on click for text fields.
Non-text widgets (signature, image, stamp, date, checkbox, dropdown) keep
the guided modal flow.

Ref OpenSignLabs#2274

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
…rence) (OpenSignLabs#2274)

Ref OpenSignLabs#2274

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
…f-sign flow

Ref OpenSignLabs#2274

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
…ebug log (OpenSignLabs#2274)

Ref OpenSignLabs#2274

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
…lume (OpenSignLabs#1750)

Ref OpenSignLabs#1750

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
…PFX check (OpenSignLabs#2016)

Ref OpenSignLabs#2016

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
… getSignedUrl (OpenSignLabs#2205)

Ref OpenSignLabs#2205

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
…rt size) (OpenSignLabs#1968)

Ref OpenSignLabs#1968

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Ref OpenSignLabs#1936

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
…rSign (OpenSignLabs#2207)

Ref OpenSignLabs#2207

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
alfonsodg and others added 28 commits November 17, 2026 19:23
)

ESM evaluates imports before the entry point body, so appConfig's getServerConfig ran before index.js dotenv.config() and froze cloudServerUrl to defaults on .env-file-only boots (regression from OpenSignLabs#76, whose old Utils.js loaded dotenv itself). Regression spec spawns a clean-env node process with a temp .env and asserts the URL. Ref OpenSignLabs#85
…bs#49)

CheckAdminExist kept its own literal role list while deleteUserByAdmin moved to the shared constant. Same three values, so no behavior change; this removes the last drift source. Ref OpenSignLabs#49
…s#49)

The shared-constant import used one ../ too many and resolved outside the server package, crashing cloud-code load at boot. Fixed path plus a wiring spec that imports the module. Ref OpenSignLabs#49
…gnLabs#49)

The spec lives in spec/ while the module lives in cloud/parsefunction/. Ref OpenSignLabs#49
Signed PDFs could not be verified when the signing certificate's issuer
contains non-ASCII characters. node-forge keeps certificate name values
as raw bytes but UTF-8 encodes UTF8String values again when it writes
the SignerInfo, so an issuer such as "CN=Acme — CA" is written as
mojibake and no longer matches the embedded certificate. It also
flattens multi-valued RDNs. Verifiers then report "signer certificate
not found" even though the document was marked as completed.

Add IssuerPreservingP12Signer, a thin P12Signer subclass that copies the
exact issuer DER from the signing certificate into the SignerInfo after
signing. The issuer is not part of the signed attributes, so the
signature stays valid. Signatures whose issuer is already faithful, such
as ASCII issuers, are returned byte-for-byte unchanged.

Use the new signer for document signing and for both completion
certificate paths. Add a jasmine spec and a "test" script, using the
jasmine dev dependency that is already declared.

Fixes OpenSignLabs#2339
Keywords, title, author and other document information were lost as soon
as a PDF was uploaded. The upload form always builds the stored file with
PDFDocument.create() and copyPages(), even for a single file, and that
only carries over the pages. Reordering pages drops the metadata in the
same way. Later steps, including flattening and signing, keep the
metadata, so the signed PDF came back with these fields blank.

Add copyPdfMetadata, which copies the information dictionary to the new
document, including custom entries. Use it when reordering pages, and in
a new mergePdfBuffers helper that replaces the inline merge in the upload
form. A merged document keeps the metadata of the first file, matching
how the form already derives the document title from the first file.

Add vitest coverage and a "test" script, using the vitest dev dependency
that is already declared.

Fixes OpenSignLabs#2140
The dark mode choice only lived in localStorage, so it was lost on a new
browser or device, after clearing browser data, and on logout, which
clears localStorage.

Store the choice as a new Theme field on contracts_Users. updatepreferences
accepts "dark" or "light", rejects anything else, and accepts Theme as the
only preference in a request. ThemeToggle saves the choice for signed in
users, and still applies it on the device if saving fails. Every login
path in Login.jsx then applies the saved theme before redirecting, so the
header toggle starts in the right state. Users who never chose a theme
have no saved value and keep the theme of their device.

Add jasmine and vitest coverage and a "test" script for each app, using
the dev dependencies that are already declared.

Fixes OpenSignLabs#2045
Add webhookDispatcher.js to send secure, reliable webhook events
from OpenSignServer to user-configured endpoints.

Key improvements over a naive HTTP call:
- **HMAC-SHA256 signature** (X-OpenSign-Signature) on every payload,
  allowing receiving servers to verify authenticity and prevent MITM/
  replay attacks.
- **Smart exponential backoff** (2 s → 4 s → 8 s): retries on network
  failures and 5xx errors; drops 4xx immediately to avoid wasting CPU
  on permanent client-side misconfigurations.
- **Idempotency-Key** header (os_evt_{eventId}_attempt_{n}) so
  receiving servers can safely deduplicate retries and prevent double
  processing (e.g., a document being 'signed' twice on network glitch).
- **Structured result object** with success, �ttempts, statusCode,
  error, and isRetryable — enabling callers to log and audit every
  delivery outcome.

Files added:
- �pps/OpenSignServer/cloud/parsefunction/webhookDispatcher.js
  Core dispatcher module. Pure ESM, zero new dependencies (uses axios
  already present in OpenSignServer and Node.js built-in crypto).
- �pps/OpenSignServer/spec/webhookDispatcher.test.js
  16-case Jest test suite covering: signature integrity, determinism,
  successful delivery, header correctness, 5xx smart retry, network
  timeout retry, 429 retry, non-retryable 4xx blocking (6 status codes),
  MAX_RETRIES exhaustion, and idempotency key increment per attempt.
- Add 'zh' to the allowed languages whitelist in src/i18n.js

- Add 中文 option to the language selector in src/components/pdf/SelectLanguage.jsx

- Add complete public/locales/zh/translation.json (1334 top-level keys, 100% aligned with en/translation.json)
@vercel

vercel Bot commented Nov 19, 2026

Copy link
Copy Markdown

@snxRCS is attempting to deploy a commit to the prafull 's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

6 participants