eclipse-tractusx / tractusx-edc

Apache License 2.0
38 stars 53 forks source link

BPNL Validation function evaluates the same way for EQ and isAllOf operators #1411

Closed rafaelmag110 closed 2 months ago

rafaelmag110 commented 3 months ago

Describe the bug

Using the isAllOf operator in a policy, the validation fails if a BPNL belongs to more groups than the ones specified in the policy.

In the BPNL validation extension, the validation function evaluates the EQ and the isAllOf operators in the same way, however even the documentation states they should evaluate the groups differently, as shown in the expected behaviour.

Also, in the BusinessPartnerGroupFunctionTest class, the following circumstance is tested: Arguments.of("Overlapping groups", IS_ALL_OF, List.of(TEST_GROUP_1, TEST_GROUP_2, "different-group", "another-different-group"), false)

And being TEST_GROUP_1 and TEST_GROUP_2 part of the allowed groups, this case should return true and not false

Expected behavior

Operator EQ: must be exactly in - and only in - that particular group or set of groups Operator IS_ALL_OF: must be in all of the specified groups

danielkenji01 commented 2 months ago

Can I assign this issue to me? @ndr-brt @rafaelmag110

lgblaumeiser commented 2 months ago

Please have a look at: https://github.com/eclipse-tractusx/sig-release/issues/775#issuecomment-2242235805, there is an additional issue with operators

danielkenji01 commented 2 months ago

The issue was solved on the following Pull Request: https://github.com/eclipse-tractusx/tractusx-edc/pull/1456