Skip to main content

httpie-aws-authv4

AWS / Amazon Signature v4 Signing Process authentication plugin for HTTPie.

Installation

$ pip install --upgrade httpie-aws-authv4

You should now see aws4 under --auth-type / -A in $ http --help output.

Simple Usage

Credentials in default profile/environment variables/instance profile

This authentication plugin looks for credentials in the same precedence that the AWS CLI tool does.

$ http --auth-type aws4 https://asdf123a9sas.execute-api.ap-southeast-2.amazonaws.com/dev/test

Extra arguments

Using the --auth parameter, 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/test

Auth options

The following arguments are supported via the --auth flag. 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 CLI

You 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/test

Specify service and region

If 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/test

Specify endpoint

Instead 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/test

Specify 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/test

Specify 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/test

Calling AWS services that require extra information

Many 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.com

However, some AWS services will require extra information to be passed using query string parameters. By default, httpie passes extra parameters as a JSON body. httpie can be told to pass extra parameters as form fields using the -f flag like so:

$ http -f -A aws4 ec2.us-east-1.amazonaws.com Action=DescribeVpcs Version=2015-10-01

where the Action and Version parameters were passed to the EC2 service to call the DescribeVpcs API.

Alternatively instead of using the -f flag, == can be used for each parameter like so:

$ http -A aws4 ec2.us-east-1.amazonaws.com Action==DescribeVpcs Version==2015-10-01

Credits

All of the heavy lifting (the signing process) is handled by aws-requests-auth

Metadata

Release files for httpie-aws-authv4 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for httpie-aws-authv4 0.3.0
File Size Uploaded
httpie-aws-authv4-0.3.0.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for httpie-aws-authv4 0.3.0
File Interpreter ABI Platform
httpie_aws_authv4-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.7 kB

Release files / httpie-aws-authv4-0.3.0.tar.gz

Download URL httpie-aws-authv4-0.3.0.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
93ba313e1fb8e19f6ce31f90d8e45a027ca29d15ac73913aff9c5fc10130676d
BLAKE2b-256 checksum
How to use checksums
7c088360fb69d1c924c7452cfb04523a179006ab79f3ca29cd28aa0ee9e213ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.10

Release files / httpie_aws_authv4-0.3.0-py3-none-any.whl

Download URL httpie_aws_authv4-0.3.0-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa752aac99d084eb8f52a00b000d17f45fe186bca1797b1d2e3c5601d08fea29
BLAKE2b-256 checksum
How to use checksums
02b5433e1c79c76cc646158090338b904f7db7a053e1d6c116ace22f1043dc65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

1 release file

0.1.4

1 release file

0.1.3

2 release files

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page