awscr-signer

Sign HTTP::Request objects and generate presigned post forms aws aws-signature aws-v4 signing aws-v2
0.3.5 released

awscr-signer

CircleCI

Crystal interface for AWS Signing.

Supports signing Crystal HTTP::Request objects and generating presigned post form for browser or programmatic uploading. See Browser-Based Uploads Using POST and Authenticating Requests (AWS Signature Version 4) for additional details.

Installation

Add this to your application's shard.yml:

dependencies:
  awscr-signer:
    github: taylorfinnell/awscr-signer

Usage

Creating a Credentials object.

  Awscr::Signer::Credentials.new("SECRET_KEY", "SECRET")

Creating a Scope object.

  # where s3 is any amazon service
  # where us-east-1 is any region
  Awscr::Signer::Scope.new("us-east-1", "s3")

Signing an HTTP::Request.

signer = Awscr::Signer::V4.new(scope, credentials)
signer.sign_request(request)

NOTE: It may be required for you to set the Host header to the AWS service before signing.

Examples

S3

For S3 specific support see awscr-s3

Known Limitations

The following items are known issues.

  • The request URI can not contain repeating slashes.
  • The request headers can not have new line separted values.
  • The request path can not contain spaces.
awscr-signer:
  github: taylorfinnell/awscr-signer
  version: ~> 0.3.5
License MIT
Crystal 0.23.0

Authors

Dependencies 0

Development Dependencies 1

Last synced .
search fire star recently