-
Notifications
You must be signed in to change notification settings - Fork 22
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
Implement fix for Connector-Restricted-Usage Policy not working since EDC CE v5.0.0 #727
Comments
@efiege as aligned during today's daily, as your highest prio please implement the fix for this gap. Some important points:
As needed, please contact me on Teams wherever I can support you more. |
|
This issue has been introduced when new These To circumvent this issue, the registration of the policy has been changed. It is no longer registered for all scopes, but just for |
Bug Report
Description
The Connector-Restricted-Usage Policy is no longer working since EDC0 migration (EDC CE v5.0.0).
Problem log:
Short version:
This has been a problem since migrating from core-edc MS8 to core-edc v0.2.1. Since then, the policy has not worked in any of our EDC CE versions (from EDC CE v5.0.0, regardless of whether dev or mds). With core-edc v0.1.2 breaking changes were introduced on how a core-edc's PolicyContext can be built by the class-constructor, which no longer requires a ParticipantAgent. The core-edc class DspHttpRemoteMessageDispatcher makes use of this possibility and builds a PolicyContext without a ParticipantAgent, whereupon our Connector-Restricted-Usage Policy AbstractReferringConnectorValidation subsequently throws the null pointer when invoking policyContext.getParticipantAgent.getClaims().
Technical derivation of the problem:
Our class: nullpointer because policyContext.getParticipantAgent() returns null when invoking getClaims() on it at:
https://github.com/sovity/edc-extensions/blob/45d15241c59c1313de31fb179eabe3bc7991929a/extensions/policy-referring-connector/src/main/java/de/sovity/edc/extension/policy/functions/AbstractReferringConnectorValidation.java#L72
Changes to core-edc v0.1.2:
Expected Behavior
The policy should work if it is selectable as a policy.
Observed Behavior
See above, a NullPointer exception is thrown at evaluation time for the reasons mentioned above.
Steps to Reproduce
Start any EDC CE variant, e.g. EDC CE DEV locally with the 2 standard EDC included in the docker-compose, add an asset, and select this policy within a contract definition as contract policy and negotiate the contract with a second connector.
Context Information
Outlook:
As of core-edc v0.4.0 (not yet migrated to by us), the PolicyContext's getParticipantAgent method itself has additionally been removed.
eclipse-edc/Connector@c9d6da4#diff-0c2ac585810576289fdc58fe672ffa775671645c49c2786f8db098c7a88ea4f5
Testing:
Brainstorming between @tmberthold @jkbquabeck @richardtreier
Possible Implementation and Work Breakdown
Tasks
The text was updated successfully, but these errors were encountered: