The initializePkiConfigPath method was using a variable named
'instanceId' from getSystemValue('instanceid') which could be confused
with LibreSign's instance_id. Changed to 'systemInstanceId' for clarity
and consistency with getConfigPathByParams method.
This ensures the PKI directories are created in the correct appdata path
using Nextcloud's system instance ID, while the directory name itself
contains LibreSign's CA identifier with its own instance ID.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add NONE mode to valid flow provider and remove zero from
invalid numeric values since 0 is now a valid value (NONE).
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Hide preserve signing order toggle when there's only one signer,
as signing order is not applicable in this case.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add UI controls in RequestSignatureTab:
- Preserve signing order toggle switch
- View signing order diagram button
- Modal with SigningOrderDiagram component
- Sync preserve order state with file changes
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add visual diagram component showing signing flow with:
- Sender stage at top
- Numbered order stages with signers
- Status indicators (signed/pending/draft)
- NcPopover with detailed signer info
- Completed stage at bottom
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Enable users to change signature flow when updating file if admin
has not enforced a specific flow mode.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
When viewing a document to sign, users should only see their own
signature positions, not the positions of other signers.
This improves UX and privacy by filtering to show only the signature
elements for the current signer (where signer.me === true).
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add comprehensive validation for disabled identification methods:
- Check method status in canSignerActInOrder to centralize validation
- Hide menu actions (customize message, request signature, send reminder)
for signers with disabled methods
- Add hasSignersWithDisabledMethods computed property
- Hide "Setup signature positions" and "Request signatures" buttons
when any signer has a disabled method
- Show warning message when disabled methods are detected
- Always show signer's method in edit dialog even if disabled
- Pass disabled prop to IdentifySigner component
This ensures users cannot proceed with signature requests until all
signers have valid identification methods.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add detection of disabled identification methods in Signer component:
- Load identify_methods from state and check if method is enabled
- Add visual styling (reduced opacity, overlay) for disabled signers
- Add tooltip explaining why signer cannot be used
- Prevent click action when method is disabled
- Keep actions menu functional for delete/edit operations
This provides clear visual feedback when a signer's identification
method has been disabled by the administrator.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add support for displaying signers with disabled identification methods
in read-only mode. When disabled prop is true, the component shows:
- Warning message explaining the method is disabled
- Signer information in read-only mode
- No editable fields or action buttons
This allows users to view signer details even when the identification
method has been disabled by the administrator.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Change regex pattern from [a-z0-9]{10} (exactly 10 chars) to [a-z0-9]+
(one or more chars) to accept variable-length instance identifiers.
This makes tests more resilient to changes in instance ID generation
while maintaining validation of the CA ID format.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Update test to include required 'enabled' parameter in
signature flow configuration endpoint.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add switch control to enable/disable forced signature flow.
When enabled, shows parallel/sequential options. When disabled,
document creators can choose their preferred signing order.
Includes separate loading states for toggle and flow selection.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Return null instead of default value to allow frontend
to detect when admin has not enforced a signature flow.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Update setSignatureFlowConfig to accept enabled parameter.
When disabled, the signature_flow config key is deleted,
allowing document creators to choose their preferred order.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Changed CaIdentifierService to use system's instanceid from config.php
- Removed custom instance_id generation logic using ISecureRandom
- Updated unit tests to mock IConfig and verify correct instanceid usage
- This fixes race condition in certificate generation during integration tests
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
When Activity app doesn't know about LibreSign's notification settings
(common in test environments or fresh installations), we should allow
notifications by default instead of blocking them.
This fix checks if the Activity manager has the setting registered before
enforcing the admin setting. If the setting is not found, notifications
are allowed, respecting LibreSign's isDefaultEnabledMail() and
isDefaultEnabledNotification() which return true.
Fixes email and notification delivery in integration tests.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add integration tests for custom signer messages:
- Account method with and without custom description
- Email method with default and custom description via reminder
- Verifies description appears in email body before default message
- Uses Activity email notification settings in background setup
Tests cover the complete flow from request creation to email delivery.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add integration tests verifying acceptsEmailNotifications field in
account search endpoint:
- Returns true when both global and user settings enable notifications
- Returns false when user explicitly disables notifications
- Returns false when admin disables globally (even if user enables)
Tests cover Activity app integration and admin/user setting precedence.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add 'Customize message' action button in signature request sidebar for
signed requests. The button:
- Appears with Bell icon alongside other actions
- Opens signer identification modal for message editing
- Validates signer state, method, and email notification preferences
- Is hidden when signer already signed, for current user, or when
account method user doesn't accept email notifications
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add switch-based UI to enable custom messages for signers during
identification. The custom message field:
- Appears conditionally based on method and email notification settings
- Is hidden for account method when user doesn't accept email
- Supports up to 500 characters with 3-row textarea
- Resets when toggled off or signer changes to non-accepting account
- Is saved as part of signer data
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Update OpenAPI schemas to include acceptsEmailNotifications in
LibresignIdentifyAccount and description/displayName/notify in
LibresignNewSigner types.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Include acceptsEmailNotifications field in search results for account
method signers. This field indicates whether a user accepts email
notifications based on both Activity admin settings and user
preferences. Returns false when user has no email, Activity app is
unavailable, or notifications are disabled at admin or user level.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add description, displayName, notify, and acceptsEmailNotifications
fields to OpenAPI response type definitions for LibresignNewSigner
and LibresignIdentifyAccount.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Support custom signer descriptions in SMS, Signal, Telegram, WhatsApp,
and XMPP notifications. The description is prepended to the notification
message when provided, allowing personalized instructions through all
supported notification channels.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add explicit check for Activity admin (global) setting before checking
user preference for in-app notifications. This ensures consistency
across all notification channels and prevents users from enabling
notifications when disabled globally by the admin.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add explicit check for Activity admin (global) setting before checking
user preference in email notifications. This ensures that when an admin
disables email notifications globally, users cannot override it with
their personal settings. The admin setting acts as a gate that must be
enabled for user preferences to take effect.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add optional description parameter to notifyUnsignedUser and
notifySignDataUpdated methods. When provided, the custom message is
prepended to the email body, allowing personalized instructions for
signers.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Include signer description in notification metadata when incrementing
notification counter. This allows tracking custom messages sent to
signers for each notification attempt.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
When editing a signer, hide the search field since the signer is
already defined. Only show the search field when adding a new signer.
This simplifies the UI and prevents confusion.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
When editing an existing signer, display only the tab corresponding
to the identification method used by that signer (account, email, etc).
When adding a new signer, show all available tabs as before.
This prevents confusion and improves UX by focusing on the relevant
method for each context.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Save user's selected tab (Account/Email) in the 'Add new signer' modal
to userconfig store. The preference is now persisted across modal
closures and page reloads, improving user experience by remembering
the last selected identification method.
Changes:
- Add activeTab state to RequestSignatureTab component
- Load saved tab preference from userconfig store on mount
- Save tab changes to backend with debounce (500ms)
- Add signer_identify_tab to AccountService config output
- Use snake_case naming convention for consistency with backend
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add clickable links to Twig documentation (https://twig.symfony.com/)
in both Signature Stamp and Footer Template editor sections using
the v-linkify directive from @nextcloud/vue.
This improves user experience by providing direct access to Twig
syntax documentation when configuring custom templates.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>