You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2024/05/04 12:42:26 UTC
(cloudstack-cloudmonkey) branch signature-bugfix created (now bd8e60f)
This is an automated email from the ASF dual-hosted git repository.
rohit pushed a change to branch signature-bugfix
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git
at bd8e60f network: when using API key & secret key drop params
This branch includes the following new commits:
new bd8e60f network: when using API key & secret key drop params
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(cloudstack-cloudmonkey) 01/01: network: when using API key & secret key drop params
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rohit pushed a commit to branch signature-bugfix
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git
commit bd8e60f4da54df6542e134bbfd0404b9b94dc89b
Author: Rohit Yadav <ro...@shapeblue.com>
AuthorDate: Sat May 4 18:11:23 2024 +0530
network: when using API key & secret key drop params
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 <ro...@shapeblue.com>
---
cmd/network.go | 1 +
1 file changed, 1 insertion(+)
diff --git a/cmd/network.go b/cmd/network.go
index af97740..b5f4bef 100644
--- a/cmd/network.go
+++ b/cmd/network.go
@@ -221,6 +221,7 @@ func NewAPIRequest(r *Request, api string, args []string, isAsync bool) (map[str
mac.Write([]byte(strings.ToLower(encodedParams)))
signature := base64.StdEncoding.EncodeToString(mac.Sum(nil))
encodedParams = encodedParams + fmt.Sprintf("&signature=%s", url.QueryEscape(signature))
+ params = nil
} else if len(r.Config.ActiveProfile.Username) > 0 && len(r.Config.ActiveProfile.Password) > 0 {
sessionKey, err := Login(r)
if err != nil {