Skip to content

Commit 0a984e8

Browse files
committed
Refactoring to move all packages to "org.eclipse.edc.heleade". Fixed docker compose volume paths. Further work on verification endpoint (WIP)
1 parent e2bf159 commit 0a984e8

File tree

10 files changed

+57
-29
lines changed

10 files changed

+57
-29
lines changed

consumers/consumer-base/resources/configuration/consumer-base-docker-configuration.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ web.http.public.path=/public
2929

3030
# identity
3131
edc.participant.registry.url=http://federated-catalog:39191/api/
32-
edc.participant.claims=identity/claims.json
33-
edc.participant.private.key=identity/ed25519_private.pem
34-
edc.participant.public.key=identity/ed25519_public.pem
32+
edc.participant.claims=/identity/claims.json
33+
edc.participant.private.key=/identity/ed25519_private.pem
34+
edc.participant.public.key=/identity/ed25519_public.pem

docker-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ services:
3131
build: ./providers/provider-base
3232
restart: on-failure:5
3333
volumes:
34-
- ./resources/identity:/identity
34+
- ./providers/provider-base/resources/identity:/identity
3535
networks:
3636
- base-ds-network
3737

@@ -43,7 +43,7 @@ services:
4343
- "29194:29194"
4444
build: ./consumers/consumer-base
4545
volumes:
46-
- ./resources/identity:/identity
46+
- ./consumers/consumer-base/resources/identity:/identity
4747
networks:
4848
- base-ds-network
4949

iam-identity/src/main/java/org/eclipse/edc/identity/IamIdentityExtension.java renamed to iam-identity/src/main/java/org/eclipse/edc/heleade/identity/IamIdentityExtension.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
*
1313
*/
1414

15-
package org.eclipse.edc.identity;
15+
package org.eclipse.edc.heleade.identity;
1616

17-
import org.eclipse.edc.identity.api.IamIdentityApiController;
18-
import org.eclipse.edc.identity.load.FileParticipantIdentityLoader;
19-
import org.eclipse.edc.identity.load.ParticipantIdentityLoader;
17+
import org.eclipse.edc.heleade.identity.api.IamIdentityApiController;
18+
import org.eclipse.edc.heleade.identity.load.FileParticipantIdentityLoader;
19+
import org.eclipse.edc.heleade.identity.load.ParticipantIdentityLoader;
2020
import org.eclipse.edc.runtime.metamodel.annotation.Extension;
2121
import org.eclipse.edc.runtime.metamodel.annotation.Inject;
2222
import org.eclipse.edc.runtime.metamodel.annotation.Provider;
@@ -64,6 +64,9 @@ public class IamIdentityExtension implements ServiceExtension {
6464
@Inject
6565
private TypeManager typeManager;
6666

67+
@Inject
68+
WebService webService;
69+
6770

6871
@Override
6972
public String name() {
@@ -106,12 +109,11 @@ public void initialize(ServiceExtensionContext context) {
106109
}
107110
}
108111

112+
IamIdentityService iamIdentityService = new IamIdentityService(typeManager, claims, participantId, signedClaims);
113+
context.registerService(IdentityService.class, iamIdentityService);
109114

110-
webService.registerResource(new IamIdentityApiController(context.getMonitor()));
115+
webService.registerResource(new IamIdentityApiController(iamIdentityService, context.getMonitor()));
111116

112-
context.registerService(
113-
IdentityService.class,
114-
new IamIdentityService(typeManager, claims, participantId, signedClaims));
115117
}
116118

117119
/**
@@ -124,8 +126,4 @@ public AudienceResolver audienceResolver() {
124126
return (msg) -> Result.success(msg.getCounterPartyAddress());
125127
}
126128

127-
@Inject
128-
WebService webService;
129-
130-
131129
}

iam-identity/src/main/java/org/eclipse/edc/identity/IamIdentityService.java renamed to iam-identity/src/main/java/org/eclipse/edc/heleade/identity/IamIdentityService.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
*/
1414

15-
package org.eclipse.edc.identity;
15+
package org.eclipse.edc.heleade.identity;
1616
import org.eclipse.edc.spi.iam.ClaimToken;
1717
import org.eclipse.edc.spi.iam.IdentityService;
1818
import org.eclipse.edc.spi.iam.TokenParameters;
@@ -98,6 +98,32 @@ public IamIdentityService(TypeManager typeManager,
9898
this.signedClaims = signedClaims;
9999
}
100100

