Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions advanced/advanced-01-open-telemetry/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ services:
WEB_HTTP_MANAGEMENT_PATH: /management
WEB_HTTP_PROTOCOL_PORT: 29194
WEB_HTTP_PROTOCOL_PATH: /protocol
WEB_HTTP_VERSION_PORT: 29195
WEB_HTTP_VERSION_PATH: /version
WEB_HTTP_SIGNALING_PORT: 29195
WEB_HTTP_SIGNALING_PATH: /signaling
EDC_CONTROL_ENDPOINT: http://consumer:29192/control
EDC_DSP_CALLBACK_ADDRESS: http://consumer:29194/protocol
EDC_PARTICIPANT_ID: consumer
Expand Down Expand Up @@ -69,8 +69,8 @@ services:
WEB_HTTP_MANAGEMENT_AUTH_KEY: password
WEB_HTTP_PROTOCOL_PORT: 19194
WEB_HTTP_PROTOCOL_PATH: /protocol
WEB_HTTP_VERSION_PORT: 19195
WEB_HTTP_VERSION_PATH: /version
WEB_HTTP_SIGNALING_PORT: 19195
WEB_HTTP_SIGNALING_PATH: /signaling
EDC_CONTROL_ENDPOINT: http://provider:19192/control
EDC_DSP_CALLBACK_ADDRESS: http://provider:19194/protocol
EDC_PARTICIPANT_ID: provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ plugins {
dependencies {

runtimeOnly(libs.edc.bom.controlplane.base) {
exclude(module = "org.eclipse.edc.data-plane-selector-client")
exclude(group = "org.eclipse.edc", "data-plane-signaling-core")
exclude(group = "org.eclipse.edc", "data-plane-signaling-oauth2")
}
runtimeOnly(libs.edc.bom.dataplane.base)

implementation(libs.edc.iam.mock)
implementation(libs.edc.data.plane.spi)
implementation(libs.edc.transfer.spi)
implementation(libs.opentelemetry.exporter.otlp)
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*
* Copyright (c) 2026 Think-it GmbH
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Think-it GmbH - initial API and implementation
*
*/

package org.eclipse.edc.sample.runtime;

import org.eclipse.edc.connector.controlplane.asset.spi.domain.Asset;
import org.eclipse.edc.connector.controlplane.transfer.spi.flow.DataFlowController;
import org.eclipse.edc.connector.controlplane.transfer.spi.types.DataFlowResponse;
import org.eclipse.edc.connector.controlplane.transfer.spi.types.TransferProcess;
import org.eclipse.edc.policy.model.Policy;
import org.eclipse.edc.runtime.metamodel.annotation.Provider;
import org.eclipse.edc.spi.response.StatusResult;
import org.eclipse.edc.spi.system.ServiceExtension;
import org.jetbrains.annotations.NotNull;

import java.util.Set;

public class NoOpDataFlowControllerExtension implements ServiceExtension {

@Provider
public DataFlowController dataFlowController() {
return new NoOpDataFlowController();
}

private static class NoOpDataFlowController implements DataFlowController {

@Override
public boolean canHandle(TransferProcess transferProcess) {
return true;
}

@Override
public StatusResult<DataFlowResponse> prepare(TransferProcess transferProcess, Policy policy) {
return StatusResult.success(DataFlowResponse.Builder.newInstance().build());
}

@Override
public @NotNull StatusResult<DataFlowResponse> start(TransferProcess transferProcess, Policy policy) {
return StatusResult.success(DataFlowResponse.Builder.newInstance().build());
}

@Override
public StatusResult<Void> suspend(TransferProcess transferProcess) {
return StatusResult.success();
}

@Override
public StatusResult<DataFlowResponse> resume(TransferProcess transferProcess) {
return StatusResult.success(DataFlowResponse.Builder.newInstance().build());
}

@Override
public StatusResult<Void> terminate(TransferProcess transferProcess) {
return StatusResult.success();
}

@Override
public StatusResult<Void> started(TransferProcess transferProcess) {
return StatusResult.success();
}

@Override
public StatusResult<Void> completed(TransferProcess transferProcess) {
return StatusResult.success();
}

@Override
public Set<String> transferTypesFor(Asset asset) {
return Set.of("HttpData-PULL");
}

@Override
public Set<String> transferTypesFor(String assetId) {
return Set.of("HttpData-PULL");
}
}

}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
org.eclipse.edc.sample.runtime.DummyEndpointGeneratorFunctionExtension
org.eclipse.edc.sample.runtime.NoOpDataFlowControllerExtension
org.eclipse.edc.sample.runtime.SeedVaultExtension
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ web.http.public.port=29291
web.http.public.path=/public
web.http.control.port=29192
web.http.control.path=/control
web.http.signaling.port=29195
web.http.signaling.path=/signaling
edc.dataplane.api.public.baseurl=http://localhost:29291/public

web.http.management.auth.key=password
Expand Down
4 changes: 3 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ format.version = "1.1"

[versions]
awaitility = "4.2.2"
edc = "0.17.0"
edc = "0.18.0"
okhttp-mockwebserver = "5.4.0"
restAssured = "6.0.0"
rsApi = "4.0.0"
Expand Down Expand Up @@ -39,8 +39,10 @@ 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-management-api-test-fixtures = { module = "org.eclipse.edc:management-api-test-fixtures", version.ref = "edc" }
edc-participant-context-config-spi = { module = "org.eclipse.edc:participant-context-config-spi", version.ref = "edc" }
edc-runtime-core = { module = "org.eclipse.edc:runtime-core", version.ref = "edc" }
edc-token-core = { module = "org.eclipse.edc:token-core", version.ref = "edc" }
edc-transfer-spi = { module = "org.eclipse.edc:transfer-spi", version.ref = "edc" }
edc-transfer-data-plane-signaling = { module = "org.eclipse.edc:transfer-data-plane-signaling", version.ref = "edc" }
edc-validator-data-address-http-data = { module = "org.eclipse.edc:validator-data-address-http-data", version.ref = "edc" }
edc-web-spi = { module = "org.eclipse.edc:web-spi", version.ref = "edc" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ plugins {
dependencies {
runtimeOnly(libs.edc.bom.controlplane.base)
runtimeOnly(libs.edc.iam.mock)

implementation(project(":policy:policy-01-policy-enforcement:policy-functions"))
}

application {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ web.http.protocol.port=29194
web.http.protocol.path=/protocol
web.http.config.port=29195
web.http.config.path=/config
web.http.signaling.port=29196
web.http.signaling.path=/signaling

web.http.management.auth.key=password
edc.dsp.callback.address=http://localhost:29194/protocol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ web.http.protocol.port=19194
web.http.protocol.path=/protocol
web.http.control.port=19195
web.http.control.path=/control
web.http.signaling.port=19196
web.http.signaling.path=/signaling

web.http.management.auth.key=password
edc.dsp.callback.address=http://localhost:19194/protocol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {
dependencies {
api(libs.edc.data.plane.spi)
api(libs.edc.json.ld.spi)
api(libs.edc.participant.context.config.spi)

implementation(libs.edc.control.plane.core)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* Copyright (c) 2026 Think-it GmbH
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Think-it GmbH - initial API and implementation
*
*/

package org.eclipse.edc.sample.extension.policy;

import org.eclipse.edc.participantcontext.spi.config.ParticipantContextConfig;
import org.eclipse.edc.runtime.metamodel.annotation.Inject;
import org.eclipse.edc.runtime.metamodel.annotation.Provider;
import org.eclipse.edc.spi.iam.AudienceResolver;
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.result.Result;
import org.eclipse.edc.spi.system.ServiceExtension;
import org.eclipse.edc.spi.types.TypeManager;

import java.util.Map;

public class IamClaimsExtension implements ServiceExtension {

@Inject
private ParticipantContextConfig contextConfig;
@Inject
private TypeManager typeManager;
@Inject
private AudienceResolver audienceResolver; // this is needed in order to permit IdentityService override

@Provider
public IdentityService identityService() {
return new MockClaimsIdentityService(contextConfig, typeManager);
}

private static class MockClaimsIdentityService implements IdentityService {
private final ParticipantContextConfig contextConfig;
private final TypeManager typeManager;

MockClaimsIdentityService(ParticipantContextConfig contextConfig, TypeManager typeManager) {
this.contextConfig = contextConfig;
this.typeManager = typeManager;
}

@Override
public Result<TokenRepresentation> obtainClientCredentials(String participantContextId, TokenParameters parameters) {

var clientId = contextConfig.getString(participantContextId, "edc.participant.id");
var token = Map.of(
"client_id", clientId,
"region", contextConfig.getString(participantContextId, "edc.mock.region", "")
);
var tokenRepresentation = TokenRepresentation.Builder.newInstance()
.token(typeManager.writeValueAsString(token))
.build();
return Result.success(tokenRepresentation);
}

@Override
public Result<ClaimToken> verifyJwtToken(String participantContextId, TokenRepresentation tokenRepresentation, VerificationContext context) {
Map<String, Object> token = typeManager.readValue(tokenRepresentation.getToken(), Map.class);

return Result.success(ClaimToken.Builder.newInstance()
.claim("client_id", token.get("client_id"))
.claim("region", token.get("region"))
.build());
}

}
}
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
org.eclipse.edc.sample.extension.policy.IamClaimsExtension
org.eclipse.edc.sample.extension.policy.PolicyFunctionsExtension
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ plugins {
}

dependencies {
runtimeOnly(libs.edc.bom.controlplane.base)
runtimeOnly(libs.edc.bom.controlplane.base) {
exclude(group = "org.eclipse.edc", module = "data-plane-signaling-core")
exclude(group = "org.eclipse.edc", module = "data-plane-signaling-oauth2")
}
implementation(libs.edc.control.plane.api.client)
implementation(libs.edc.iam.mock)
implementation(libs.edc.transfer.data.plane.signaling)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ web.http.management.port=29193
web.http.management.path=/management
web.http.protocol.port=29194
web.http.protocol.path=/protocol
edc.transfer.proxy.token.signer.privatekey.alias=private-key
edc.transfer.proxy.token.verifier.publickey.alias=public-key
web.http.public.port=29291
web.http.public.path=/public
web.http.control.port=29192
web.http.control.path=/control
web.http.control.path=/control\
web.http.signaling.port=29196
web.http.signaling.path=/signaling
edc.transfer.proxy.token.signer.privatekey.alias=private-key
edc.transfer.proxy.token.verifier.publickey.alias=public-key
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ web.http.management.port=19193
web.http.management.path=/management
web.http.protocol.port=19194
web.http.protocol.path=/protocol
edc.transfer.proxy.token.signer.privatekey.alias=private-key
edc.transfer.proxy.token.verifier.publickey.alias=public-key
web.http.public.port=19291
web.http.public.path=/public
web.http.control.port=19192
web.http.control.path=/control
web.http.signaling.port=19195
web.http.signaling.path=/signaling
edc.transfer.proxy.token.signer.privatekey.alias=private-key
edc.transfer.proxy.token.verifier.publickey.alias=public-key
edc.dataplane.api.public.baseurl=http://localhost:19291/public
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ web.http.public.port=19291
web.http.public.path=/public
web.http.control.port=19192
web.http.control.path=/control
web.http.signaling.port=19195
web.http.signaling.path=/signaling
edc.dataplane.proxy.public.endpoint=http://localhost:19291/public
Loading