Skip to content

Commit

Permalink
fix(deps): Versions (#108)
Browse files Browse the repository at this point in the history
* fix: bump versions in workflow, update deps
#patch

* fix: update Keyfunc to v3
#patch
  • Loading branch information
Lucostus authored Mar 15, 2024
1 parent 75bd423 commit 2c7f1fb
Show file tree
Hide file tree
Showing 5 changed files with 148 additions and 240 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
cache: true
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
# Optional: golangci-lint command line arguments.
args: --issues-exit-code=1 --timeout=5m --disable typecheck
Expand All @@ -41,7 +41,6 @@ jobs:
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
exit-code: '0' # Hotfix, exit code is not working

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
Expand All @@ -58,7 +57,6 @@ jobs:
scanners: 'vuln,secret,config'
ignore-unfixed: true
severity: 'CRITICAL,HIGH'
exit-code: '1'

test:
runs-on: ubuntu-latest
Expand All @@ -68,7 +66,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21.5'
go-version: '1.22.1'
cache: true

- name: Install dependencies
Expand All @@ -82,15 +80,15 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ./.cache # Note that this path is not influenced by working-directory set in defaults, for example
key: multena-proxy-${{ github.run_id }}

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21.5'
go-version: '1.22.1'
cache: true
- name: Install dependencies
run: go get .
Expand All @@ -116,7 +114,7 @@ jobs:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: '0'

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ./.cache # Note that this path is not influenced by working-directory set in defaults, for example
key: multena-proxy-${{ github.run_id }}
Expand Down Expand Up @@ -180,7 +178,6 @@ jobs:
format: 'sarif'
severity: 'CRITICAL,HIGH'
output: 'trivy-results.sarif'
exit-code: '1'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
Expand Down
33 changes: 9 additions & 24 deletions config.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
package main

import (
"context"
"crypto/tls"
"crypto/x509"
"net/http"
"os"
"path/filepath"
"strings"
"time"

"github.com/MicahParks/keyfunc/v2"
"github.com/MicahParks/keyfunc/v3"
"github.com/fsnotify/fsnotify"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/spf13/viper"
"net/http"
"os"
"path/filepath"
"strings"
)

type Config struct {
Expand Down Expand Up @@ -184,26 +183,12 @@ func (a *App) WithTLSConfig() *App {

func (a *App) WithJWKS() *App {
log.Info().Msg("Init JWKS config")
jwksURL := a.Cfg.Web.JwksCertURL
log.Info().Str("url", jwksURL).Msg("JWKS URL")

options := keyfunc.Options{
RefreshErrorHandler: func(err error) {
if err != nil {
log.Error().Err(err).Msg("Error refreshing Keyfunc")
}
},
RefreshInterval: time.Hour,
RefreshRateLimit: time.Minute * 5,
RefreshTimeout: time.Second * 10,
RefreshUnknownKID: true,
}

jwks, err := keyfunc.Get(jwksURL, options)
jwks, err := keyfunc.NewDefaultCtx(context.Background(), []string{a.Cfg.Web.JwksCertURL}) // Context is used to end the refresh goroutine.
if err != nil {
log.Fatal().Err(err).Msg("Error init jwks")
log.Fatal().Err(err).Msg("Failed to create a keyfunc from the server's URL")
}
log.Info().Msg("Finished Keycloak config")
log.Info().Str("url", a.Cfg.Web.JwksCertURL).Msg("JWKS URL")
a.Jwks = jwks
return a
}
65 changes: 33 additions & 32 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
module github.com/gepaplexx/multena-proxy

go 1.21.5
go 1.22.1

require (
github.com/MicahParks/keyfunc/v2 v2.1.0
github.com/MicahParks/keyfunc/v3 v3.2.9
github.com/fsnotify/fsnotify v1.7.0
github.com/go-sql-driver/mysql v1.7.1
github.com/golang-jwt/jwt/v5 v5.2.0
github.com/gorilla/mux v1.8.1
github.com/observatorium/api v0.1.3-0.20240102035946-c74411f5240a
github.com/prometheus-community/prom-label-proxy v0.8.0
github.com/prometheus/client_golang v1.18.0
github.com/prometheus/prometheus v0.48.2
github.com/rs/zerolog v1.31.0
github.com/observatorium/api v0.1.3-0.20240311102334-63c873db5762
github.com/prometheus-community/prom-label-proxy v0.8.1
github.com/prometheus/client_golang v1.19.0
github.com/prometheus/prometheus v0.50.1
github.com/rs/zerolog v1.32.0
github.com/slok/go-http-metrics v0.11.0
github.com/spf13/viper v1.18.2
github.com/stretchr/testify v1.8.4
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
github.com/stretchr/testify v1.9.0
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a
)

require (
github.com/MicahParks/jwkset v0.5.15 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
Expand All @@ -28,28 +29,26 @@ require (
github.com/efficientgo/core v1.0.0-rc.2 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/analysis v0.21.4 // indirect
github.com/go-openapi/errors v0.21.0 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/loads v0.21.2 // indirect
github.com/go-openapi/runtime v0.26.2 // indirect
github.com/go-openapi/spec v0.20.11 // indirect
github.com/go-openapi/strfmt v0.22.0 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-openapi/validate v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/go-openapi/analysis v0.23.0 // indirect
github.com/go-openapi/errors v0.22.0 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/loads v0.22.0 // indirect
github.com/go-openapi/runtime v0.28.0 // indirect
github.com/go-openapi/spec v0.21.0 // indirect
github.com/go-openapi/strfmt v0.23.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-openapi/validate v0.24.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/metalmatze/signal v0.0.0-20210307161603-1c9aa721a97a // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/oklog/ulid v1.3.1 // indirect
Expand All @@ -58,8 +57,8 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/alertmanager v0.26.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/common v0.49.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
Expand All @@ -68,17 +67,19 @@ require (
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.mongodb.org/mongo-driver v1.13.1 // indirect
go.opentelemetry.io/otel v1.21.0 // indirect
go.opentelemetry.io/otel/metric v1.21.0 // indirect
go.opentelemetry.io/otel/trace v1.21.0 // indirect
go.mongodb.org/mongo-driver v1.14.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/prometheus/prometheus => github.com/prometheus/prometheus v0.48.1
replace github.com/prometheus/prometheus => github.com/prometheus/prometheus v0.50.1
Loading

0 comments on commit 2c7f1fb

Please sign in to comment.