Skip to content

Commit 1f45761

Browse files
authoredMay 20, 2024··
network: when using API key & secret key drop params (#150)
Params need to be dropped as apikey & secretkey based URL has all the params and it causes signature validation issues when the same params are also posted again. For example, add host API with username, password params. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent 9df1724 commit 1f45761

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
 

‎cmd/network.go

+1
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ func NewAPIRequest(r *Request, api string, args []string, isAsync bool) (map[str
221221
mac.Write([]byte(strings.ToLower(encodedParams)))
222222
signature := base64.StdEncoding.EncodeToString(mac.Sum(nil))
223223
encodedParams = encodedParams + fmt.Sprintf("&signature=%s", url.QueryEscape(signature))
224+
params = nil
224225
} else if len(r.Config.ActiveProfile.Username) > 0 && len(r.Config.ActiveProfile.Password) > 0 {
225226
sessionKey, err := Login(r)
226227
if err != nil {

0 commit comments

Comments
 (0)
Please sign in to comment.