mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
check jwt timestamp for zero value
Co-authored-by: Jordan Liggitt <jordan@liggitt.net>
This commit is contained in:
parent
df8fa2eab5
commit
031075d149
@ -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.
|
// Check special 'warnafter' field for projected service account token transition.
|
||||||
warnafter := private.Kubernetes.WarnAfter
|
warnafter := private.Kubernetes.WarnAfter
|
||||||
if warnafter != nil {
|
if warnafter != nil && *warnafter != 0 {
|
||||||
if nowTime.After(warnafter.Time()) {
|
if nowTime.After(warnafter.Time()) {
|
||||||
secondsAfterWarn := nowTime.Unix() - warnafter.Time().Unix()
|
secondsAfterWarn := nowTime.Unix() - warnafter.Time().Unix()
|
||||||
auditInfo := fmt.Sprintf("subject: %s, seconds after warning threshold: %d", public.Subject, secondsAfterWarn)
|
auditInfo := fmt.Sprintf("subject: %s, seconds after warning threshold: %d", public.Subject, secondsAfterWarn)
|
||||||
|
Loading…
Reference in New Issue
Block a user