mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 12:25:53 +02:00
context propagation: pkg/apiserver (#3272)
* context propagation: apic.Push() * context propagation: NewServer() * lint
This commit is contained in:
parent
40021b6bcf
commit
b9bccfa56f
12 changed files with 59 additions and 61 deletions
|
@ -65,7 +65,7 @@ func (l *LAPI) RecordResponse(t *testing.T, ctx context.Context, verb string, ur
|
|||
}
|
||||
|
||||
func InitMachineTest(t *testing.T, ctx context.Context) (*gin.Engine, models.WatcherAuthResponse, csconfig.Config) {
|
||||
router, config := NewAPITest(t)
|
||||
router, config := NewAPITest(t, ctx)
|
||||
loginResp := LoginToTestAPI(t, ctx, router, config)
|
||||
|
||||
return router, loginResp, config
|
||||
|
@ -137,7 +137,7 @@ func TestCreateAlert(t *testing.T) {
|
|||
|
||||
func TestCreateAlertChannels(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
apiServer, config := NewAPIServer(t)
|
||||
apiServer, config := NewAPIServer(t, ctx)
|
||||
apiServer.controller.PluginChannel = make(chan csplugin.ProfileAlert)
|
||||
apiServer.InitController()
|
||||
|
||||
|
@ -437,7 +437,7 @@ func TestDeleteAlertTrustedIPS(t *testing.T) {
|
|||
// cfg.API.Server.TrustedIPs = []string{"1.2.3.4", "1.2.4.0/24", "::"}
|
||||
cfg.API.Server.TrustedIPs = []string{"1.2.3.4", "1.2.4.0/24"}
|
||||
cfg.API.Server.ListenURI = "::8080"
|
||||
server, err := NewServer(cfg.API.Server)
|
||||
server, err := NewServer(ctx, cfg.API.Server)
|
||||
require.NoError(t, err)
|
||||
|
||||
err = server.InitController()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue