1414
1515package org .eclipse .edc .virtualized ;
1616
17- import org .eclipse .edc .connector .controlplane .services .spi .asset .AssetService ;
18- import org .eclipse .edc .connector .controlplane .services .spi .catalog .CatalogService ;
19- import org .eclipse .edc .connector .controlplane .services .spi .contractdefinition .ContractDefinitionService ;
20- import org .eclipse .edc .connector .controlplane .services .spi .contractnegotiation .ContractNegotiationService ;
21- import org .eclipse .edc .connector .controlplane .services .spi .policydefinition .PolicyDefinitionService ;
22- import org .eclipse .edc .connector .controlplane .services .spi .transferprocess .TransferProcessService ;
23- import org .eclipse .edc .junit .extensions .ComponentRuntimeContext ;
2417import org .eclipse .edc .junit .utils .Endpoints ;
25- import org .eclipse .edc .participantcontext .spi .config .service .ParticipantContextConfigService ;
26- import org .eclipse .edc .participantcontext .spi .service .ParticipantContextService ;
2718import org .eclipse .edc .spi .system .configuration .Config ;
2819import org .eclipse .edc .spi .system .configuration .ConfigFactory ;
29- import org .eclipse .edc .virtualized .transfer .fixtures .VirtualConnector ;
3020
3121import java .net .URI ;
3222import java .util .HashMap ;
23+ import java .util .Map ;
24+ import java .util .Objects ;
3325
3426import static org .eclipse .edc .util .io .Ports .getFreePort ;
3527
3628public interface Runtimes {
37-
29+
3830 interface ControlPlane {
3931 String NAME = "controlplane" ;
4032
@@ -46,6 +38,10 @@ interface ControlPlane {
4638 ":system-tests:runtimes:e2e:e2e-controlplane-postgres" ,
4739 };
4840
41+ String [] DCP_PG_MODULES = {
42+ ":system-tests:runtimes:e2e:e2e-dcp-controlplane-postgres" ,
43+ };
44+
4945 Endpoints .Builder ENDPOINTS = Endpoints .Builder .newInstance ()
5046 .endpoint ("control" , () -> URI .create ("http://localhost:" + getFreePort () + "/control" ))
5147 .endpoint ("protocol" , () -> URI .create ("http://localhost:" + getFreePort () + "/protocol" ));
@@ -58,19 +54,40 @@ static Config config() {
5854 }
5955 });
6056 }
57+ }
58+
59+ interface Issuer {
60+ String NAME = "issuer" ;
61+
62+ String [] MODULES = {
63+ ":system-tests:runtimes:issuer" ,
64+ };
65+ }
66+
67+ interface IdentityHub {
68+ String NAME = "identityhub" ;
69+
70+ String [] MODULES = {
71+ ":system-tests:runtimes:identity-hub" ,
72+ };
73+
74+ static String didFor (Endpoints endpoints , String participantContextId ) {
75+ var didEndpoint = Objects .requireNonNull (endpoints .getEndpoint ("did" ));
76+ String didLocation = String .format ("%s%%3A%s" , didEndpoint .get ().getHost (), didEndpoint .get ().getPort ());
77+ return String .format ("did:web:%s:%s" , didLocation , participantContextId );
78+ }
6179
62- static VirtualConnector connector (ComponentRuntimeContext ctx ) {
63- return new VirtualConnector (
64- ctx .getService (ParticipantContextService .class ),
65- ctx .getService (ParticipantContextConfigService .class ),
66- ctx .getService (AssetService .class ),
67- ctx .getService (PolicyDefinitionService .class ),
68- ctx .getService (ContractDefinitionService .class ),
69- ctx .getService (CatalogService .class ),
70- ctx .getService (ContractNegotiationService .class ),
71- ctx .getService (TransferProcessService .class ),
72- ctx .getEndpoint ("protocol" )
73- );
80+ static Config dcpConfig (Endpoints endpoints , String participantContextId ) {
81+ var did = didFor (endpoints , participantContextId );
82+ var stsEndpoint = Objects .requireNonNull (endpoints .getEndpoint ("sts" ));
83+ return ConfigFactory .fromMap (Map .of (
84+ "edc.participant.id" , did ,
85+ "edc.iam.issuer.id" , did ,
86+ "edc.iam.sts.oauth.client.id" , did ,
87+ "edc.iam.sts.oauth.client.secret.alias" , did + "-alias" ,
88+ "edc.iam.sts.oauth.token.url" , stsEndpoint .get ().toString () + "/token" ,
89+ "edc.iam.did.web.use.https" , "false"
90+ ));
7491 }
7592 }
7693}
0 commit comments