eclipse-edc / eclipse-edc/Connector

Catalog ignores accessPolicy VC scopes

Open
#5,790 2 comments 0 reactions 0 assignees View on GitHub
feature_request
Dominant language
Java
Stars
424
Forks
300
Avg merge
13h 11m
Merged PRs (30d)
35

Description

# Bug Report

An `accessPolicy` requiring non-default VC scope always fails because EDC will request only the default VC scopes for Catalog requests.

### Expected Behavior

The VCs scopes include all needed scopes to verify the accessPolicy for all offers during a Catalog request.

### Observed Behavior

Only "generic" VC scopes (ones that are in the default DCP scope) are requested.

## Context Information

- EDC v0.17

## Detailed Description

I don't know _how_ to fix it, but I traced down the problematic code path:

The `getCatalog` method calls `protocolTokenValidator.verify()` with a **blank** `RequestCatalogPolicyContext` [here](https://github.com/eclipse-edc/Connector/blob/v0.17.0/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/controlplane/services/catalog/CatalogProtocolServiceImpl.java#L62). This results in an incorrect verificationContext built [here](https://github.com/eclipse-edc/Connector/blob/v0.17.0/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/controlplane/services/protocol/ProtocolTokenValidatorImpl.java#L65-L68), hence incorrect VCs requested.

Later during datasetResolution [here](https://github.com/eclipse-edc/Connector/blob/v0.17.0/core/control-plane/control-plane-catalog/src/main/java/org/eclipse/edc/connector/controlplane/catalog/ContractDefinitionResolverImpl.java#L64), the policy is being evaluated but the credentials fetched will be insufficient and policy validation will fail.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.