Skip to content

Commit

Permalink
Move JWT auth middleware to faas-middleware package
Browse files Browse the repository at this point in the history
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
welteki committed May 21, 2024
1 parent 80051c3 commit 1acfaf4
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 193 deletions.
186 changes: 0 additions & 186 deletions executor/jwt_authenticator_test.go

This file was deleted.

2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module github.com/openfaas/of-watchdog

go 1.21

replace github.com/openfaas/faas-middleware => /home/welteki/code/openfaas/oss/faas-middleware

require (
github.com/docker/go-units v0.5.0
github.com/golang-jwt/jwt/v5 v5.2.1
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg=
github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/openfaas/faas-middleware v1.2.3 h1:nRib38/i5eNdUTTKA7ILgO/Xns5zVorCO6lIBjr2xA0=
github.com/openfaas/faas-middleware v1.2.3/go.mod h1:pMyWe0SP0zuzIj2on1pmRkZAjGIS+uRk2mp3N6LSlDI=
github.com/openfaas/faas-provider v0.25.3 h1:cy5GKP1R/xZkPjg+9We7yqpfz298GrKw4ZRYJVprt7Q=
github.com/openfaas/faas-provider v0.25.3/go.mod h1:NsETIfEndZn4mn/w/XnBTcDTwKqULCziphLp7KgeRcA=
github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
units "github.com/docker/go-units"

limiter "github.com/openfaas/faas-middleware/concurrency-limiter"
auth "github.com/openfaas/faas-middleware/function-auth"
"github.com/openfaas/of-watchdog/config"
"github.com/openfaas/of-watchdog/executor"
"github.com/openfaas/of-watchdog/metrics"
Expand Down Expand Up @@ -75,7 +76,7 @@ func main() {
requestHandler := baseFunctionHandler

if watchdogConfig.JWTAuthentication {
handler, err := executor.NewJWTAuthMiddleware(baseFunctionHandler)
handler, err := auth.NewJWTAuthMiddleware(baseFunctionHandler)
if err != nil {
log.Fatalf("Error creating JWTAuthMiddleware: %s", err.Error())
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ github.com/docker/go-units
# github.com/golang-jwt/jwt/v5 v5.2.1
## explicit; go 1.18
github.com/golang-jwt/jwt/v5
# github.com/openfaas/faas-middleware v1.2.3
# github.com/openfaas/faas-middleware v1.2.3 => /home/welteki/code/openfaas/oss/faas-middleware
## explicit; go 1.20
github.com/openfaas/faas-middleware/concurrency-limiter
github.com/openfaas/faas-middleware/function-auth
# github.com/openfaas/faas-provider v0.25.3
## explicit; go 1.20
github.com/openfaas/faas-provider/httputil
Expand Down Expand Up @@ -92,3 +93,4 @@ google.golang.org/protobuf/reflect/protoregistry
google.golang.org/protobuf/runtime/protoiface
google.golang.org/protobuf/runtime/protoimpl
google.golang.org/protobuf/types/known/timestamppb
# github.com/openfaas/faas-middleware => /home/welteki/code/openfaas/oss/faas-middleware

0 comments on commit 1acfaf4

Please sign in to comment.