TritonDataCenter / python-manta

Python SDK for Manta (community maintained)
MIT License
25 stars 18 forks source link

Need updated cypto module and support for ECDSA keys #50

Closed rjloura closed 5 years ago

rjloura commented 5 years ago
(pymanta) rui@hayek:~/git/python-manta$ ./bin/mantash -v ls /rui.loura/stor/
manta.client: DEBUG: ListDirectory '/rui.loura/stor'
manta.auth: DEBUG: sign 'date: Thu, 08 Nov 2018 23:15:21 GMT' with agent key (algo rsa-sha1, fp 5f:fb:db:f3:fd:43:ad:4e:ee:b6:24:75:74:a3:ae:8b)
manta.client: DEBUG: req: GET /rui.loura/stor
    host: us-east.manta.joyent.com
    headers: {'accept-encoding': 'gzip, deflate',
     'authorization': 'Signature keyId="/rui.loura/keys/5f:fb:db:f3:fd:43:ad:4e:ee:b6:24:75:74:a3:ae:8b",algorithm="rsa-sha1",signature="AAAAIQCVvdbep5IRuhlZRPPJxj9WOxbvI7iCwog09iwu8UmQcwAAACEAyjn0qbxCpTYjPhhkLM5XEVyvjUuBKPLfZkOvT3zlrIk="',
     'date': 'Thu, 08 Nov 2018 23:15:21 GMT',
     'user-agent': 'mantash/2.6.2 (linux2) Python/2.7.15rc1'}
    body: (none)
manta.client: DEBUG: res: GET /rui.loura/stor
    {'connection': 'keep-alive',
     'content-length': '99',
     'content-md5': 'o6kfsMz8ATeTfySea8Vqpg==',
     'content-type': 'application/json',
     'date': 'Thu, 08 Nov 2018 23:15:22 GMT',
     'server': 'Manta',
     'status': '403',
     'x-request-id': '2a723d10-e3ac-11e8-9e31-6357c012a6ae',
     'x-response-time': '6',
     'x-server-name': '39adec6c-bded-4a14-9d80-5a8bfc1121f9'}
    {"code":"InvalidSignature","message":"The signature we calculated does not match the one you sent"}
mantash: ERROR: (InvalidSignature) The signature we calculated does not match the one you sent
rjloura commented 5 years ago

As part of this, I will remove the dependency on pycrypto module.

trentm commented 5 years ago

@rjloura Do you have coming work for this? Adding ECDSA support would be great. Have you found a crypto lib we can use for the signing?

rjloura commented 5 years ago

Yes. paramiko works fine at the latest version. I've also changed out pycrypto for another module. Still have some tests to do. Here is my working branch if you want a sneak peak:

https://github.com/rjloura/python-manta/tree/crypto_update