Repository navigation
refactor: remove proprietary callbacks in favor of native Nextcloud webhooks - #9426
Conversation
lfals
left a comment
There was a problem hiding this comment.
The removal looks complete to me: no reader of callback or webhook_sign_url is left, the remaining SignedEvent listeners are untouched, and the SignFileService constructor change is reflected in the tests. The legacy listener never fired on main (it checked getUpdatedFields()['signed'] on File, which has no such field), so this PR does not remove working behaviour.
Comments below are one correctness issue in the migration (Oracle), one product question (the ignored callback parameter), and two points about the backup.
The branch conflicts with main in the generated OpenAPI/TypeScript files, so the PHPUnit, Behat, Psalm and openapi jobs have not run on this head.
lfals
left a comment
There was a problem hiding this comment.
Follow-up on the latest commits. The earlier comments are resolved: the backup query uses nonEmptyString('callback'), both backups are announced through IOutput::info(), the CSV is fully built before anything is written to AppData, and the callback request parameter is an acknowledged contract decision.
One blocking regression remains, introduced by the new synchronous write: the CSV stream is closed twice, which aborts the migration on any instance that has a stored callback.
lfals
left a comment
There was a problem hiding this comment.
The follow-up looks good: the double-close on the callback backup stream is fixed by reading the CSV into a string before newFile(), and the earlier migration points (portable non-empty predicate, credential-safe IOutput::info, synchronous verified write) hold. Remaining SignedEvent / SigningRequestCompletedEvent paths are untouched.
Please resolve the conflicts with main (generated OpenAPI/TypeScript) so the full CI matrix can run on this head.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…pt fixtures Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
… writes Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
31d3757 to
70ae26b
Compare
Code Metrics ReportNote: Metrics describe the revision analyzed by the successful PHPUnit run. Newer commits with pending, canceled or failed checks may not yet be represented in this report.
Details | | main (f63d814) | #9426 (3233c2e) | +/- |
|---------------------|----------------|-----------------|-------|
+ | Coverage | 76.7% | 76.7% | +0.0% |
| Files | 512 | 511 | -1 |
| Lines | 28881 | 28843 | -38 |
- | Covered | 22176 | 22148 | -28 |
- | Test Execution Time | 2m22s | 3m16s | +54s |Code coverage of files in pull request scope (79.0% → 79.1%)
Reported by octocov |
Purpose
Remove the obsolete LibreSign HTTP callback mechanism from the unreleased development line (
main, LibreSign 16.0.0-dev / Nextcloud 36), replacing it with the existing nativeOCA\Libresign\Events\SigningRequestCompletedEventand Nextcloud Webhook Listeners.This supersedes #9423, which repaired a legacy listener we no longer intend to maintain. It does not remove internal
SignedEventevents used by Activity and notifications.Implementation
callback, the fallbackwebhook_sign_urlsetting, multipart HTTP transport, and listener.libresign_file.callbackand deleting obsolete app config; empty values produce no backup. Backup failure aborts migration.SigningRequestCompletedEventcontract and internalSignedEvent.Breaking migration
Nextcloud webhooks differ from the removed callback: no per-request destination URL and no pushed multipart PDF. Administrators install Webhook Listeners, register a subscription and configure Cron and receiver credentials. Integrators deduplicate by
eventId, reconcile using an authorized OCS identity, then recover the final PDF via authorized Nextcloud WebDAV. Previously stored callback destinations are preserved in LibreSign AppData, but no longer used by the signing workflow.Stable releases 13, 14, 15 are unchanged. LibreSign 16 is development, not stable. Documentation migration and example: LibreSign/documentation#130.
Evidence and status
Rebased the implementation onto
mainatf63d81447ba5e6bfec6266c55f9742cd60009728, preserving 11 separate signed/DCO commits. Resolved the previously blocking OpenAPI/TypeScript conflicts by runningcomposer openapiagainst the integrated backend; the existingNativeWebhookEventPublisherintroduced onmainremains intact. The resulting head is70ae26b4bb421be6223038496eab7eb3600de74f.Focused validation on the integrated code:
npm run ts:check: passed.composer openapi: passed; generated JSON and TypeScript API declarations updated.git diff --check: passed.The previous disposable NC36 QA exercised browser signing without login, native authenticated webhook POST from the worker, authorized signed PDF retrieval, negative permissions, two-signer partial vs complete, envelope, cancellation, and concurrent signing. The full post-rebase GitHub Actions/Behat/Playwright CI matrix must still complete before merging. No merge or deployment is authorized.