Skip to content

Commit

Permalink
Unexport var
Browse files Browse the repository at this point in the history
  • Loading branch information
mjcmtb committed Sep 18, 2024
1 parent 05e651a commit 8bd9ccf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tokencache/cache_token_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

const (
TokenExpirationGracePeriod = time.Duration(30 * time.Second)
tokenExpirationGracePeriod = time.Duration(30 * time.Second)
)

type cachingTokenSource struct {
Expand Down Expand Up @@ -121,6 +121,6 @@ func (c *cachingTokenSource) Token(ctx context.Context) (*oidc.Token, error) {
}

func tokenWithinGracePeriod(token *oidc.Token) bool {
gracePeriodStart := token.Claims.Expiry.Time().Add(-TokenExpirationGracePeriod)
gracePeriodStart := token.Claims.Expiry.Time().Add(-tokenExpirationGracePeriod)
return gracePeriodStart.Before(time.Now()) && token.Valid()
}

0 comments on commit 8bd9ccf

Please sign in to comment.