Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

417
Views
Generate the AWS HTTP signature from boto3

I am working with the AWS Transcribe streaming service that boto3 does not support yet, so to make HTTP/2 requests, I need to manually setup the authorization header with the "AWS Signature Version 4"

I've found some example implementation, but I was hoping to just call whatever function boto3/botocore have implemented using the same configuration object.

Something like

    session = boto3.Session(...)
    auth = session.generate_signature('POST', '/stream-transcription', ...)

Any pointers in that direction?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Did you check this SDK? Seems very recent but might do what you need.

https://github.com/awslabs/amazon-transcribe-streaming-sdk/tree/master

It looks like it handles the signing: https://github.com/awslabs/amazon-transcribe-streaming-sdk/blob/master/amazon_transcribe/signer.py

over 4 years ago · Santiago Trujillo Report

0

Contrary to the AWS SDKs for most other programming languages, boto3/botocore don't offer the functionality to sign arbitrary requests using "AWS Signature Version 4" yet. However there is at least already an open feature request for that: https://github.com/boto/botocore/issues/1784

In this feature request, existing alternatives are discussed as well. One is the third-party Python library aws-requests-auth, which provides a thin wrapper around botocore and requests to sign HTTP-requests. That looks like the following:

import requests
from aws_requests_auth.boto_utils import BotoAWSRequestsAuth

auth = BotoAWSRequestsAuth(aws_host="your-service.domain.tld",
                           aws_region="us-east-1",
                           aws_service="execute-api")
response = requests.get("https://your-service.domain.tld",
                        auth=auth)

Another alternative presented in the feature request is to implement the necessary glue-code on your own, as shown in the following gist: https://gist.github.com/rhboyd/1e01190a6b27ca4ba817bf272d5a5f9a.

over 4 years ago · Santiago Trujillo Report

0

I have not tested this, but you can likely accomplish this by following along with with this SigV4 unit test:

https://github.com/boto/botocore/blob/master/tests/unit/test_auth_sigv4.py

Note, this constructs a request using the botocore.awsrequest.AWSRequest helper. You'll likely need to dig around to figure out how to send the actual HTTP request (perhaps with httpsession.py)

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!