Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/api/injects/execution... callback routes: Coupling between routes make for brittle behaviour #2231

Open
antoinemzs opened this issue Jan 17, 2025 · 0 comments
Labels
feature use for describing a new feature to develop technical improvement Technical refactor or improvement is needed

Comments

@antoinemzs
Copy link
Contributor

Description

These routes are thightly coupled:

  • /api/injects/execution/callback/{injectId}
  • /api/injects/execution/{agentId}/callback/{injectId}

The first one was mistakenly deleted during work to handle multiple agents per host. However it had to be reintroduced due to it being used by the external injectors, specifically the pyhton http-query injector.

The newly reintroduced first calls the second while passing null as the agentId, which is less than ideal and can create more problems down the line, forcing a null handling in the agent-specific route.

Desired Solution

Inject update behaviour should be extracted away from the route method and exposed as part of a service, enabling the two routes to call the methods relevant to them in the right fashion. There should be no coupling between the specific code of both routes.l)

@antoinemzs antoinemzs added bug use for describing something not working as expected technical improvement Technical refactor or improvement is needed labels Jan 17, 2025
@antoinemzs antoinemzs changed the title Coupling between routes make for brittle behaviour /api/injects/execution/callback: Coupling between routes make for brittle behaviour Jan 17, 2025
@antoinemzs antoinemzs changed the title /api/injects/execution/callback: Coupling between routes make for brittle behaviour /api/injects/execution... callback routes: Coupling between routes make for brittle behaviour Jan 17, 2025
@guillaumejparis guillaumejparis modified the milestone: Release 1.11.1 Jan 17, 2025
@jborozco jborozco added this to the Bugs backlog milestone Jan 17, 2025
@jborozco jborozco added feature use for describing a new feature to develop and removed bug use for describing something not working as expected labels Jan 27, 2025
@EllynBsc EllynBsc removed this from the Bugs backlog milestone Jan 27, 2025
@jborozco jborozco modified the milestone: Bugs backlog Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature use for describing a new feature to develop technical improvement Technical refactor or improvement is needed
Projects
None yet
Development

No branches or pull requests

4 participants