akamai / httpie-edgegrid

Plugin for httpie to allow edge grid authentication for Akamai
Apache License 2.0
67 stars 22 forks source link

DXE-3958 Error when POSTing raw json #61

Open dvhh opened 1 month ago

dvhh commented 1 month ago

Describe the bug piping json to post on API endpoint on akamai cause the following error

http: error: AttributeError: '_io.BufferedReader' object has no attribute 'len'

To Reproduce Steps to reproduce the behavior:

  1. run podman run --pull=always --rm -it -v ~/.edgerc:/root/.edgerc -v $PWD:/workdir:rw docker.io/akamai/shell
  2. run http -v --auth-type=edgegrid -a default: POST :/identity-management/v3/user-admin/ui-identities < pay load.json
  3. See error http: error: AttributeError: '_io.BufferedReader' object has no attribute 'len'

Expected behavior POST data on the API endpoint and see an answer

Screenshots Not Applicable

Please complete the following information:

Additional context Playload content does not seem relevant for the issue, suspect the issue is caused by edgegrid authentication trying to read the payload for calculating the request signature.

ckulinsk commented 1 month ago

Hi @dvhh

Thank you for reporting this issue. We were able to reproduce it and will inform you about the progress of fix.

Best regards, Cyryl

dvhh commented 1 month ago

Hello @ckulinsk,

In the meantime would you kindly recommend any workaround for posting payload to api endpoint. Currently we wrote a python script in order to do it, but we would appreciate to use any Akamai recommended solution.

wzagrajcz commented 3 weeks ago

Hello @dvhh It seems that the issue is mainly about using the < operator. So something like cat payload.json | http -v --auth-type=edgegrid -a default: POST :/identity-management/v3/user-admin/ui-identities should work. Please let us know if that is sufficient workaround for you until we fix the <.

Best regards, Wojciech

dvhh commented 3 weeks ago

Hello @wzagrajcz,

This should work for us in the meantime, thanks