Commit graph

21 commits

Author SHA1 Message Date
mmetc
7891268486
lapi: return specific error if a unix socket path is too long for the OS (#3593) 2025-04-29 12:42:49 +02:00
mmetc
45624c6fe5
tests: switch context.Background() -> t.Context() from go 1.24 (#3473) 2025-02-21 00:09:11 +01:00
mmetc
4e6e6dec65
lint: explicit error checks (#3388)
* errcheck: tests
* fflag errcheck
* http_test errcheck (avoid duplicate metric registration)
2025-01-02 12:33:54 +01:00
mmetc
ecf34c2fa1
lint/deep-exit: avoid log.Fatal (#3367)
* lint/deep-exit: don't fail on invalid alert
* lint/deep-exit: kinesis_test.go
* lint/deep-exit: watcher_test.go
* lint/deep-exit: parsing_test.go
* lint/deep-exit: client_test.go
2024-12-18 16:43:19 +01:00
mmetc
8a74faed43
context propagation: cscli {capi,lapi,papi} (#3228)
* context propagation: lapi status, capi status, papi status

* context propagation: lapi register, capi register

* lint
2024-09-12 21:16:55 +02:00
mmetc
c8750f604c
refact: pkg/apiclient set and use default user agent (#3219)
* default user agent

* DRY default user agent

* useragent.go

* moved to pkg/apiclient/useragent

* lint

* rename useragent.DefaultUserAgent() -> useragent.Default()
2024-09-09 11:27:20 +02:00
mmetc
3532e872d3
metrics: avoid nil deref with inactive bouncers or malformed response (#3170)
* metrics: avoid nil deref with inactive bouncers

* log message from API even it if cannot be parsed

* fix unit test
2024-08-08 16:46:39 +02:00
mmetc
64e4ecde90
LAPI: detailed metrics endpoint (#2858) 2024-07-24 10:29:18 +02:00
mmetc
7d6514c7cc
update user agent with version and platform information (#3035)
* update user agent with version and platform information

* remove unused import

* user agent: omit tag correctly if git is dirty
2024-05-30 09:45:43 +02:00
mmetc
6c042f18f0
LAPI: local api unix socket support (#2770) 2024-03-14 10:43:02 +01:00
mmetc
da746f77d5
apiserver/apiclient: compact tests (#2694)
* apiserver/apiclient: compact tests
* update golangci-lint configuration
2024-01-04 17:10:36 +01:00
mmetc
89f704ef18
light pkg/api{client,server} refact (#2659)
* tests: don't run crowdsec if not necessary
* make listen_uri report the random port number when 0 is requested
* move apiserver.getTLSAuthType() -> csconfig.TLSCfg.GetAuthType()
* move apiserver.isEnrolled() -> apiclient.ApiClient.IsEnrolled()
* extract function apiserver.recoverFromPanic()
* simplify and move APIServer.GetTLSConfig() -> TLSCfg.GetTLSConfig()
* moved TLSCfg type to csconfig/tls.go
* APIServer.InitController(): early return / happy path
* extract function apiserver.newGinLogger()
* lapi tests
* update unit test
* lint (testify)
* lint (whitespace, variable names)
* update docker tests
2023-12-14 14:54:11 +01:00
mmetc
ffadd42779
update dependency on go-cs-lib; drop the pkg/ part (#2393) 2023-07-28 16:35:08 +02:00
mmetc
fddf597040
errors.Wrap -> fmt.Errorf; clean up imports (#2297) 2023-06-22 15:01:34 +02:00
mmetc
534328ca30
decouple bouncer dependencies: use go-cs-lib/pkg/* (#2216)
* decouple bouncer dependencies: use go-cs-lib/pkg/trace
* decouple bouncer dependencies: use go-cs-lib/pkg/version
* decouple bouncer dependencies: use go-cs-lib/pkg/yamlpatch
* decouple bouncer dependencies: use go-cs-lib/pkg/csstring
* unused import
2023-05-23 10:52:47 +02:00
Cristian Nitescu
987f119c4b
v3 capi and blocklists links support (#2019)
* v3 model generation

* v3 model generation

* comms

* fixes after master merge

* missing reader close

* use constants defined for types

---------

Co-authored-by: bui <thibault@crowdsec.net>
2023-02-06 14:06:14 +01:00
mmetc
7674f907c4
replace log.Fatal with t.Fatal (#1805)
This is required to run deferred teardown functions
2022-10-13 10:42:46 +02:00
mmetc
628d7be1d8
simplify err.Error() to err when used in printf context (#1603) 2022-06-22 15:53:53 +02:00
blotus
0449ec1868
Windows Support (#1159) 2022-05-17 12:14:59 +02:00
Thibault "bui" Koechlin
bed90a832e
fix #919 : display error message (#929)
* fix #919

* fix tests
2021-09-02 12:46:32 +02:00
Thibault "bui" Koechlin
71ac0d2fce
Apiclient tests (#484)
Co-authored-by: AlteredCoder
Co-authored-by: erenJag
2020-11-30 16:15:07 +01:00