From 7ea64d8df2dd57f73ce7a1e57468090450d843d8 Mon Sep 17 00:00:00 2001 From: Paul Greenberg Date: Wed, 23 Mar 2022 11:29:35 -0400 Subject: [PATCH] upgrade to github.com/greenpau/go-authcrunch@v1.0.19 --- .github/workflows/codeql-analysis.yml | 39 --------------------------- .github/workflows/main.yml | 2 +- CONTRIBUTING.md | 6 ++--- Makefile | 2 +- caddyfile_authz_test.go | 4 +-- go.mod | 2 +- go.sum | 4 +-- 7 files changed, 10 insertions(+), 49 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index fdbbea7..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: "CodeQL" - -on: - workflow_dispatch: {} - schedule: - - cron: '24 22 * * 0' -# push: -# branches: [ main ] -# pull_request: -# branches: [ main ] - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'go' ] - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - name: Build - run: | - make - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0ce69aa..6b091b7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: core: strategy: matrix: - go-version: [1.16.x] + go-version: [1.17.x] platform: [ubuntu-latest] name: Build runs-on: ${{ matrix.platform }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 32e9e37..f3b94ef 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -81,10 +81,10 @@ module github.com/greenpau/caddy-security go 1.16 require ( - github.com/greenpau/go-authcrunch v1.0.18 + github.com/greenpau/go-authcrunch v1.0.19 ) -replace github.com/greenpau/go-authcrunch v1.0.18 => /home/greenpau/dev/go/src/github.com/greenpau/go-authcrunch +replace github.com/greenpau/go-authcrunch v1.0.19 => /home/greenpau/dev/go/src/github.com/greenpau/go-authcrunch ``` Then, modify `Makefile` such that that replacement passes to `xcaddy` builder: @@ -93,7 +93,7 @@ Then, modify `Makefile` such that that replacement passes to `xcaddy` builder: @mkdir -p ../xcaddy-$(PLUGIN_NAME) && cd ../xcaddy-$(PLUGIN_NAME) && \ xcaddy build $(CADDY_VERSION) --output ../$(PLUGIN_NAME)/bin/caddy \ --with github.com/greenpau/caddy-security@$(LATEST_GIT_COMMIT)=$(BUILD_DIR) \ - --with github.com/greenpau/go-authcrunch@v1.0.18=/home/greenpau/dev/go/src/github.com/greenpau/go-authcrunch + --with github.com/greenpau/go-authcrunch@v1.0.19=/home/greenpau/dev/go/src/github.com/greenpau/go-authcrunch ``` Once all the necessary packages are installed, you should be ready to compile diff --git a/Makefile b/Makefile index 4d6f0f3..370d183 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ all: info xcaddy build $(CADDY_VERSION) --output ../$(PLUGIN_NAME)/bin/caddy \ --with github.com/greenpau/caddy-security@$(LATEST_GIT_COMMIT)=$(BUILD_DIR) \ --with github.com/greenpau/caddy-trace@v1.1.8 - @#--with github.com/greenpau/go-authcrunch@v1.0.18=/home/greenpau/dev/go/src/github.com/greenpau/go-authcrunch + @#--with github.com/greenpau/go-authcrunch@v1.0.19=/home/greenpau/dev/go/src/github.com/greenpau/go-authcrunch @#bin/caddy run -config assets/config/Caddyfile @for f in `find ./assets -type f -name 'Caddyfile'`; do bin/caddy fmt -overwrite $$f; done diff --git a/caddyfile_authz_test.go b/caddyfile_authz_test.go index 983859b..8e0d76a 100644 --- a/caddyfile_authz_test.go +++ b/caddyfile_authz_test.go @@ -91,8 +91,8 @@ func TestParseCaddyfileAuthorization(t *testing.T) { validate path acl validate source address validate bearer header - with basic auth - with api key auth + with basic auth context default + with api key auth context default allow roles authp/admin authp/user } }`), diff --git a/go.mod b/go.mod index 5f55bb7..ee74d53 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/caddyserver/caddy/v2 v2.4.6 github.com/google/go-cmp v0.5.7 - github.com/greenpau/go-authcrunch v1.0.18 + github.com/greenpau/go-authcrunch v1.0.19 github.com/satori/go.uuid v1.2.0 go.uber.org/zap v1.20.0 ) diff --git a/go.sum b/go.sum index d26a232..dc41caa 100644 --- a/go.sum +++ b/go.sum @@ -476,8 +476,8 @@ github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/greenpau/go-authcrunch v1.0.18 h1:g9Ev4MVOP2pq+DnEThq0r8Vtfcuj43+MJSIn11eX190= -github.com/greenpau/go-authcrunch v1.0.18/go.mod h1:wiUiQW5IPGxX8jAZMnqs/nhMF0DFHQAqEYsb8nU3KEE= +github.com/greenpau/go-authcrunch v1.0.19 h1:O5qmYJpmQrEmGzOkgU3voZoSrd4OVr7AszpWGX0M6VA= +github.com/greenpau/go-authcrunch v1.0.19/go.mod h1:wiUiQW5IPGxX8jAZMnqs/nhMF0DFHQAqEYsb8nU3KEE= github.com/greenpau/versioned v1.0.27 h1:aFJ16tzsUkbc6WT7DRia60S0VrgWzBNuul3h0RXFKxM= github.com/greenpau/versioned v1.0.27/go.mod h1:rtFCvaWWNbMH4CJnje/xicgmrM63j++rUh5juSu0k/A= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=