Closed robertolopezlopez closed 2 years ago
Thank you, now I see what you meant. Anyway I actually thought jrobins04's solution from #52 (using urlsplit instead of urlparse and leave the rest unchanged) was a better idea, that's why I thought my PR could be discarded altogether.
@inaitana : we will check what's the best approach here, no worries :-)
https://github.com/akamai/AkamaiOPEN-edgegrid-python/pull/52 , rebased. C&P:
This pull request fixes #51.
Python's implementation of urlparse takes the semicolon ";" as a separator for the params section, so any string following ";" is not considered part of the path. For this reason, urls for multi-configId SIEM fetch events requests, which by specifications should be listed in the path separated by semicolons, are not correctly signed by this library.
I.e:
urlparse("https://***.akamaiapis.net/siem/v1/configs/111;222;333?from=1611249319&limit=200000")
would produce:
{ ..., path: "/siem/v1/configs/111", params: "222;333", query: "from=1611249319&limit=200000" }
Including only the path and query sections in the data_tosign only signs "siem/v1/configs/111?from=1611249319&limit=200000"_ and does not produce the correct signature. Including the params section produces a correct signature which is accepted by the SIEM api.