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: add contract definition empty asset selector validator #1786

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

rafaelmag110
Copy link
Contributor

WHAT

Adds a validator that replaces the existing contract definition validator for the data management API.

WHY

Implementation of #1774

FURTHER NOTES

Additionally to the decision written in the DR, this PR also includes the possibility for a user to bypass the blocker, by specifying a specific private property.
There are cases where bypassing the blocker might be required, and in such cases the user is usually aware of what will happen if the asset selector is left empty.

Closes #1773

Copy link

sonarqubecloud bot commented Feb 5, 2025

@rafaelmag110 rafaelmag110 changed the title Empty asset selector validator feat: add contract definition empty asset selector validator Feb 5, 2025
@rafaelmag110 rafaelmag110 added the enhancement New feature or request label Feb 5, 2025
It is used to validate requests that create or update contract definitions via the data management API endpoint.
When enabled, it prevents contract definitions with no asset selector, or an empty one, from being created.

This extension is included with the standard tractusx-edc distribution, but is disabled by default. To enable it,
Copy link
Contributor

Choose a reason for hiding this comment

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

I would a bit of text to explain why this is required - most people might not know.

I.e. "When enabled, it prevents contract definitions with no asset selector, or an empty one, from being created which elsewise leads to all available assets being included in the Contract Definition"?

@gerbigf
Copy link
Contributor

gerbigf commented Feb 6, 2025

Have we already discussed to enable that per default for Tractus-X? I would heavily support that...

@bmg13
Copy link
Contributor

bmg13 commented Feb 7, 2025

Have we already discussed to enable that per default for Tractus-X? I would heavily support that...

Believe during technical discussion it was set as default disabled to avoid adding breaking changes. Additionally as default it is seen as a "querying" approach, i. e., a filtering view in each no value in asset selector means no filter. Changing this would be adopter's choice.

@ndr-brt
Copy link
Contributor

ndr-brt commented Feb 7, 2025

Have we already discussed to enable that per default for Tractus-X? I would heavily support that...

In the DR we agreed on "off by default": https://github.com/eclipse-tractusx/tractusx-edc/tree/main/docs/development/decision-records/2025-01-30-empty-asset-selector-validator

BTW I don't have strong feelings here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Open
Development

Successfully merging this pull request may close these issues.

Block contract definitions with empty assetSelector
4 participants