mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 21:53:52 +00:00
validate token length in tokenReview
This commit is contained in:
@@ -49,6 +49,10 @@ func (r *REST) Create(ctx genericapirequest.Context, obj runtime.Object, include
|
|||||||
return nil, apierrors.NewBadRequest(fmt.Sprintf("namespace is not allowed on this type: %v", namespace))
|
return nil, apierrors.NewBadRequest(fmt.Sprintf("namespace is not allowed on this type: %v", namespace))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(tokenReview.Spec.Token) == 0 {
|
||||||
|
return nil, apierrors.NewBadRequest(fmt.Sprintf("token is required for TokenReview in authentication"))
|
||||||
|
}
|
||||||
|
|
||||||
if r.tokenAuthenticator == nil {
|
if r.tokenAuthenticator == nil {
|
||||||
return tokenReview, nil
|
return tokenReview, nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user