Skip to content

Conversation

@dddenes
Copy link
Contributor

@dddenes dddenes commented Nov 11, 2025

Description

validate_policy method in the orchestrator is now parametirezed with the data exchange & dtr policies. Method is refactored to remove the "if pyramid". Method is fixed, it now accepts odrl:and. Regression tests are added.

Closes this issue:
#36

Pre-review checks

Please ensure to do as many of the following checks as possible, before asking for committer review:

@dddenes dddenes changed the title fix: Make validate_policy parameterized, add odrl for spec_part, add regression tests Bugfixes (uuid regex, fix & refactor of policy validation) & warnings (multiple DTRs) Nov 20, 2025
@matbmoser matbmoser self-requested a review November 27, 2025 06:38
@matbmoser
Copy link
Contributor

I solved your merge conflicts, I hope it is now ok.

@matbmoser
Copy link
Contributor

async def get_catalog(
counter_party_address: str,
counter_party_id: str,
operand_left: Optional[str] = None,
operator: Optional[str] = "like",
operand_right: Optional[str] = None,
offset: Optional[int] = 0,
limit: Optional[int] = 10,
timeout: int = 80,
):
"""
Retrieve the catalog from the DT Pull Service.
Parameters mirror those previously used directly in utils.get_dtr_access.
"""
response = await make_request_verbose(
"GET",
f"{config.DT_PULL_SERVICE_ADDRESS}/edr/get-catalog/",
params={
"operand_left": operand_left,
"operand_right": operand_right,
"operator": operator,
"counter_party_address": counter_party_address,
"counter_party_id": counter_party_id,
"offset": offset,
"limit": limit,
},
timeout=timeout,
headers=get_dt_pull_service_headers(),
)
catalog_json = response['response_json']
# Validate if the response code is 200.
status_code = response.get('response', {}).get('status_code')
if status_code != 200:
error_code = catalog_json.get('error', 'BAD_GATEWAY')
message = catalog_json.get('message', 'Unknown error')
details = catalog_json.get('details', 'No additional details provided')
error_code_enum = Error.__members__.get(error_code, Error.BAD_GATEWAY)
raise HTTPError(error_code_enum,
message=message,
details=details)
logger.info("Catalog JSON received: %s", catalog_json)
# Validate if there is an offer for the desired asset/type available.
if len(catalog_json["dcat:dataset"]) == 0:
raise HTTPError(
Error.CONTRACT_NEGOTIATION_FAILED,
message='In case this is the Digital Twin Registry Asset please check ' + \
'https://eclipse-tractusx.github.io/docs-kits/kits/digital-twin-kit/' + \
'software-development-view/#digital-twin-registry-as-edc-data-asset for troubleshooting.',
details=f'There were no offers of type/id {operand_right} found in the catalog of connector {counter_party_address}. ' + \
'Either the properties or access policy of the asset are misconfigured. ' + \
'Make sure to allow access to the asset for the Testbed BPNL.')
return response

please make sure you add the warning in the get_catalog function

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

Successfully merging this pull request may close these issues.

3 participants