Skip to content

sebastiank83/clj-aws-signer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clj-aws-signer Build Status

A ring middleware to sign AWS requests.

Usage

To use clj-aws-signer, add this project as a dependency in your leiningen project file:

Clojars Project

(wrap-sign-aws-request handler service-name region)

The arguments are:

  • handler: A ring handler that will be used.
  • service-name: The AWS service name that should be used for the signing process. e.g. es for elastic search.
  • region: An optional aws region name. If not provided, it will try to detect it through either an environment variable AWS_REGION or when running on EC2 through the meta data service.

Examples

Sign a clj-http request:

(ns my.app
  (:require
    [clj-http.client :as client]
    [clj-aws-signer.core :refer [wrap-sign-aws-request]]))

(client/with-additional-middleware [#(wrap-sign-aws-request %1 "<SERVICE NAME>")]
  (client/get "http://........")
)

Sign a request made with the elastisch library:

...
(client/with-additional-middleware [#(wrap-sign-aws-request %1 "es")]
  (esd/search conn "myapp_development" "person" :query (q/term :biography "New York"))
)
...

License

Copyright © 2016 Sebastian Kichtan

Distributed under the MIT License.

Releases

No releases published

Packages

No packages published