Skip to content

Signature Version 4a support for Multi-Region #1141

@nicholasjhenry

Description

@nicholasjhenry

Problem

AWS Services such as S3 Multi-Region Access Points require Signature Version 4a which supports multi-regions.

The ex_aws only supports Signature Version 4.

Proposal

I recently required this for a project and overwrote the current Signature Version 4 implementation with Version 4a in a fork, using the signature algorithm from the aws_signature package.

main...nicholasjhenry:ex_aws:sigv4a

My understanding is that not all AWS Services support Version 4a, therefore we'll need to support both signatures. I am happy to perform the work to make this happen, but would like to get an agreement on the approach to do this before getting started.

Approach

  1. Create a behaviour for ExAws.Auth.Signatures with a call back generate_signature/4; and other callbacks for "string to sign" etc
  2. Extract ExAws.Auth.Signature.Version4
  3. ExAws.Auth.Signatures.generate_signature_v4/4 delegates to ExAws.Auth.Signature.Version4
  4. Allow a service to override the signature, for example:
config :ex_aws, :s3, signature: ExAws.Auth.Signature.Version4a

# or

config :ex_aws, :s3, signature: :version_4a
  1. When a service is called, if a signature key exists for that service, use the signature specified, otherwise, use the default ExAws.Auth.Signature.Version4.

Note, the change in signature touches:

  • headers/auth header
  • string to sign
  • amz query params
  • credential scope

Next Steps

I'm open to suggestions on the approach here. If I can get some guidance on the approach I should take, I can get started on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions