Repository navigation
feat(policy): register signature rejection in the policy workbench - #9336
Merged
vitormattos merged 4 commits intoNov 5, 2026
Conversation
vitormattos
requested changes
Nov 3, 2026
vitormattos
left a comment
Member
There was a problem hiding this comment.
Requesting focused verification of instance-admin and delegated group-admin behavior before merge; see the inline test matrix.
Add the policy-local module for the five rejection_* settings: a typed model, a definition that maps them through the generic compound contract, and a rule editor. Values that do not apply while rejection or the comment is disabled are kept, so they can be prepared before the setting is turned on. Delegation and audience rules stay with the backend. The module is registered in the catalog separately. Refs LibreSign#8688 Signed-off-by: André Maia <andrefnkmm@gmail.com>
…rences The fallback handed the whole editor value to compound.compose() as the value of rejection_enabled, so an enabled system value was summarized as disabled. It now returns the value of the parent key. The enabled switch applied the actor's own allowed values to every rule, which locked an instance admin out of a locked system rule and a group admin out of the locked rule of their own group. The limit now applies only to user rules and preferences, and the backend decides the rest. The preferences screen saved the editor object on rejection_enabled, which the backend normalized to false while answering 200, and ignored the other four values. A personal preference behavior now reads the five values, saves them through the compound endpoint and clears all of them. The composed summary no longer escapes labels that are already translated. Signed-off-by: André Maia <andrefnkmm@gmail.com>
List rejection_enabled once in the catalog, under how signing works. The four dependent settings stay out of the catalog and are edited through the parent, using the generic compound flow without any engine change. Cover the flow with focused tests: a system rule restores the five values after reload, a group rule is saved, reloaded and removed through the same flow, and a backend validation error stays visible instead of being reported as a successful save. A Playwright scenario configures a system rule, reloads and checks the five values. Refs LibreSign#8689 Signed-off-by: André Maia <andrefnkmm@gmail.com>
…le edits A Behat feature exercises who may write the rules with real subadmin and delegation fixtures: instance admin on locked system and group rules, group admin on the system rule, on a managed group with and without delegation and on an unmanaged group, and a regular user. Refusals also assert that nothing was stored. It also covers the delegated limits and saving and clearing a personal preference of the five values. The Playwright scenario now reopens the saved rule through its Edit action after reload, and two new scenarios change a locked system rule from there. Workbench and preferences tests run the real paths, with a non-default comment audience so that a dropped key cannot pass. Signed-off-by: André Maia <andrefnkmm@gmail.com>
maia-andre
force-pushed
the
feat/signature-rejection-workbench-registration-8689
branch
from
November 5, 2026 00:48
1915b55 to
6fa2971
Compare
vitormattos
previously approved these changes
Nov 5, 2026
maia-andre
dismissed
vitormattos’s stale review
November 5, 2026 13:45
The merge-base changed after approval.
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.
Resolves: #8689
📝 Summary
Registers Signature Rejection in the Policy Workbench catalog and covers it through the existing Workbench flow.
This PR is stacked on #9335, which adds the module from #8688: only the last two commits are new here. Please review #9335 first. I will rebase this one onto
mainonce it is merged.rejection_enabledis added once torealDefinitions.ts, in the How signing works category. The four dependent keys are not catalog entries.useRealPolicyWorkbench.tsandpolicyWorkbenchCompoundPolicies.tsare untouched: load, edit, save, reload and removal all go through the generic compound flow from Make the Policy Workbench compound helper use policy definitions #8687.🧪 How to test
rejection. Signature rejection is listed once under How signing works.Automated:
Validation evidence
realDefinitions.spec.ts: Signature Rejection is registered once and the four dependent keys are not.signature-rejection/useRealPolicyWorkbench.spec.ts, 5 tests:The error test mocks the request failure the same way the existing Workbench save-error tests do. All 5 fail without the registration line.
Playwright
policy-workbench-signature-rejection-rule-management.spec.ts: configures a system rule, checks the compound request carries the five values, reloads, checks the five values in the editor and through the API, then restores the five keys as it found them. It passed in the local devcontainer twice: starting from an existing explicit rule and starting from the built-in defaults.Later review coverage: the fallback through
createRealPolicyWorkbenchState()fortrueandfalse; Playwright reopening the saved rule through Edit after reload and changing a locked system rule in both directions, 3 of 3 passing;Preferences.spec.tssaving and clearing the five values.Behat
policies/signature_rejection_authorization.feature, 18 scenarios and 450 steps passing in the local devcontainer after rebasing onmain: who may write each rule with real subadmin and delegation fixtures, refusals that store nothing, delegated limits under a group rule created by an instance admin, and saving and clearing a personal preference. Group admin cases are covered through the API, not in the browser.npm run lint(no errors, no warnings in the changed files),npm run stylelint,npm run ts:check.npx vitest run src/tests/views/Settings/PolicyWorkbench src/tests/views/Preferences src/tests/store/policies.spec.ts, 109 files and 769 tests passing.🎨 UI / Front-end changes
fieldsetwith alegend; no further audit✅ Checklist
🤖 AI (if applicable)