101+
/**
102+
* Returns the claims
103+
*
104+
* @return a {@link Map} representing the claims
105+
*/
106+
public Map<String, Object> getClaims() {
107+
return claims;
108+
}
109+
110+
/**
111+
* Returns the client id
112+
*
113+
* @return a {@link String} containing the participant id
114+
*/
115+
public String getClientId() {
116+
return clientId;
117+
}
118+
119+
/**
120+
* Returns the signed claims
121+
*
122+
* @return a {@link String} representing the signed claims
123+
*/
124+
public String getSignedClaims() {
125+
return signedClaims;
126+
}
101127

102128
/**
103129
* Generates and returns a client credentials token representation based on the provided token parameters.

iam-identity/src/main/java/org/eclipse/edc/identity/api/IamIdentityApiController.java renamed to iam-identity/src/main/java/org/eclipse/edc/heleade/identity/api/IamIdentityApiController.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
*
1313
*/
1414

15-
package org.eclipse.edc.identity.api;
15+
package org.eclipse.edc.heleade.identity.api;
1616

1717
import jakarta.ws.rs.Consumes;
1818
import jakarta.ws.rs.GET;
1919
import jakarta.ws.rs.Path;
2020
import jakarta.ws.rs.Produces;
2121
import jakarta.ws.rs.core.MediaType;
22+
import org.eclipse.edc.heleade.identity.IamIdentityService;
2223
import org.eclipse.edc.spi.monitor.Monitor;
2324

2425
/**
@@ -30,17 +31,19 @@
3031
public class IamIdentityApiController {
3132

3233
private final Monitor monitor;
34+
private final IamIdentityService iamIdentityService;
3335

3436
/**
3537
* Instantiates the controller for the verify identity endpoint
3638
*
39+
* @param iamIdentityService identity service
3740
* @param monitor logger object
3841
*/
39-
public IamIdentityApiController(Monitor monitor) {
42+
public IamIdentityApiController(IamIdentityService iamIdentityService, Monitor monitor) {
43+
this.iamIdentityService = iamIdentityService;
4044
this.monitor = monitor;
4145
}
42-
43-
46+
4447
/**
4548
* Defines the verify identity endpoint
4649
*
@@ -49,7 +52,8 @@ public IamIdentityApiController(Monitor monitor) {
4952
@GET
5053
@Path("/verify-identity")
5154
public String verify() {
52-
monitor.info("Verify received a health request");
55+
monitor.debug("Verify identity received a request");
56+
5357
return "{\"response\":\"IdentityProvider: I'm alive!\"}";
5458
}
5559
}

iam-identity/src/main/java/org/eclipse/edc/identity/load/FileParticipantIdentityLoader.java renamed to iam-identity/src/main/java/org/eclipse/edc/heleade/identity/load/FileParticipantIdentityLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
*/
1414

15-
package org.eclipse.edc.identity.load;
15+
package org.eclipse.edc.heleade.identity.load;
1616

1717
import com.fasterxml.jackson.core.type.TypeReference;
1818
import com.fasterxml.jackson.databind.ObjectMapper;

iam-identity/src/main/java/org/eclipse/edc/identity/load/ParticipantIdentityLoader.java renamed to iam-identity/src/main/java/org/eclipse/edc/heleade/identity/load/ParticipantIdentityLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
*/
1414

15-
package org.eclipse.edc.identity.load;
15+
package org.eclipse.edc.heleade.identity.load;
1616

1717
import org.eclipse.edc.spi.monitor.Monitor;
1818

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
org.eclipse.edc.identity.IamIdentityExtension
1+
org.eclipse.edc.heleade.identity.IamIdentityExtension

providers/policy/policy-always-true/src/main/java/org/eclipse/edc/policy/extension/AlwaysTruePolicyExtension.java renamed to providers/policy/policy-always-true/src/main/java/org/eclipse/edc/heleade/policy/extension/AlwaysTruePolicyExtension.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
*/
1414

15-
package org.eclipse.edc.policy.extension;
15+
package org.eclipse.edc.heleade.policy.extension;
1616

1717
import org.eclipse.edc.connector.controlplane.policy.spi.PolicyDefinition;
1818
import org.eclipse.edc.connector.controlplane.services.spi.policydefinition.PolicyDefinitionService;
@@ -24,7 +24,7 @@
2424
import org.eclipse.edc.spi.EdcException;
2525
import org.eclipse.edc.spi.system.ServiceExtension;
2626

27-
import static org.eclipse.edc.policy.extension.AlwaysTruePolicyExtension.NAME;
27+
import static org.eclipse.edc.heleade.policy.extension.AlwaysTruePolicyExtension.NAME;
2828
import static org.eclipse.edc.policy.model.OdrlNamespace.ODRL_SCHEMA;
2929

3030

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
org.eclipse.edc.policy.extension.AlwaysTruePolicyExtension
1+
org.eclipse.edc.heleade.policy.extension.AlwaysTruePolicyExtension

0 commit comments

Comments
 (0)