check jwt timestamp for zero value

Co-authored-by: Jordan Liggitt <jordan@liggitt.net>
This commit is contained in:
Max Goltzsche 2023-03-02 02:47:23 +01:00 committed by Max Goltzsche
parent df8fa2eab5
commit 031075d149
No known key found for this signature in database
GPG Key ID: 364FA5A62B410BA4

View File

@ -198,7 +198,7 @@ func (v *validator) Validate(ctx context.Context, _ string, public *jwt.Claims,
// Check special 'warnafter' field for projected service account token transition.
warnafter := private.Kubernetes.WarnAfter
if warnafter != nil {
if warnafter != nil && *warnafter != 0 {
if nowTime.After(warnafter.Time()) {
secondsAfterWarn := nowTime.Unix() - warnafter.Time().Unix()
auditInfo := fmt.Sprintf("subject: %s, seconds after warning threshold: %d", public.Subject, secondsAfterWarn)