Skip to content

Commit

Permalink
remove deprecated api use
Browse files Browse the repository at this point in the history
Signed-off-by: Kenny Leung <[email protected]>
  • Loading branch information
k4leung4 committed Sep 13, 2024
1 parent 14ec6b8 commit 2e11ff4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/apk/auth/chainguard.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ func (a *cgAuth) AddAuth(ctx context.Context, req *http.Request) error {
a.cgerr = fmt.Errorf("getting token: %w", err)
return
}
ctok, err := sts.Exchange(ctx, a.iss, a.aud, tok.AccessToken, sts.WithIdentity(a.id))

ctok, err := sts.ExchangePair(ctx, a.iss, a.aud, tok.AccessToken, sts.WithIdentity(a.id))
if err != nil {
a.cgerr = fmt.Errorf("exchanging token: %w", err)
}
a.cgtok = ctok
a.cgtok = ctok.AccessToken
})
if a.cgerr != nil {
return a.cgerr
Expand Down Expand Up @@ -113,11 +114,11 @@ func (k *k8sAuth) AddAuth(ctx context.Context, req *http.Request) error {
return
}
log.Infof("Exchanging K8s token for Chainguard identity %s", k.id)
ctok, err := sts.Exchange(ctx, k.iss, k.aud, string(b), sts.WithIdentity(k.id))
ctok, err := sts.ExchangePair(ctx, k.iss, k.aud, string(b), sts.WithIdentity(k.id))
if err != nil {
k.cgerr = fmt.Errorf("exchanging token: %w", err)
}
k.cgtok = ctok
k.cgtok = ctok.AccessToken
})
if k.cgerr != nil {
return k.cgerr
Expand Down

0 comments on commit 2e11ff4

Please sign in to comment.