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 authored and alexellis committed Jun 17, 2024
1 parent 841d15b commit a7b8b44
Show file tree
Hide file tree
Showing 9 changed files with 362 additions and 494 deletions.
9 changes: 9 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ type WatchdogConfig struct {
// using the OpenFaaS gateway as the issuer.
JWTAuthentication bool

// JWTAuthDebug enables debug logging for the JWT authentication middleware.
JWTAuthDebug bool

// JWTAuthLocal indicates wether the JWT authentication middleware should use a port-forwarded or
// local gateway running at `http://127.0.0.1:8000` instead of attempting to reach it via an in-cluster service
JWTAuthLocal bool

// LogCallId includes a prefix of the X-Call-Id in any log statements in
// HTTP mode.
LogCallId bool
Expand Down Expand Up @@ -178,6 +185,8 @@ func New(env []string) (WatchdogConfig, error) {
}

c.JWTAuthentication = getBool(envMap, "jwt_auth")
c.JWTAuthDebug = getBool(envMap, "jwt_auth_debug")
c.JWTAuthLocal = getBool(envMap, "jwt_auth_local")

return c, nil
}
Expand Down
300 changes: 0 additions & 300 deletions executor/jwt_authenticator.go

This file was deleted.

Loading

0 comments on commit a7b8b44

Please sign in to comment.