bootstrap token auth: don't accept deleted tokens

This commit is contained in:
Eric Chiang
2017-07-17 15:21:56 -07:00
parent d20414e2b6
commit f719b2670c
2 changed files with 26 additions and 0 deletions

View File

@@ -102,6 +102,11 @@ func (t *TokenAuthenticator) AuthenticateToken(token string) (user.Info, bool, e
return nil, false, err
}
if secret.DeletionTimestamp != nil {
tokenErrorf(secret, "is deleted and awaiting removal")
return nil, false, nil
}
if string(secret.Type) != string(bootstrapapi.SecretTypeBootstrapToken) || secret.Data == nil {
tokenErrorf(secret, "has invalid type, expected %s.", bootstrapapi.SecretTypeBootstrapToken)
return nil, false, nil