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

(edc-ce-dev [IAM-mock]) Connector-Restricted-Usage Policy #721

Closed
tmberthold opened this issue Jan 17, 2024 · 1 comment
Closed

(edc-ce-dev [IAM-mock]) Connector-Restricted-Usage Policy #721

tmberthold opened this issue Jan 17, 2024 · 1 comment
Assignees

Comments

@tmberthold
Copy link
Member

tmberthold commented Jan 17, 2024

Tested via edc-ce-dev 7.0.0 [IAM-mock].
Can be recreated by starting the normal docker-compose.yaml, which uses the edc-dev variant.

If a policy of the type "Connector-Restricted-Usage" (policy-referring-connector) is created and is then used as a "Contract Policy" when creating a new "Contract Definition", the contract negotiation, triggered by the consumer, then throws an error message and the contract negotiation doesn’t technically work. (using the always-true policy for "Access Policy")

Error log:

edc-extensions-edc2-1          | 2024-01-17 12:55:36 StateMachineManager [consumer-contract-negotiation] error caught 
edc-extensions-edc2-1          | java.lang.NullPointerException: Cannot invoke "org.eclipse.edc.spi.agent.ParticipantAgent.getClaims()" because the return value of "org.eclipse.edc.policy.engine.spi.PolicyContext.getParticipantAgent()" is null
edc-extensions-edc2-1          |        at de.sovity.edc.extension.policy.functions.AbstractReferringConnectorValidation.evaluate(AbstractReferringConnectorValidation.java:72)
[...]

Policy: https://github.com/sovity/edc-extensions/tree/main/extensions/policy-referring-connector

Line of code causing Nullpointer: https://github.com/sovity/edc-extensions/blob/45d15241c59c1313de31fb179eabe3bc7991929a/extensions/policy-referring-connector/src/main/java/de/sovity/edc/extension/policy/functions/AbstractReferringConnectorValidation.java#L72

If the policy is also used by the provider as "Access Policy" and not just as "Contract Policy", the provider-offer is not visible in the consumer-catalog, regardless of how the connector-IDs are set when creating the policy.

Is there a configuration missing somewhere in the default setup of the docker-compose and thus of edc-ce-dev or is it not possible to use this policy anyway in the context of the IAM-mock and therefore no referringConnector claim which would then always fail even later in the policy-validation without the null pointer? Or what could that be?

@tmberthold tmberthold added analyze kind/bug Something isn't working. The software does not behave as expected or specified. and removed kind/bug Something isn't working. The software does not behave as expected or specified. labels Jan 17, 2024
@tmberthold
Copy link
Member Author

tmberthold commented Jan 18, 2024

Did the analysis, will open a new Bug Ticket with my findings.

Update: Here it is: #727

@tmberthold tmberthold self-assigned this Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant