From 55035e599b48d3c6a33e58d66995bbb864e4444a Mon Sep 17 00:00:00 2001 From: Mike Yastrebtsov Date: Fri, 9 Aug 2024 17:08:48 +0300 Subject: [PATCH] - fix linter - add security CI action --- .github/workflows/sec.yml | 17 ++++------------- httpserver/middleware/rate_limit_test.go | 5 +++++ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/sec.yml b/.github/workflows/sec.yml index f26693b..e12987e 100644 --- a/.github/workflows/sec.yml +++ b/.github/workflows/sec.yml @@ -22,20 +22,11 @@ jobs: shell: bash steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: TruffleHog OSS - id: trufflehog - uses: trufflesecurity/trufflehog@add-actions-cli-switch - continue-on-error: true + - name: Secret Scanning + uses: trufflesecurity/trufflehog@main with: - path: ./ - base: "${{ github.event.repository.default_branch }}" - head: HEAD - extra_args: --debug --only-verified  - - - name: Scan Results Status - if: steps.trufflehog.outcome == 'failure' - run: exit 1 + extra_args: --only-verified diff --git a/httpserver/middleware/rate_limit_test.go b/httpserver/middleware/rate_limit_test.go index 087183a..710d56f 100644 --- a/httpserver/middleware/rate_limit_test.go +++ b/httpserver/middleware/rate_limit_test.go @@ -11,6 +11,7 @@ import ( "math" "net/http" "net/http/httptest" + "runtime" "strconv" "sync" "testing" @@ -191,6 +192,10 @@ func TestRateLimitHandler_ServeHTTP(t *testing.T) { }) t.Run("leaky bucket, maxRate=10r/s, maxBurst=10, by key", func(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("Skip on Windows as unstable") + } + const headerClientID = "X-Client-ID" rate := Rate{10, time.Second} const (