-
Notifications
You must be signed in to change notification settings - Fork 3
alerts client #21
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
base: main
Are you sure you want to change the base?
alerts client #21
Conversation
|
I don't know how to fix rest of pipelines |
|
Hi @gam6itko, Thanks for this PR. May I ask why you need a Watcher client ? Do you have a use case ? Thanks |
It’s needed to get the authentication token and use it within the TokenStorageInterface. This follows the Dependency Inversion Principle (DIP). I also plan to implement the remaining methods (allowlist) in the future. |
My question was more about the fact that, until now, this library has only been used for bouncing purposes. The Watcher client is not intended for bouncing, so in what context do you want to use it? Is it to have a separate log processor or something? Thanks |
Translation: The library is called php-lapi-client. I assumed it should provide a convenient interface for working with all CrowdSec LAPI methods. I need to send custom alerts from my application. I believe it’s better to extend the existing library rather than create a new one. If you think that WatcherClient purpose just covers |
|
Hi @gam6itko After discussing it with the internal team, I will examine the PR in more detail. We think this could be an interesting feature to add, but we need to evaluate whether it would add too much maintenance overhead and ensure that it would not disrupt the functioning of other PHP libraries that depend on it. Thanks again |
|
Hi @gam6itko Just an update to inform you that I'm working on this (when I can). For now, I have created a new branch from yours in order to fix some errors (unit tests, etc.). Will try to continue working on this asap. Thanks |
✨ Key Changes
Added
AbstractLapiClientAdded
AlertsClientNew client for managing LAPI
alertsendpoints.Implemented methods:
listAlerts()— retrieve a list of alerts;getAlertById(int $id)— fetch a specific alert by ID;createAlert(array $data)— create a new alert;deleteAlert(int $id)— delete an alert;Added integration tests for
AlertsClientAdded
WatcherClientAdded
BouncerClientBouncerclass is now marked as deprecated and will be removed in a future release.