Page MenuHomeVyOS Platform

Add constraintGroup for combining validators with logical AND
Open, NormalPublic

Description

Proposal, copied from comments in T2759.

XML - current implementation:

<constraint>
  <validator name="numeric" argument="--range 1-65535"/>
</constraint>

XML - new implementation:

<constraint>
  .. validator node 1 ...
  <errorMessage>This is bad</errorMessage>
</constraint>
<constraint>
  .. validator node 2 ...
  <errorMessage>This is bad</errorMessage>
</constraint>

Only once <validator> should be supported per <constraint>

<constraintGroup>
  .. validator node 1 ...
  .. validator node 2 ...
  <errorMessage>This is bad</errorMessage>
</constraintGroup>

All constraints in <constraint> are run as logical OR, all validators under the <constraintGroup> node are run with a logical AND.

Having both constraint and constraintGroup will OR both together.

Details

Difficulty level
Unknown (require assessment)
Version
vyos-1.4
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Internal change (not visible to end users)

Event Timeline

Needs testing, but initial implementation here:

https://github.com/jestabro/vyos-utils/tree/T3574
https://github.com/jestabro/vyos-1x/tree/T3574

Departing from the outline in the description, this implementation has only zero or one <constraint> elements, in which all validators are OR'd; in keeping with the description it allows zero or more <constraintGroup> elements, in each of which all validators are AND'd; the elements themselves are OR'd.

Adopting the convention in the description would be a simple change.

jestabro changed the task status from Open to Needs testing.May 23 2021, 8:43 PM
jestabro triaged this task as Normal priority.
jestabro changed the task status from Needs testing to Backport pending.Aug 5 2021, 2:53 PM
jestabro added a project: VyOS 1.3 Equuleus.
jestabro removed a project: test.
jestabro moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta board.
jestabro moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus board.
jestabro added a project: test.
SrividyaA set Issue type to Internal change (not visible to end users).Aug 31 2021, 6:00 PM

Reopened, as this was never backported to 1.3; set for 1.3.3.

This is potentially a useful feature, but has no current use, so there is no reason to backport it for 1.3.3. I wil add a 1.3.4 tag to keep it in mind in case it is needed for a future backport.