mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-05-11 04:56:35 +00:00
TUN-6772: Add a JWT Validator as an ingress verifier
This adds a new verifier interface that can be attached to ingress.Rule. This would act as a middleware layer that gets executed at the start of proxy.ProxyHTTP. A jwt validator implementation for this verifier is also provided. The validator downloads the public key from the access teams endpoint and uses it to verify the JWT sent to cloudflared with the audtag (clientID) information provided in the config.
This commit is contained in:
parent
462d2f87df
commit
5d6b0642db
6
ingress/middleware/jwtvalidator_test.go
Normal file
6
ingress/middleware/jwtvalidator_test.go
Normal file
@ -0,0 +1,6 @@
|
||||
package middleware
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestJWTValidatorHandle(t *testing.T) {
|
||||
}
|
10
ingress/middleware/verifier.go
Normal file
10
ingress/middleware/verifier.go
Normal file
@ -0,0 +1,10 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type Handler interface {
|
||||
Handle(ctx context.Context, r *http.Request) error
|
||||
}
|
Loading…
Reference in New Issue
Block a user