Skip to content

Commit

Permalink
Added access token validation
Browse files Browse the repository at this point in the history
Signed-off-by: Brad Wadsworth <[email protected]>
  • Loading branch information
Brad Wadsworth committed Sep 15, 2022
1 parent 28f4946 commit faf795f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/clients/gke/gke.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ func WrapRESTConfig(ctx context.Context, rc *rest.Config, credentials []byte, sc
t := oauth2.Token{
AccessToken: string(credentials),
}
if ok := t.Valid(); !ok {
return errors.New("Access token invalid")
}
ts = oauth2.StaticTokenSource(&t)
}
} else {
Expand Down

0 comments on commit faf795f

Please sign in to comment.