diff --git a/connector/build.gradle.kts b/connector/build.gradle.kts index 4cce4a7..92be78f 100644 --- a/connector/build.gradle.kts +++ b/connector/build.gradle.kts @@ -23,7 +23,7 @@ allprojects { // configure which version of the annotation processor to use. defaults to the same version as the plugin configure { processorVersion.set(edcVersion) - outputDirectory.set(project.buildDir) + outputDirectory.set(project.layout.buildDirectory.asFile.get()) } configure { diff --git a/connector/gradle/libs.versions.toml b/connector/gradle/libs.versions.toml index 29bf2e9..8ef6612 100644 --- a/connector/gradle/libs.versions.toml +++ b/connector/gradle/libs.versions.toml @@ -3,26 +3,27 @@ format.version = "1.1" [versions] assertj = "3.25.3" -awaitility = "4.2.0" -edc = "0.4.1" +awaitility = "4.2.1" +edc = "0.6.0" jakarta-json = "2.0.1" junit-pioneer = "2.2.0" jupiter = "5.10.2" -okhttp-mockwebserver = "5.0.0-alpha.12" +okhttp-mockwebserver = "5.0.0-alpha.14" openTelemetry = "1.18.0" restAssured = "5.4.0" -rsApi = "3.1.0" -testcontainers = "1.19.5" -kafkaClients = "3.6.1" +rsApi = "4.0.0" +testcontainers = "1.19.8" +kafkaClients = "3.7.0" json = "20230227" swaggerParser = "2.1.15" slugify = "3.0.4" postgresql = "42.7.3" +jwt = "0.12.5" +okhttp = "4.12.0" [libraries] assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" } awaitility = { module = "org.awaitility:awaitility", version.ref = "awaitility" } -edc-core-spi = { module = "org.eclipse.edc:core-spi", version.ref = "edc" } edc-api-core = { module = "org.eclipse.edc:api-core", version.ref = "edc" } edc-api-observability = { module = "org.eclipse.edc:api-observability", version.ref = "edc" } edc-auth-tokenbased = { module = "org.eclipse.edc:auth-tokenbased", version.ref = "edc" } @@ -34,7 +35,8 @@ edc-control-plane-api-client = { module = "org.eclipse.edc:control-plane-api-cli edc-control-plane-api = { module = "org.eclipse.edc:control-plane-api", version.ref = "edc" } edc-control-plane-core = { module = "org.eclipse.edc:control-plane-core", version.ref = "edc" } edc-control-plane-spi = { module = "org.eclipse.edc:control-plane-spi", version.ref = "edc" } -edc-data-plane-api = { module = "org.eclipse.edc:data-plane-api", version.ref = "edc" } +edc-data-plane-control-api = { module = "org.eclipse.edc:data-plane-control-api", version.ref = "edc" } +edc-data-plane-public-api = { module = "org.eclipse.edc:data-plane-public-api", version.ref = "edc" } edc-data-plane-aws-s3 = { module = "org.eclipse.edc:data-plane-aws-s3", version.ref = "edc" } edc-data-plane-azure-storage = { module = "org.eclipse.edc:data-plane-azure-storage", version.ref = "edc" } edc-data-plane-client = { module = "org.eclipse.edc:data-plane-client", version.ref = "edc" } @@ -42,7 +44,6 @@ edc-data-plane-core = { module = "org.eclipse.edc:data-plane-core", version.ref edc-data-plane-http = { module = "org.eclipse.edc:data-plane-http", version.ref = "edc" } edc-data-plane-kafka = { module = "org.eclipse.edc:data-plane-kafka", version.ref = "edc" } edc-data-plane-selector-api = { module = "org.eclipse.edc:data-plane-selector-api", version.ref = "edc" } -edc-data-plane-selector-client = { module = "org.eclipse.edc:data-plane-selector-client", version.ref = "edc" } edc-data-plane-selector-core = { module = "org.eclipse.edc:data-plane-selector-core", version.ref = "edc" } edc-data-plane-spi = { module = "org.eclipse.edc:data-plane-spi", version.ref = "edc" } edc-data-plane-util = { module = "org.eclipse.edc:data-plane-util", version.ref = "edc" } @@ -51,7 +52,8 @@ edc-http = { module = "org.eclipse.edc:http", version.ref = "edc" } edc-iam-mock = { module = "org.eclipse.edc:iam-mock", version.ref = "edc" } edc-jersey-micrometer = { module = "org.eclipse.edc:jersey-micrometer", version.ref = "edc" } edc-jetty-micrometer = { module = "org.eclipse.edc:jetty-micrometer", version.ref = "edc" } -edc-json-ld = { module = "org.eclipse.edc:json-ld", version.ref = "edc" } +edc-json-ld-lib = { module = "org.eclipse.edc:json-ld-lib", version.ref = "edc" } +edc-json-ld-spi = { module = "org.eclipse.edc:json-ld-spi", version.ref = "edc" } edc-junit = { module = "org.eclipse.edc:junit", version.ref = "edc" } edc-management-api = { module = "org.eclipse.edc:management-api", version.ref = "edc" } edc-micrometer-core = { module = "org.eclipse.edc:micrometer-core", version.ref = "edc" } @@ -65,8 +67,7 @@ edc-transfer-pull-http-dynamic-receiver = { module = "org.eclipse.edc:transfer-p edc-util = { module = "org.eclipse.edc:util", version.ref = "edc" } edc-vault-azure = { module = "org.eclipse.edc:vault-azure", version.ref = "edc" } edc-vault-filesystem = { module = "org.eclipse.edc:vault-filesystem", version.ref = "edc" } -edc-oauth2-client = { module = "org.eclipse.edc:oauth2-client", version.ref = "edc" } -edc-oauth2-core = { module = "org.eclipse.edc:oauth2-core", version.ref = "edc" } +edc-protocol-dsp = { module = "org.eclipse.edc:dsp", version.ref = "edc" } jakarta-rsApi = { module = "jakarta.ws.rs:jakarta.ws.rs-api", version.ref = "rsApi" } jakartaJson = { module = "org.glassfish:jakarta.json", version.ref = "jakarta-json" } junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "jupiter" } @@ -74,14 +75,18 @@ junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", vers junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "jupiter" } junit-pioneer = { module = "org.junit-pioneer:junit-pioneer", version.ref = "junit-pioneer" } okhttp-mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttp-mockwebserver" } -opentelemetry-annotations = { module = "io.opentelemetry:opentelemetry-extension-annotations", version.ref = "openTelemetry" } +opentelemetry-annotations = { module = "io.opentelemetry:opentelemetry-extension-annotations", version = "1.18.0" } +opentelemetry-exporter-jaeger = { module = "io.opentelemetry:opentelemetry-exporter-jaeger", version = "1.34.1" } +opentelemetry-javaagent = { module = "io.opentelemetry.javaagent:opentelemetry-javaagent", version = "2.3.0" } restAssured = { module = "io.rest-assured:rest-assured", version.ref = "restAssured" } testcontainers = { module = "org.testcontainers:testcontainers", version.ref = "testcontainers" } testcontainers-junit-jupiter = { module = "org.testcontainers:junit-jupiter", version.ref = "testcontainers" } kafka-clients = { module = "org.apache.kafka:kafka-clients", version.ref = "kafkaClients" } testcontainers-kafka = { module = "org.testcontainers:kafka", version.ref = "testcontainers" } testcontainers-junit = { module = "org.testcontainers:junit-jupiter", version.ref = "testcontainers" } -opentelemetry = "io.opentelemetry.javaagent:opentelemetry-javaagent:2.1.0" +edc-oauth2-client = { module = "org.eclipse.edc:oauth2-client", version.ref = "edc" } +edc-oauth2-core = { module = "org.eclipse.edc:oauth2-core", version.ref = "edc" } +edc-core-spi = { module = "org.eclipse.edc:core-spi", version.ref = "edc" } json = { module = "org.json:json", version.ref = "json" } swaggerParser = { module = "io.swagger.parser.v3:swagger-parser", version.ref = "swaggerParser" } slugify = { module = "com.github.slugify:slugify", version.ref = "slugify" } @@ -90,6 +95,10 @@ edc-transaction-local = { module = "org.eclipse.edc:transaction-local", version. edc-transaction-datasource-spi = { module = "org.eclipse.edc:transaction-datasource-spi", version.ref = "edc" } edc-sql-control-plane-sql = { module = "org.eclipse.edc:control-plane-sql", version.ref = "edc" } postgresql-postgresql = { module = "org.postgresql:postgresql", version.ref = "postgresql" } +jsonwebtoken-jjwt-api = { module = "io.jsonwebtoken:jjwt-api", version.ref = "jwt" } +jsonwebtoken-jjwt-impl = { module = "io.jsonwebtoken:jjwt-impl", version.ref = "jwt" } +jsonwebtoken-jjwt-jackson = { module = "io.jsonwebtoken:jjwt-jackson", version.ref = "jwt" } +okhttp3-okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" } [plugins] shadow = { id = "com.github.johnrengelman.shadow", version = "8.1.1" } diff --git a/connector/gradle/wrapper/gradle-wrapper.properties b/connector/gradle/wrapper/gradle-wrapper.properties index 37aef8d..509c4a2 100644 --- a/connector/gradle/wrapper/gradle-wrapper.properties +++ b/connector/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/connector/iam/build.gradle.kts b/connector/iam/build.gradle.kts index 94235bc..869905d 100644 --- a/connector/iam/build.gradle.kts +++ b/connector/iam/build.gradle.kts @@ -2,9 +2,6 @@ plugins { `java-library` } -val okHttpVersion = "4.12.0" -val jwtVersion = "0.12.5" - dependencies { implementation(libs.edc.connector.core) implementation(libs.edc.control.plane.core) @@ -12,8 +9,8 @@ dependencies { implementation(libs.edc.core.spi) implementation(libs.json) - implementation("com.squareup.okhttp3:okhttp:$okHttpVersion") - implementation("io.jsonwebtoken:jjwt-api:$jwtVersion") - runtimeOnly("io.jsonwebtoken:jjwt-impl:$jwtVersion") - runtimeOnly("io.jsonwebtoken:jjwt-jackson:$jwtVersion") + implementation(libs.okhttp3.okhttp) + implementation(libs.jsonwebtoken.jjwt.api) + runtimeOnly(libs.jsonwebtoken.jjwt.impl) + runtimeOnly(libs.jsonwebtoken.jjwt.jackson) } diff --git a/connector/iam/src/main/java/eu/datacellar/iam/VCIdentityExtension.java b/connector/iam/src/main/java/eu/datacellar/iam/VCIdentityExtension.java index 9711d02..7590d07 100644 --- a/connector/iam/src/main/java/eu/datacellar/iam/VCIdentityExtension.java +++ b/connector/iam/src/main/java/eu/datacellar/iam/VCIdentityExtension.java @@ -4,13 +4,16 @@ import org.eclipse.edc.runtime.metamodel.annotation.Extension; import org.eclipse.edc.runtime.metamodel.annotation.Inject; +import org.eclipse.edc.runtime.metamodel.annotation.Provider; import org.eclipse.edc.runtime.metamodel.annotation.Provides; import org.eclipse.edc.runtime.metamodel.annotation.Setting; +import org.eclipse.edc.spi.iam.AudienceResolver; import org.eclipse.edc.spi.iam.IdentityService; import org.eclipse.edc.spi.monitor.Monitor; import org.eclipse.edc.spi.system.ServiceExtension; import org.eclipse.edc.spi.system.ServiceExtensionContext; import org.eclipse.edc.spi.types.TypeManager; +import org.eclipse.edc.spi.types.domain.message.RemoteMessage; /** * This class represents the VCIdentityExtension, which is an implementation of @@ -115,6 +118,15 @@ public void initialize(ServiceExtensionContext context) { context.getMonitor().severe("Failed to initialize WaltIDIdentityServices", e); System.exit(1); } + } + /** + * Resolves the audience for the remote message. + * + * @return The counter party address of the remote message. + */ + @Provider + public AudienceResolver audienceResolver() { + return RemoteMessage::getCounterPartyAddress; } } \ No newline at end of file diff --git a/connector/iam/src/main/java/eu/datacellar/iam/VCIdentityService.java b/connector/iam/src/main/java/eu/datacellar/iam/VCIdentityService.java index e016817..2a7220c 100644 --- a/connector/iam/src/main/java/eu/datacellar/iam/VCIdentityService.java +++ b/connector/iam/src/main/java/eu/datacellar/iam/VCIdentityService.java @@ -1,14 +1,12 @@ package eu.datacellar.iam; -import static java.lang.String.format; - import java.io.IOException; -import java.util.Objects; import org.eclipse.edc.spi.iam.ClaimToken; import org.eclipse.edc.spi.iam.IdentityService; import org.eclipse.edc.spi.iam.TokenParameters; import org.eclipse.edc.spi.iam.TokenRepresentation; +import org.eclipse.edc.spi.iam.VerificationContext; import org.eclipse.edc.spi.monitor.Monitor; import org.eclipse.edc.spi.result.Result; import org.eclipse.edc.spi.types.TypeManager; @@ -60,10 +58,10 @@ public VCIdentityService(Monitor monitor, TypeManager typeManager, String client @Override public Result obtainClientCredentials(TokenParameters parameters) { + String audience = parameters.getStringClaim("aud"); + monitor.info( - String.format("obtainClientCredentials: (scope=%s) (audience=%s)", - parameters.getScope(), - parameters.getAudience())); + String.format("obtainClientCredentials: (audience=%s)", audience)); PresentationDefinition presentationDefinition = new PresentationDefinition(PRESENTED_VC_TYPE); MatchCredentialsResponse matchCredentialsResponse; @@ -90,7 +88,7 @@ public Result obtainClientCredentials(TokenParameters param presentationBuilder .addJwtCredential(jwtEncodedVC) - .setAudience(parameters.getAudience()); + .setAudience(audience); String jwtEncodedVP; @@ -103,7 +101,7 @@ public Result obtainClientCredentials(TokenParameters param monitor.debug("JWT-encoded Verifiable Presentation: %s".formatted(jwtEncodedVP)); var token = new VerifiablePresentationToken(); - token.setAudience(parameters.getAudience()); + token.setAudience(audience); token.setClientId(clientId); token.setJwtVerifiablePresentation(jwtEncodedVP); token.setClientDid(presentationBuilder.getHolderDid()); @@ -116,16 +114,11 @@ public Result obtainClientCredentials(TokenParameters param } @Override - public Result verifyJwtToken(TokenRepresentation tokenRepresentation, String audience) { + public Result verifyJwtToken(TokenRepresentation tokenRepresentation, VerificationContext context) { monitor.debug("verifyJwtToken.tokenRepresentation: %s".formatted(tokenRepresentation.getToken())); - monitor.debug("verifyJwtToken.audience: %s".formatted(audience)); var token = typeManager.readValue(tokenRepresentation.getToken(), VerifiablePresentationToken.class); - if (!Objects.equals(token.audience, audience)) { - return Result.failure(format("Mismatched audience: expected %s, got %s", audience, token.audience)); - } - Jwk anchorJwk; try { diff --git a/connector/openapi-connector/build.gradle.kts b/connector/openapi-connector/build.gradle.kts index 5e5f38b..ffb40be 100644 --- a/connector/openapi-connector/build.gradle.kts +++ b/connector/openapi-connector/build.gradle.kts @@ -5,6 +5,9 @@ plugins { } dependencies { + implementation(libs.edc.boot) + implementation(libs.edc.connector.core) + implementation(libs.edc.http) implementation(libs.edc.control.plane.api.client) implementation(libs.edc.control.plane.api) implementation(libs.edc.control.plane.core) @@ -14,12 +17,13 @@ dependencies { implementation(libs.edc.management.api) implementation(libs.edc.transfer.data.plane) implementation(libs.edc.transfer.pull.http.receiver) + implementation(libs.edc.core.spi) implementation(libs.edc.data.plane.selector.api) implementation(libs.edc.data.plane.selector.core) - implementation(libs.edc.data.plane.selector.client) - implementation(libs.edc.data.plane.api) + implementation(libs.edc.data.plane.control.api) + implementation(libs.edc.data.plane.public.api) implementation(libs.edc.data.plane.core) implementation(libs.edc.data.plane.http) @@ -43,6 +47,8 @@ dependencies { } implementation(libs.postgresql.postgresql) + implementation(libs.edc.transaction.datasource.spi) + implementation(libs.edc.transaction.local) if ( project.hasProperty("useSQLStore") && @@ -51,8 +57,6 @@ dependencies { // https://github.com/eclipse-edc/Connector/discussions/3242 implementation(libs.edc.sql.control.plane.sql) implementation(libs.edc.sql.pool.apache.commons) - implementation(libs.edc.transaction.local) - implementation(libs.edc.transaction.datasource.spi) } } diff --git a/connector/openapi-connector/src/main/java/eu/datacellar/connector/CredentialConstraintFunction.java b/connector/openapi-connector/src/main/java/eu/datacellar/connector/CredentialConstraintFunction.java index 55d2c7e..911a9b8 100644 --- a/connector/openapi-connector/src/main/java/eu/datacellar/connector/CredentialConstraintFunction.java +++ b/connector/openapi-connector/src/main/java/eu/datacellar/connector/CredentialConstraintFunction.java @@ -26,6 +26,12 @@ public class CredentialConstraintFunction implements AtomicConstraintFunction presentationDefi * @return The policy definition. */ private PolicyDefinition buildPolicyDefinition(Map presentationDefinition, Monitor monitor) { - final Action USE_ACTION = Action.Builder.newInstance().type("USE").build(); - - ruleBindingRegistry.bind(USE_ACTION.getType(), ALL_SCOPES); + ruleBindingRegistry.bind("use", ALL_SCOPES); PolicyDefinition.Builder policyDefBuilder = PolicyDefinition.Builder.newInstance() .id(UUID.randomUUID().toString()); @@ -230,7 +228,8 @@ private PolicyDefinition buildPolicyDefinition(Map presentationD .operator(Operator.IN) .rightExpression(new LiteralExpression(credentialTypePattern)).build(); - var permission = Permission.Builder.newInstance().action(USE_ACTION).constraint(credentialConstraint) + var permission = Permission.Builder.newInstance().action(Action.Builder.newInstance().type("USE").build()) + .constraint(credentialConstraint) .build(); return policyDefBuilder diff --git a/dev-config/sql-store-schemas/contract-negotiation.sql b/dev-config/sql-store-schemas/contract-negotiation.sql index f8920c1..2413c18 100644 --- a/dev-config/sql-store-schemas/contract-negotiation.sql +++ b/dev-config/sql-store-schemas/contract-negotiation.sql @@ -58,11 +58,11 @@ CREATE TABLE IF NOT EXISTS edc_contract_negotiation callback_addresses JSON, trace_context JSON, pending BOOLEAN DEFAULT FALSE, + protocol_messages JSON, lease_id VARCHAR CONSTRAINT contract_negotiation_lease_lease_id_fk REFERENCES edc_lease - ON DELETE SET NULL, - CONSTRAINT provider_correlation_id CHECK (type = '0' OR correlation_id IS NOT NULL) + ON DELETE SET NULL ); COMMENT ON COLUMN edc_contract_negotiation.agreement_id IS 'ContractAgreement serialized as JSON'; diff --git a/dev-config/sql-store-schemas/policy-definition.sql b/dev-config/sql-store-schemas/policy-definition.sql index 29143bf..79052c0 100644 --- a/dev-config/sql-store-schemas/policy-definition.sql +++ b/dev-config/sql-store-schemas/policy-definition.sql @@ -27,6 +27,7 @@ CREATE TABLE IF NOT EXISTS edc_policydefinitions assignee VARCHAR, target VARCHAR, policy_type VARCHAR NOT NULL, + private_properties JSON, PRIMARY KEY (policy_id) ); diff --git a/dev-config/sql-store-schemas/transfer-process.sql b/dev-config/sql-store-schemas/transfer-process.sql index 8e3ba65..f2292c7 100644 --- a/dev-config/sql-store-schemas/transfer-process.sql +++ b/dev-config/sql-store-schemas/transfer-process.sql @@ -31,13 +31,22 @@ CREATE TABLE IF NOT EXISTS edc_transfer_process provisioned_resource_set JSON, content_data_address JSON, deprovisioned_resources JSON, - private_properties JSON, + private_properties JSON, callback_addresses JSON, pending BOOLEAN DEFAULT FALSE, + transfer_type VARCHAR, + protocol_messages JSON, + data_plane_id VARCHAR, + correlation_id VARCHAR, + counter_party_address VARCHAR, + protocol VARCHAR, + asset_id VARCHAR, + contract_id VARCHAR, + data_destination JSON, lease_id VARCHAR - CONSTRAINT transfer_process_lease_lease_id_fk - REFERENCES edc_lease - ON DELETE SET NULL + CONSTRAINT transfer_process_lease_lease_id_fk + REFERENCES edc_lease + ON DELETE SET NULL ); COMMENT ON COLUMN edc_transfer_process.trace_context IS 'Java Map serialized as JSON'; @@ -54,28 +63,5 @@ COMMENT ON COLUMN edc_transfer_process.deprovisioned_resources IS 'List of depro CREATE UNIQUE INDEX IF NOT EXISTS transfer_process_id_uindex ON edc_transfer_process (transferprocess_id); -CREATE TABLE IF NOT EXISTS edc_data_request -( - datarequest_id VARCHAR NOT NULL - CONSTRAINT data_request_pk - PRIMARY KEY, - process_id VARCHAR NOT NULL, - connector_address VARCHAR NOT NULL, - protocol VARCHAR NOT NULL, - connector_id VARCHAR, - asset_id VARCHAR NOT NULL, - contract_id VARCHAR NOT NULL, - data_destination JSON NOT NULL, - transfer_process_id VARCHAR NOT NULL - CONSTRAINT data_request_transfer_process_id_fk - REFERENCES edc_transfer_process - ON UPDATE RESTRICT ON DELETE CASCADE -); - -COMMENT ON COLUMN edc_data_request.data_destination IS 'DataAddress serialized as JSON'; - -CREATE UNIQUE INDEX IF NOT EXISTS data_request_id_uindex - ON edc_data_request (datarequest_id); - CREATE UNIQUE INDEX IF NOT EXISTS lease_lease_id_uindex ON edc_lease (lease_id); \ No newline at end of file diff --git a/edcpy/edcpy/edc_api.py b/edcpy/edcpy/edc_api.py index dd466b5..41cde9f 100644 --- a/edcpy/edcpy/edc_api.py +++ b/edcpy/edcpy/edc_api.py @@ -266,7 +266,7 @@ def default_contract_offer_id(self) -> str: @property def default_asset_id(self) -> str: - return self.default_policy["odrl:target"]["@id"] + return self.data["@id"] @dataclass @@ -325,8 +325,7 @@ async def run_negotiation_flow( management_url=self.connector_urls.management_url, counter_party_connector_id=counter_party_connector_id, counter_party_protocol_url=counter_party_protocol_url, - consumer_id=self.config.connector.participant_id, - provider_id=counter_party_connector_id, + asset_id=dataset.default_asset_id, policy=dataset.default_policy, ) diff --git a/edcpy/edcpy/models/contract_negotiation.py b/edcpy/edcpy/models/contract_negotiation.py index 5684e0e..151e4d1 100644 --- a/edcpy/edcpy/models/contract_negotiation.py +++ b/edcpy/edcpy/models/contract_negotiation.py @@ -4,14 +4,15 @@ _TEMPLATE = { "@context": {"@vocab": "https://w3id.org/edc/v0.0.1/ns/"}, - "@type": "NegotiationInitiateRequestDto", - "connectorId": None, + "@type": "ContractRequest", "counterPartyAddress": None, - "consumerId": None, - "providerId": None, "protocol": "dataspace-protocol-http", "policy": { "@context": "http://www.w3.org/ns/odrl.jsonld", + "@id": None, + "@type": "Offer", + "assigner": None, + "target": None, }, } @@ -22,17 +23,18 @@ def build( cls, counter_party_connector_id: str, counter_party_protocol_url: str, - consumer_id: str, - provider_id: str, + asset_id: str, policy: Dict[str, Any], ) -> dict: + merged_policy = list_override_merger.merge( + policy, + {"assigner": counter_party_connector_id, "target": asset_id}, + ) + return list_override_merger.merge( _TEMPLATE, { - "connectorId": counter_party_connector_id, "counterPartyAddress": counter_party_protocol_url, - "consumerId": consumer_id, - "providerId": provider_id, - "policy": policy, + "policy": merged_policy, }, )