Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: strict policy definition validation #1688

Merged

Conversation

wolf4ood
Copy link
Contributor

@wolf4ood wolf4ood commented Nov 25, 2024

WHAT

Enables strict policy definition validation by default. If necessary the validation can be disabled with helm configuration/ env variables.

Two additional Constraint functions were introduced:

  • ContractReferenceConstraintFunction (cx-policy:ContractReference)
  • UsagePurposeConstraintFunction (cx-policy:UsagePurpose)

Both evaluate to true always, they are only there as placeholder for enabling the validation of policy definitions.

WHY

user experience

FURTHER NOTES

The current validation only checks if there are functions that can be evaluated with the posted policy definition and the left operand is bound to at least a policy context.

Additional validation could be introduced in policy functions by implementing AtomicConstraintRuleFunction#validate which allows validating for example right operand values and operators supported.

Closes #1685

@wolf4ood wolf4ood force-pushed the feat/1685_strict_policy_validation branch 4 times, most recently from eb12b7e to fd0ac23 Compare November 27, 2024 09:38
@wolf4ood wolf4ood force-pushed the feat/1685_strict_policy_validation branch from e19ba3a to 3570aad Compare November 27, 2024 09:43
@wolf4ood wolf4ood marked this pull request as ready for review November 27, 2024 10:20
@wolf4ood
Copy link
Contributor Author

/cc @gerbigf

Copy link
Contributor

@rafaelmag110 rafaelmag110 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial impressions.

Copy link

@wolf4ood wolf4ood merged commit bc34588 into eclipse-tractusx:main Nov 28, 2024
34 checks passed
@wolf4ood wolf4ood deleted the feat/1685_strict_policy_validation branch November 28, 2024 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

Introduce strict policy validation
3 participants