MCPcopy
hub / github.com/crowdsecurity/crowdsec / TestBadSmokeAuth

Function TestBadSmokeAuth

pkg/cticlient/client_test.go:249–255  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

247}
248
249func TestBadSmokeAuth(t *testing.T) {
250 ctiClient := NewCrowdsecCTIClient(WithAPIKey("asdasd"), WithHTTPClient(&http.Client{
251 Transport: RoundTripFunc(smokeHandler),
252 }))
253 _, err := ctiClient.GetIPInfo("1.1.1.1")
254 require.EqualError(t, err, ErrUnauthorized.Error())
255}
256
257func TestSmokeInfoValidIP(t *testing.T) {
258 ctiClient := NewCrowdsecCTIClient(WithAPIKey(validApiKey), WithHTTPClient(&http.Client{

Callers

nothing calls this directly

Calls 6

GetIPInfoMethod · 0.95
NewCrowdsecCTIClientFunction · 0.85
WithAPIKeyFunction · 0.85
WithHTTPClientFunction · 0.85
RoundTripFuncFuncType · 0.70
ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…