Skip to content

[stable33] fix: use the approver's own identity when signing an identification document - #8390

Merged
vitormattos merged 4 commits into
stable33from
backport/8381/stable33
Sep 13, 2026
Merged

vitormattos merged 4 commits into
stable33from
backport/8381/stable33

Conversation

@backportbot-libresign

@backportbot-libresign backportbot-libresign Bot commented Sep 13, 2026

Copy link
Copy Markdown

Backport of #8381

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Review and verify the backported changes
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

…ocument

fix: use the approver's own identity when signing an identification document

When an approver opened an identification document uploaded by an

external signer, three steps disagreed about whose identity was being

used, while the signing step (getOrCreateApproverSignRequest()) already

signed with the approver's account:

- SettingsLoader::loadApproverSignatureMethods() exposed the signature

  methods of the sign request stored in the id docs row, i.e. the

  uploader's methods — for an external signer, an emailToken bound to

  their masked email address.

- The verification code endpoint only knew signer uuids, so the file

  uuid the approver route carries answered "Invalid data to sign file".

- ModalVerificationCode.requestCode() looked for a signer with me: true,

  which an approver never is, and failed locally with "Document not

  found".

Make the whole flow use the same rule as signing:

- IdentifyMethodService::getSignMethodsOfAccount() builds the account

  identify method of a user in memory and returns its enabled signature

  methods; SettingsLoader uses it for the approver. Nothing is persisted:

  viewing the document does not create the approver's sign request.

- SignFileController::requestCodeBySignerUuid() accepts the same

  idDocApproval=true context as sign(): the uuid is resolved as the

  identification document (already authorized by the middleware) and the

  approver's sign request is created or reused before the code is sent.

- The frontend takes one route/context decision for signing and for

  requesting the code (isIdDocApprovalContext(), used by buildSignUrl()

  and the new buildRequestCodeUrl()); the modal uses

  getSigningRouteUuid() like Sign.vue does.

Tests use different identities for the uploader (external@example.com,

emailToken) and the approver (account "approver") and assert that the

uploader's methods and sign request never reach the approver flow.

Resolves: #8365

Assisted-by: Claude Code:claude-opus-5

Signed-off-by: André Maia <andrefnkmm@gmail.com>

[skip ci]
Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
@vitormattos
vitormattos marked this pull request as ready for review September 13, 2026 21:10
@vitormattos
vitormattos requested a review from a team as a code owner September 13, 2026 21:10
@github-project-automation github-project-automation Bot moved this from 0. Backlog to 1. to do in Roadmap Sep 13, 2026
Signed-off-by: Vitor Mattos <vitor@php.rio>
@vitormattos
vitormattos force-pushed the backport/8381/stable33 branch from 4759447 to 48ff443 Compare September 13, 2026 22:05
@vitormattos
vitormattos merged commit aedbd6b into stable33 Sep 13, 2026
64 checks passed
@vitormattos
vitormattos deleted the backport/8381/stable33 branch September 13, 2026 22:21
@github-project-automation github-project-automation Bot moved this from 1. to do to 4. to release in Roadmap Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 4. to release

Development

Successfully merging this pull request may close these issues.

2 participants