Repository navigation
Conversation
|
@somaz94: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file 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 repository. |
|
@somaz94: There are no area labels on this PR. You can add as many areas as you see fit.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file 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 repository. |
|
/kind fix |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4775 +/- ##
==========================================
+ Coverage 71.82% 72.23% +0.41%
==========================================
Files 545 527 -18
Lines 37163 36526 -637
==========================================
- Hits 26691 26384 -307
+ Misses 10471 10141 -330
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
What and why
When bouncers share one API key and the first two requests from a new IP arrive at the same time, both miss
SelectBouncerWithIPand both try to create thename@iprow. The loser got a unique constraint error fromCreateBouncer, andauthPlainanswered 403 for a valid key;authTLShad the same pattern.CreateBouncernow returns a typedBouncerExistsErroron that error, with the same message socscli bouncers addoutput does not change, and both paths re-read the row the other request just created and authenticate against it. A row with that name but another key, or an API key row on the TLS path, is still rejected.Fixes #4774
How it was tested
I read the diff line by line. Claude Code ran the checks below while I watched, and I checked their output.
TestAPIKeyMiddlewareAutoCreatedBounceruses an ent hook to insert the row right before the middleware creates it, on the API key and the TLS path, plus the two cases that must still be rejected. On master the two concurrent cases fail withbouncer test@4.3.2.1 already existsand a 403; with this change all six pass.The Windows
Build + testsjob (TestStreamingAcquisitionMTLStimeout inpkg/acquisition/modules/http) andhub / Functional tests(socket path too long) fail the same way on master.Checklist
cscli -o json|rawoutput.AI assistance used: mostly