It is straightforward to package httpie into a Python "PYZ" (zipapp), e.g. using
$ pip install --upgrade zapp
$ zapp httpie.pyz httpie.__main__:main httpie
$ python ./httpie.pyz --version
1.0.3
Now I tried to include httpie-aws-authv4 as a plug-in to httpie, for AWS authentication. Alas, httpie
does not pick up that plug-in.
$ zapp httpie-aws4.pyz httpie.__main__:main httpie httpie-aws-authv4
$ python ./httpie-aws4.pyz
usage: http [--json] [--form] [--pretty {all,colors,format,none}]
...
[--auth USER[:PASS]] [--auth-type {basic,digest}]
$ python ./httpie-aws4.pyz -A aws4 http://localhost:9200/
...
http: error: argument --auth-type/-A: invalid choice: u'aws4' (choose from 'basic', 'digest')
It should say [--auth-type {basic,digest,aws4}]
Anyone knows how to make that work?
For the record, I worked around the plug-in loading issue by registering the extension with the built-in list of authentication mechanisms. This makes the plug-in available and operational, albeit through a different mechanism. For the zipapp use this is perfectly fine:
The
aws4
authentication mechanims then appears, as desired: