Skip to content

Commit 5d6b064

Browse files
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.
1 parent 462d2f8 commit 5d6b064

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package middleware
2+
3+
import "testing"
4+
5+
func TestJWTValidatorHandle(t *testing.T) {
6+
}

ingress/middleware/verifier.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package middleware
2+
3+
import (
4+
"context"
5+
"net/http"
6+
)
7+
8+
type Handler interface {
9+
Handle(ctx context.Context, r *http.Request) error
10+
}

0 commit comments

Comments
 (0)