Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 2dbaff3

Browse files
committed
Move token review timeout to variable
Signed-off-by: JoshVanL <[email protected]>
1 parent 3e0fe2b commit 2dbaff3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/proxy/tokenreview/tokenreview.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ import (
1717
"github.com/jetstack/kube-oidc-proxy/pkg/util"
1818
)
1919

20+
var (
21+
timeout = time.Second * 10
22+
)
23+
2024
type TokenReview struct {
2125
reviewRequester clientauthv1.TokenReviewInterface
2226
audiences []string
@@ -42,7 +46,7 @@ func (t *TokenReview) Review(req *http.Request) (bool, error) {
4246

4347
review := t.buildReview(token)
4448

45-
ctx, cancel := context.WithTimeout(req.Context(), time.Second*10)
49+
ctx, cancel := context.WithTimeout(req.Context(), timeout)
4650
defer cancel()
4751

4852
resp, err := t.reviewRequester.Create(ctx, review, metav1.CreateOptions{})

0 commit comments

Comments
 (0)