Coder Social home page Coder Social logo

aws-sig4's Introduction

aws-sig4

AWS signature v4 request signing implemented as an clj-http middleware. This is a pure clojure implementation and does not require the AWS SDK. It only provides the middleware and doesn't do anything else like autodetecting AWS credentials. Providing correct credentials, region and service name is the responsibility of caller.

This library has seen only limited production use so far. Bugs and problems may exist. Please file issues if you encounter any problems.

Circle CI

Installation

With Leiningen/Boot:

[org.sharetribe/aws-sig4 "0.1.4"]

Usage

Require clj-http client and the middleware.

(require '[aws-sig4.middleware :as aws-sig4]
         '[clj-http.client :as http])

Build an auth middleware instance by passing in AWS parameters.

(def wrap-aws-auth (aws-sig4/build-wrap-aws-auth {:region "us-east-1"
                                                  :service "es"
                                                  :access-key "AWS_ACCESS_KEY"
                                                  :secret-key "AWS_SECRET_KEY"
                                                  :token "AWS_SESSION_TOKEN" ; optional
                                                  }))

Wrap outgoing requests with the middleware instance. Optionally include wrap-aws-date to ensure that all requests have either the required Date header, or if not generate X-Amz-Date header. wrap-aws-date must be defined first in the middleware chain.

(http/with-additional-middleware
  [wrap-aws-auth aws-sig4/wrap-aws-date]
  (http/get "https://my-es-instance.us-east-1.es.amazonaws.com/_cat/indices"))

That's it.

Hint: Consider using temporary security credentials when accessing AWS services.

License

Copyright © 2015 Sharetribe Ltd.

Distributed under The Apache License, Version 2.0

aws-sig4's People

Contributors

gfrivolt avatar ovan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.