expr: add HTTP helpers#4533
Conversation
|
@blotus: 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. |
|
@blotus: 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. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4533 +/- ##
===========================================
+ Coverage 37.57% 64.08% +26.51%
===========================================
Files 460 479 +19
Lines 33569 34369 +800
===========================================
+ Hits 12614 22026 +9412
+ Misses 19595 10167 -9428
- Partials 1360 2176 +816
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:
|
|
/kind enhancement |
There was a problem hiding this comment.
Pull request overview
This PR adds outbound HTTP helper functions to the pkg/exprhelpers expression library so expressions can make basic HTTP requests and inspect response status/body/headers.
Changes:
- Introduces
HTTPGet,HTTPHead,HTTPPost, andHTTPRequesthelpers backed by a sharedhttp.Client(timeout + default User-Agent injection). - Adds unit tests validating the helpers and a basic expr integration test.
- Registers the new helpers in
pkg/exprhelpers/expr_lib.goso they’re available toGetExprOptions(...).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| pkg/exprhelpers/http.go | Adds HTTP client + request helpers and HTTPResponse type exposed to expr. |
| pkg/exprhelpers/http_test.go | Adds tests for the new HTTP helpers and an expr integration test. |
| pkg/exprhelpers/expr_lib.go | Registers the new HTTP helpers in the expr function list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.