Repository navigation
fix(openapi): align signing request contracts with runtime behavior - #9505
Merged
vitormattos merged 17 commits intoNov 14, 2026
Merged
Conversation
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Contributor
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 (114c424) | #9505 (e2a3fb3) | +/- |
|---------------------|----------------|-----------------|-------|
+ | Coverage | 76.6% | 76.7% | +0.0% |
| Files | 512 | 512 | 0 |
| Lines | 28862 | 28867 | +5 |
+ | Covered | 22129 | 22158 | +29 |
- | Test Execution Time | 3m40s | 3m42s | +2s |Code coverage of files in pull request scope (56.8% → 59.4%, patch 91.6%)
Reported by octocov |
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…hods Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
… sentinel 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>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…ntext 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>
…oints Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
lfals
approved these changes
Nov 14, 2026
vitormattos
deleted the
fix/openapi-signing-request-contracts-20261114
branch
November 14, 2026 22:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Align LibreSign's OpenAPI source contracts with the actual PHP, Nextcloud request dispatcher, and frontend behavior while preserving reusable component references. No change to the Nextcloud OpenAPI extractor, no Composer patch, no new SDK generation mechanism, and no multipart work in this PR.
Related: #9089, #9435, #9437. Independently reassesses the open #9453 and #9454 without requiring their merge. Preserves already merged #9494, #9452 and #9490.
Changes in this PR
Signing and saved signature requests
signByFileId/signBySignerUuid.elementsas typed lists ofSigningElement(documentElementIdand optionalprofileNodeId), matching the UI.SavedSignatureElementand its update file as sharedSavedSignatureFile, rather than maps with object-valued properties.deviceGeolocationan optionalSignerDeviceGeolocation|nulland retain runtime compatibility with the legacy empty-array sentinel. The signing validator and metadata requirements remain authoritative.Signing-code requests and identification-document approval
identifyMethodandsignMethodso omitted values do not causeArgumentCountError; identification methods are configured strings, not a hardcodedaccount|emailenum.'true'|nullenum fromidDocApproval. Only the literal"true"selects the approval flow.?idDocApproval=trueas a query string for signing and requesting a code. Nextcloud's merged request parameters also accept this flag through the JSON body of the code endpoint: preserve both inputs. Do not fabricate a JSON body flag on the general signing operation. Unit tests cover query and body sources.Reusable policy contracts
RequestPolicy,RequestPolicyOverridesandPolicyActiveContextfor both create and update request bodies; enforce the documented group context shape using the existing backend rules.PolicyValueMapacross all four compound-policy write endpoints instead of four copies ofarray<string, mixed>. Its values reference the existingEffectivePolicyValuemodel, preserving consistent policy-value handling.Account configuration values
valueinput directly inAccountController::setConfig, using a sharedUserConfigValuealias for scalar values, arrays and objects. The Nextcloud dispatcher resolves named request parameters correctly."1"/"0", numbers to strings, and arrays to JSON beforeIUserConfig::setValueString, retaining existing persisted formats. Null is rejected; existing preference-clear behavior uses the empty string. Unit tests cover strings, booleans, integers, decimals, empty arrays, nested JSON and null.Evidence and regeneration
composer openapiran in the GitHub Actions environment and produced all six required artifacts (openapi*.jsonand matchingsrc/types/openapi/*.ts, including administration scope). The outputs were committed from its own CI diff, not hand-edited.Deliberate boundaries and remaining extractor/SDK limitations
mixedvalues insidearray<string,mixed>andlist<mixed>toobject, although arbitrary JSON scalars can be valid there. A recursive alias was tested and reverted after the current PHPDoc parser and Psalm rejected it. The top-level source contracts are improved, but nested JSON remains an upstream extraction limitation. Do not replace it with a falsely restricted list of policy objects.descriptionanddefaultsiblings of$refmay be ignored. We intentionally preserve shared references instead of inlining duplicate schemas or changing PHP defaults just to placate a generator; proper reference metadata needs extractor/spec-compatible support. In particular, an empty PHP-array default on an object-valued map does not guarantee an SDK-friendly JSON-object default.idDocApprovalis accepted as a query flag by the Nextcloud middleware, but the current extractor cannot explicitly represent the indirectly read query parameter. The code endpoint's supported body input is retained. The frontend/query behavior is documented in the operation text.SignerDeviceGeolocationuses a nullableallOf/$refwrapper; generators should omit it when absent, and older direct clients can still send[].typescript-axiosSDKs; policy union fidelity and other limitations still require validation.Reviewer focus
Verify that the generated JSON matches real callers, particularly code-request query/body handling, account-config persistence, compound-policy map references and authorization/validation boundaries. The final CI matrix must pass before merge consideration. No merge or backport is requested.