Skip to content

Commit a7cac28

Browse files
committed
fix: use cluster manager for VerifyToken
Signed-off-by: Calum Murray <[email protected]>
1 parent 613ca77 commit a7cac28

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pkg/kubernetes/provider_acm_hub.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,11 @@ func (p *acmHubClusterProvider) IsOpenShift(ctx context.Context) bool {
226226
}
227227

228228
func (p *acmHubClusterProvider) VerifyToken(ctx context.Context, target, token, audience string) (*authenticationv1api.UserInfo, []string, error) {
229-
// use hub cluster for token verification regardless of target
230-
// TODO(Cali0707): update this to work off the configured auth provider for the target
231-
return p.hubManager.VerifyToken(ctx, token, audience)
229+
manager, err := p.managerForCluster(target)
230+
if err != nil {
231+
return nil, nil, fmt.Errorf("failed to get manager for cluster '%s', unable to verify token", target)
232+
}
233+
return manager.VerifyToken(ctx, token, audience)
232234
}
233235

234236
func (p *acmHubClusterProvider) GetDerivedKubernetes(ctx context.Context, target string) (*Kubernetes, error) {

0 commit comments

Comments
 (0)