Skip to content

Commit

Permalink
fix: make base client assumerole more expressive when decoding body
Browse files Browse the repository at this point in the history
  • Loading branch information
ZackarySantana committed Sep 25, 2024
1 parent 21d2315 commit db7a314
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions agent/internal/client/base_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,9 @@ func (c *baseCommunicator) AssumeRole(ctx context.Context, td TaskData, request
if resp.StatusCode != http.StatusOK {
return nil, util.RespErrorf(resp, "trouble assuming role")
}
creds := apimodels.AssumeRoleResponse{}
return &creds, errors.Wrapf(utility.ReadJSON(resp.Body, &creds), "reading assume role response")
var creds apimodels.AssumeRoleResponse
if err := utility.ReadJSON(resp.Body, &creds); err != nil {
return nil, errors.Wrap(err, "reading assume role response")
}
return &creds, nil
}

0 comments on commit db7a314

Please sign in to comment.