mirror of
https://github.com/int128/kubelogin.git
synced 2026-02-14 16:39:51 +00:00
21 lines
410 B
Go
21 lines
410 B
Go
package jwt
|
|
|
|
import "time"
|
|
|
|
// Claims represents claims of an ID token.
|
|
type Claims struct {
|
|
Subject string
|
|
Expiry time.Time
|
|
Pretty string // string representation for debug and logging
|
|
}
|
|
|
|
// Clock provides the current time.
|
|
type Clock interface {
|
|
Now() time.Time
|
|
}
|
|
|
|
// IsExpired returns true if the token is expired.
|
|
func (c *Claims) IsExpired(clock Clock) bool {
|
|
return c.Expiry.Before(clock.Now())
|
|
}
|