crowdsecurity / crowdsec

CrowdSec - the open-source and participative security solution offering crowdsourced protection against malicious IPs and access to the most advanced real-world CTI.
https://crowdsec.net
MIT License
8.1k stars 419 forks source link

[LAPI] Pass request context to all database queries #3089

Open LaurenceJJones opened 1 week ago

LaurenceJJones commented 1 week ago

Currently when a user requests an endpoint that does a SQL query the underlying context that is passed is the context of the database client, however, if the user cancels the request the SQL query is not abandoned.

https://github.com/crowdsecurity/crowdsec/blob/4521a98ecc34cf4beeee653f1eb5914f1879f42d/pkg/apiserver/controllers/v1/alerts.go#L278C22-L293

This may be something we want to aim for LAPI v2 as it might be a big refactor

github-actions[bot] commented 1 week ago

@LaurenceJJones: Thanks for opening an issue, it is currently awaiting triage.

In the meantime, you can:

  1. Check Crowdsec Documentation to see if your issue can be self resolved.
  2. You can also join our Discord.
  3. Check Releases to make sure your agent is on the latest version.
Details I am a bot created to help the [crowdsecurity](https://github.com/crowdsecurity) developers manage community feedback and contributions. You can check out my [manifest file](https://github.com/crowdsecurity/crowdsec/blob/master/.github/governance.yml) to understand my behavior and what I can do. If you want to use this for your project, you can check out the [BirthdayResearch/oss-governance-bot](https://github.com/BirthdayResearch/oss-governance-bot) repository.
github-actions[bot] commented 1 week ago

@LaurenceJJones: There are no 'kind' label on this issue. You need a 'kind' label to start the triage process.

Details I am a bot created to help the [crowdsecurity](https://github.com/crowdsecurity) developers manage community feedback and contributions. You can check out my [manifest file](https://github.com/crowdsecurity/crowdsec/blob/master/.github/governance.yml) to understand my behavior and what I can do. If you want to use this for your project, you can check out the [BirthdayResearch/oss-governance-bot](https://github.com/BirthdayResearch/oss-governance-bot) repository.
mmetc commented 1 week ago

https://github.com/crowdsecurity/crowdsec/pull/3073