Package: httpie-aws-authv4
httpie-aws-authv4AWS / Amazon Signature v4 Signing Process authentication plugin forHTTPie.Installation$ pip install --upgrade httpie-aws-authv4You should now seeaws4under--auth-type / -Ain$ http --helpoutput.Simple UsageCredentials in default profile/environment variables/instance profileThis authentication plugin looks for credentials in the sameprecedence that the AWS CLI tooldoes.$ http --auth-type aws4 https://asdf123a9sas.execute-api.ap-southeast-2.amazonaws.com/dev/testExtra argumentsUsing the--authparameter, you can specify explicit parameters to be used in the calculation of the Sigv4 signature.$ http --auth-type aws4 --auth access_key=AWSACCESSKEYXXX,secret_key=AWSSECRETKEYXXX,service=execute-api,region=ap-southeast-2 https://asdf123a9sas.execute-api.ap-southeast-2.amazonaws.com/dev/testAuth optionsThe following arguments are supported via the--authflag.  They can be referenced via their full or short name for convenience.access_key (ak) - AWS Access Key.secret_key (sk) - AWS Secret Key.profile (p) - AWS profile to use.domain (d) - Domain name to use when signing the request.service (s) - AWS service name to use when signing the request (ie,execute-api).region (r) - AWS region the endpoint is located in.Specify credentials profile on the CLIYou can specify another profile than the default profile:$ http --auth-type aws4 --auth profile=XXX https://asdf123a9sas.execute-api.ap-southeast-2.amazonaws.com/dev/testSpecify service and regionIf for some reason you are not hitting the AWS endpoint directly (common with API Gateway), you will need to specify the AWS provided service and region:$ http --auth-type aws4 --auth s=execute-api,r=eu-west-1 https://api.awesomeservice.net/dev/test
$ http --auth-type aws4 --auth service=execute-api,region=eu-west-1 https://api.awesomeservice.net/dev/testSpecify endpointInstead of specifying service and region you can specify domain which is then parsed.$ http --auth-type aws4 --auth d=asdf123a9sas.execute-api.ap-southeast-2.amazonaws.com https://api.awesomeservice.net/dev/test
$ http --auth-type aws4 --auth domain=asdf123a9sas.execute-api.ap-southeast-2.amazonaws.com https://api.awesomeservice.net/dev/testSpecify credentials and endpoint$ http --auth-type aws4 --auth ak=ACCESSKEYXXX,sk=AWSSECRETKEYXXX,d=asdf123a9sas.execute-api.ap-southeast-2.amazonaws.com https://api.awesomeservice.net/dev/test
$ http --auth-type aws4 --auth access_key=ACCESSKEYXXX,secret_key=AWSSECRETKEYXXX,domain=asdf123a9sas.execute-api.ap-southeast-2.amazonaws.com https://api.awesomeservice.net/dev/testSpecify credentials profile and endpoint$ http --auth-type aws4 --auth p=XXX,d=asdf123a9sas.execute-api.ap-southeast-2.amazonaws.com https://api.awesomeservice.net/dev/test
$ http --auth-type aws4 --auth profile=XXX,domain=asdf123a9sas.execute-api.ap-southeast-2.amazonaws.com https://api.awesomeservice.net/dev/testCalling AWS services that require extra informationMany AWS services do not require any extra information to be passed other than the URL, such as the following call to the
S3 service which will list all S3 Buckets in the given AWS account:http -A aws4 s3.us-east-1.amazonaws.comHowever, some AWS services will require extra information to be passed using query string parameters.  By default,httpiepasses
extra parameters as a JSON body.httpiecan be told to pass extra parameters as form fields using the-fflag like so:$ http -f -A aws4 ec2.us-east-1.amazonaws.com Action=DescribeVpcs Version=2015-10-01where theActionandVersionparameters were passed to the EC2 service to call theDescribeVpcsAPI.Alternatively instead of using the-fflag,==can be used for each parameter like so:$ http -A aws4 ec2.us-east-1.amazonaws.com Action==DescribeVpcs Version==2015-10-01CreditsAll of the heavy lifting (the signing process) is handled byaws-requests-auth