-
Greetings, I have written an ServiceExtension which has injected a Webservice like in the Samples. I use gradle and added Sadly my endoint edit: edv-version 0.6.4
//more properties...
web.http.my-endpoint.port=56789
web.http.my-endpoint.path=/my-endpoint
web.http.my-endpoint.type=tokenbased
web.http.my-endpoint.auth.key=apiKey My public class MyExtension implements ServiceExtension {
@Inject
DataFlowManager dataFlowManager;
@Inject
WebService webService;
@Override
public void initialize(ServiceExtensionContext context) {
//TODO: implement initialization
System.out.println("init extension...");
Monitor monitor = context.getMonitor();
monitor.debug("Registering MyExtension");
webService.registerResource("my-endpoint",new CustomApiController(monitor));
dataFlowManager.register(new MyDataFlowController(monitor));
}
@Override
public String name() {
return "name";
}
} My @Consumes({MediaType.APPLICATION_JSON})
@Produces({MediaType.APPLICATION_JSON})
@Path("/")
public class CustomApiController {
private final Monitor monitor;
public CustomApiController(Monitor monitor) {
this.monitor = monitor;
}
@GET
@Path("hello")
public String checkHealth() {
monitor.info("Received a health request for hello-endpoint");
return "{\"response\":\"I'm alive!\"}";
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 15 replies
-
Hi @3rim probably you miss the extension that configure the edc-auth-configuration = { module = "org.eclipse.edc:auth-configuration", version.ref = "edc" } Let me know if this helps Thanks |
Beta Was this translation helpful? Give feedback.
-
Nope it was introduced here For that version you have wire it manually. If i remember correctly you just need to inject @Inject
private AuthenticationService authenticationService; and then register a resource webService.registerResource("my-endpoint", new AuthenticationRequestFilter(authenticationService)); |
Beta Was this translation helpful? Give feedback.
-
@wolf4ood |
Beta Was this translation helpful? Give feedback.
-
yes it was introduced here |
Beta Was this translation helpful? Give feedback.
Nope it was introduced here
For that version you have wire it manually. If i remember correctly you just need to inject
and then register a resource