Skip to content

feat: policy signature flow#7366

Open
vitormattos wants to merge 490 commits intomainfrom
feat/policy-signature-flow-phase1-groundwork
Open

feat: policy signature flow#7366
vitormattos wants to merge 490 commits intomainfrom
feat/policy-signature-flow-phase1-groundwork

Conversation

@vitormattos
Copy link
Copy Markdown
Member

@vitormattos vitormattos commented Apr 1, 2026

No description provided.

@github-project-automation github-project-automation bot moved this to 0. Needs triage in Roadmap Apr 1, 2026
@vitormattos vitormattos force-pushed the feat/policy-signature-flow-phase1-groundwork branch 2 times, most recently from d422bd0 to da50ad0 Compare April 7, 2026 15:51
@vitormattos vitormattos changed the title feat: policy signature flow phase1 groundwork feat: policy signature flow Apr 7, 2026
@vitormattos vitormattos force-pushed the feat/policy-signature-flow-phase1-groundwork branch from ccd664a to 6146425 Compare April 9, 2026 00:06
…tate

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>
…t auto-highlight

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…y cues

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>
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>
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>
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>
Add new AddFooterPolicy to the policy system enabling footer visibility
control. The policy determines whether the LibreSign footer block is
included in signed PDFs. This consolidates footer enablement under the
policy-driven architecture.

Changes:
- Created AddFooterPolicy provider with boolean normalization
- Registered provider in PolicyProviders registry
- Updated FooterHandler to use policy via PolicyService for runtime
  enabling/disabling of footer rendering
- QR code generation is automatic when policy is enabled and validation
  URL is present (no separate toggle required)

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Restore the hierarchical structure where footer enablement controls
visibility of QR code and customization options. When user enables
'Add visible footer', both QR code toggle and template customization
become available.

The footer policy was already implemented server-side; this change
restores the user-facing UI toggles for client-side AppConfig
persistence while the policy controls the actual runtime behavior.

Structure:
- Top-level toggle: 'Add visible footer' (policy-driven)
- Nested under footer toggle:
  - QR code toggle (client AppConfig)
  - Validation URL input (shown when QR enabled)
  - Template customization toggle
  - Footer template editor component

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Update test expectations to reflect:
1. Restored hierarchical structure in Validation.vue UI
2. AppConfig mocking restored for FooterTemplateEditor dimension
   persistence
3. 5 API calls expected (vs 2) for loading all validation settings
4. AppConfig spy assertions for dimension persistence

Both test suites pass with updated expectations aligned to restored UI.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add Workbench integration for the AddFooterPolicy:
1. AddFooterScalarRuleEditor component for boolean selection (Enabled/Disabled)
2. realDefinition in footer/realDefinition.ts with localized labels
3. Register footer setting in realDefinitions.ts catalog

Allows admins to configure footer enablement rules  through Policy Workbench
UI with clear descriptions of enabled vs disabled states and override
inheritance behaviors.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add comprehensive unit tests for AddFooterPolicy:
- Provider builds correct policy definition
- Key is 'add_footer'
- Default system value is true
- Allowed values are [true, false]
- Normalizer handles boolean-like values correctly ('1', '0', 'true',
  'false', etc)

Tests verify policy contract compliance and normalization logic.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Update tests to reflect AddFooterPolicy registration and integration:
1. PolicyServiceTest mocks AddFooterPolicy provider
2. PolicyRegistryTest verifies registry returns AddFooterPolicy definition
   with correct key and normalization
3. PolicySourceTest includes AddFooterPolicy in policy mocks
4. FooterHandlerTest:
   - Mocks PolicyService to return AddFooterPolicy resolution
   - Removed 'write_qrcode_on_footer' AppConfig setup (QR now automatic)
   - Updated test data providers to match new runtime behavior

All tests verify footer policy enablement check and QR code automatic
generation when validation URL present.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…el labels

Changes:
1. Register addFooterRealDefinition in realDefinitions catalog
2. Fix PolicyRuleEditorPanel switch labels for clarity:
   - Changed 'Require this signing order' to 'Allow lower-level overrides'
   - Updated descriptions to reflect override behavior semantics

This makes the allow-override toggle language more generic and applicable
across different policy types, not just signing order.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…ch tests

Integration and end-to-end test updates:
1. Remove 'config:app:set libresign write_qrcode_on_footer' from Gherkin
   setup (QR code no longer has separate toggle in policy system)
2. Update SettingsPolicyWorkbench.spec.ts:
   - Add helper function findConfigureButtonForSetting() for more
     reliable button location in test
   - Use helper to find Configure buttons for specific settings by title
   - Improves test stability by avoiding brittle button selection

QR code behavior is now automatic when footer enabled and validation URL
present.

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>
…ation url

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>
…finition

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>
…nfig

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…lues

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>
…setting

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…payload

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
… payload

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 0. Needs triage

Development

Successfully merging this pull request may close these issues.

1 participant