AkamaiOPEN-edgegrid-python icon indicating copy to clipboard operation
AkamaiOPEN-edgegrid-python copied to clipboard

Inaitana params path signature

Open robertolopezlopez opened this issue 2 years ago • 1 comments

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_to_sign 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.

robertolopezlopez avatar Aug 31 '22 06:08 robertolopezlopez

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 avatar Aug 31 '22 09:08 inaitana

@inaitana : we will check what's the best approach here, no worries :-)

robertolopezlopez avatar Aug 31 '22 11:08 robertolopezlopez