././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1649984817.7898495 httpie-aws-authv4-0.3.0/0000775000175000017500000000000000000000000015165 5ustar00aidanaidan00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1649982549.0 httpie-aws-authv4-0.3.0/LICENSE.md0000664000175000017500000000206400000000000016573 0ustar00aidanaidan00000000000000The MIT License (MIT) Copyright (c) 2022 Aidan Rowe Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1648636500.0 httpie-aws-authv4-0.3.0/MANIFEST.in0000664000175000017500000000022100000000000016716 0ustar00aidanaidan00000000000000# See: https://docs.python.org/3/distutils/commandref.html include README.md include LICENSE.md global-exclude *.py[cod] __pycache__ .DS_Store ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1649984817.7898495 httpie-aws-authv4-0.3.0/PKG-INFO0000664000175000017500000001206400000000000016265 0ustar00aidanaidan00000000000000Metadata-Version: 2.1 Name: httpie-aws-authv4 Version: 0.3.0 Summary: AWS auth v4 plugin for HTTPie. Home-page: https://github.com/aidan-/httpie-aws-authv4 Download-URL: https://github.com/aidan-/httpie-aws-authv4 Author: Aidan Rowe Author-email: aidanrowe@gmail.com License: MIT Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Environment :: Plugins Classifier: License :: OSI Approved :: BSD License Classifier: Topic :: Internet :: WWW/HTTP Classifier: Topic :: Utilities Description-Content-Type: text/markdown License-File: LICENSE.md # httpie-aws-authv4 AWS / Amazon Signature v4 Signing Process authentication plugin for [HTTPie](https://httpie.org/). ## 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](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#config-settings-and-precedence) 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](https://github.com/DavidMuller/aws-requests-auth) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1649983401.0 httpie-aws-authv4-0.3.0/README.md0000664000175000017500000001031400000000000016443 0ustar00aidanaidan00000000000000# httpie-aws-authv4 AWS / Amazon Signature v4 Signing Process authentication plugin for [HTTPie](https://httpie.org/). ## 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](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#config-settings-and-precedence) 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](https://github.com/DavidMuller/aws-requests-auth) ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1649984817.7898495 httpie-aws-authv4-0.3.0/httpie_aws_authv4.egg-info/0000775000175000017500000000000000000000000022321 5ustar00aidanaidan00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1649984817.0 httpie-aws-authv4-0.3.0/httpie_aws_authv4.egg-info/PKG-INFO0000664000175000017500000001206400000000000023421 0ustar00aidanaidan00000000000000Metadata-Version: 2.1 Name: httpie-aws-authv4 Version: 0.3.0 Summary: AWS auth v4 plugin for HTTPie. Home-page: https://github.com/aidan-/httpie-aws-authv4 Download-URL: https://github.com/aidan-/httpie-aws-authv4 Author: Aidan Rowe Author-email: aidanrowe@gmail.com License: MIT Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Environment :: Plugins Classifier: License :: OSI Approved :: BSD License Classifier: Topic :: Internet :: WWW/HTTP Classifier: Topic :: Utilities Description-Content-Type: text/markdown License-File: LICENSE.md # httpie-aws-authv4 AWS / Amazon Signature v4 Signing Process authentication plugin for [HTTPie](https://httpie.org/). ## 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](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#config-settings-and-precedence) 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](https://github.com/DavidMuller/aws-requests-auth) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1649984817.0 httpie-aws-authv4-0.3.0/httpie_aws_authv4.egg-info/SOURCES.txt0000664000175000017500000000053600000000000024211 0ustar00aidanaidan00000000000000LICENSE.md MANIFEST.in README.md httpie_aws_authv4.py setup.py httpie_aws_authv4.egg-info/PKG-INFO httpie_aws_authv4.egg-info/SOURCES.txt httpie_aws_authv4.egg-info/dependency_links.txt httpie_aws_authv4.egg-info/entry_points.txt httpie_aws_authv4.egg-info/not-zip-safe httpie_aws_authv4.egg-info/requires.txt httpie_aws_authv4.egg-info/top_level.txt././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1649984817.0 httpie-aws-authv4-0.3.0/httpie_aws_authv4.egg-info/dependency_links.txt0000664000175000017500000000000100000000000026367 0ustar00aidanaidan00000000000000 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1649984817.0 httpie-aws-authv4-0.3.0/httpie_aws_authv4.egg-info/entry_points.txt0000664000175000017500000000011700000000000025616 0ustar00aidanaidan00000000000000[httpie.plugins.auth.v1] httpie_aws_authv4 = httpie_aws_authv4:AWSv4AuthPlugin ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1648893369.0 httpie-aws-authv4-0.3.0/httpie_aws_authv4.egg-info/not-zip-safe0000664000175000017500000000000100000000000024547 0ustar00aidanaidan00000000000000 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1649984817.0 httpie-aws-authv4-0.3.0/httpie_aws_authv4.egg-info/requires.txt0000664000175000017500000000007400000000000024722 0ustar00aidanaidan00000000000000httpie>=1.0.0 aws_requests_auth>=0.4.0 boto3>=1.9.0 urllib3 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1649984817.0 httpie-aws-authv4-0.3.0/httpie_aws_authv4.egg-info/top_level.txt0000664000175000017500000000002200000000000025045 0ustar00aidanaidan00000000000000httpie_aws_authv4 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1649982576.0 httpie-aws-authv4-0.3.0/httpie_aws_authv4.py0000664000175000017500000001347500000000000021213 0ustar00aidanaidan00000000000000# -*- coding: utf-8 -*- """ AWS-v4 auth plugin for HTTPie. """ import re from aws_requests_auth.aws_auth import AWSRequestsAuth from boto3 import session from httpie.plugins import AuthPlugin from urllib3.util import parse_url __version__ = "0.3.0" __author__ = "Aidan Rowe" __licence__ = "MIT" class AWSAuth(object): def __init__( self, access_key=None, secret_key=None, domain=None, profile=None, region=None, service=None, ): self.domain = domain self.aws_region: str = region self.aws_service: str = service if access_key and secret_key: self.aws_access_key = access_key self.aws_secret_access_key = secret_key self.aws_token = None else: sess = session.Session(profile_name=profile) creds = sess.get_credentials() self.aws_access_key = creds.access_key self.aws_secret_access_key = creds.secret_key self.aws_token = creds.token def __eq__(self, other): if not isinstance(other, AWSAuth): raise NotImplementedError return all( [ self.aws_access_key == other.aws_access_key, self.aws_secret_access_key == other.aws_secret_access_key, self.aws_token == other.aws_token, self.domain == other.domain, self.aws_region == other.aws_region, self.aws_service == other.aws_service, ] ) def __call__(self, r): try: # Host used in signature *MUST* always match with Host HTTP header. host = r.headers.get("Host") if not host: _, _, host, _, _, _, _ = parse_url(r.url) r.headers["Host"] = host if self.aws_region is not None and self.aws_service is not None: aws_params = dict(region=self.aws_region, service=self.aws_service) elif self.domain is not None: aws_params = self._parse_url(self.domain) else: aws_params = self._parse_url(host) except ValueError: print("ERROR: Could not parse neccessary information from URL.") raise except Exception as error: print("Error parsing URL: %s" % error) raise aws_request = AWSRequestsAuth( aws_access_key=self.aws_access_key, aws_secret_access_key=self.aws_secret_access_key, aws_host=host, aws_region=aws_params["region"], aws_service=aws_params["service"], aws_token=self.aws_token, ) return aws_request.__call__(r) @staticmethod def _parse_url(domain): p = re.compile(r"([^\.]+)\.es\.amazonaws.com(\.cn)?$") m = p.search(domain) if m: return {"region": m.group(1), "service": "es"} p = re.compile(r"([^\.]+)\.([^\.]+)\.amazonaws.com(\.cn)?$") m = p.search(domain) if m: return {"region": m.group(2), "service": m.group(1)} raise ValueError("Could not determine AWS region or service from domain name.") class AWSv4AuthPlugin(AuthPlugin): name = "AWS auth-v4" auth_type = "aws4" description = "Sign requests using the AWS Signature Version 4 Signing Process" auth_require = False auth_parse = False prompt_password = False alias_params = { "ak": "access_key", "sk": "secret_key", "p": "profile", "d": "domain", "s": "service", "r": "region", } """map of alias -> full param name""" def get_auth(self, username=None, password=None): """ To remain consistant with AWS tools, boto3 credential store is used to retrieve the users API keys. This means environment variables take precedent over ~/.aws/credentials and IAM roles. credentials can be provided on the CLI using the -a flag eg, -a : You can also provide aditional parameters using following syntax: -a access_key=,secret_key=, profile=,domain=,service=,region= or short equvivalent: -a ak=,sk=,p=,d=, s=,r= For example: -a s=executeapi,r=eu-west-1 An attempt is made to try and determine the region, endpoint and service from a given request URL if you are not supplying this data as above. If you are using a custom domain this will fail and service plus region need to be supplied in the -a flag. """ params: dict = {} if self.raw_auth is not None: try: if "=" in self.raw_auth: params = dict(x.split("=", 2) for x in self.raw_auth.split(",")) for alias, full in self.alias_params.items(): if alias in params: params[full] = params[alias] del params[alias] else: parts = self.raw_auth.split(":") if len(parts) >= 2: if parts[0] == "profile": params["profile"] = parts[1] else: params["access_key"] = parts[0] params["secret_key"] = parts[1] if len(parts) == 3: params["domain"] = parts[2] elif len(parts) == 1: params["domain"] = parts[0] except ValueError: print("ERROR: Could not parse auth string.") raise return AWSAuth(**params) ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1649984817.7898495 httpie-aws-authv4-0.3.0/setup.cfg0000664000175000017500000000004600000000000017006 0ustar00aidanaidan00000000000000[egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1649982549.0 httpie-aws-authv4-0.3.0/setup.py0000664000175000017500000000302500000000000016677 0ustar00aidanaidan00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- import re import io from setuptools import setup with io.open("README.md", "rt", encoding="utf8") as f: readme = f.read() with io.open("httpie_aws_authv4.py", "rt", encoding="utf8") as f: version = re.search(r"__version__ = \"(.*?)\"", f.read()).group(1) setup( name="httpie-aws-authv4", description="AWS auth v4 plugin for HTTPie.", version=version, author="Aidan Rowe", author_email="aidanrowe@gmail.com", license="MIT", url="https://github.com/aidan-/httpie-aws-authv4", download_url="https://github.com/aidan-/httpie-aws-authv4", py_modules=["httpie_aws_authv4"], zip_safe=False, long_description=readme, long_description_content_type="text/markdown", entry_points={ "httpie.plugins.auth.v1": [ "httpie_aws_authv4 = httpie_aws_authv4:AWSv4AuthPlugin" ] }, install_requires=[ "httpie>=1.0.0", "aws_requests_auth>=0.4.0", "boto3>=1.9.0", "urllib3", ], classifiers=[ "Development Status :: 5 - Production/Stable", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Environment :: Plugins", "License :: OSI Approved :: BSD License", "Topic :: Internet :: WWW/HTTP", "Topic :: Utilities", ], )