Skip to content

Commit

Permalink
[backend] fix python injector missing callback route (#2230)
Browse files Browse the repository at this point in the history
Co-authored-by: Romuald Lemesle <[email protected]>
  • Loading branch information
guillaumejparis and RomuDeuxfois authored Jan 17, 2025
1 parent dae4558 commit 9eed9a9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion openbas-api/src/main/java/io/openbas/rest/inject/InjectApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,18 @@ public Inject injectExecutionReception(
return injectRepository.save(inject);
}

@Secured(ROLE_ADMIN)
@PostMapping(INJECT_URI + "/execution/callback/{injectId}")
public Inject injectExecutionCallback(
@PathVariable String injectId, @Valid @RequestBody InjectExecutionInput input) {
return injectExecutionCallback(null, injectId, input);
}

@Secured(ROLE_ADMIN)
@PostMapping(INJECT_URI + "/execution/{agentId}/callback/{injectId}")
public Inject injectExecutionCallback(
@PathVariable String agentId,
@PathVariable
String agentId, // must allow null because http injector used also this method to work.
@PathVariable String injectId,
@Valid @RequestBody InjectExecutionInput input) {
Inject inject = injectRepository.findById(injectId).orElseThrow(ElementNotFoundException::new);
Expand Down

0 comments on commit 9eed9a9

Please sign in to comment.