Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/edgurgel/signaturex
Simple key/secret based authentication for APIs
https://github.com/edgurgel/signaturex
Last synced: 11 days ago
JSON representation
Simple key/secret based authentication for APIs
- Host: GitHub
- URL: https://github.com/edgurgel/signaturex
- Owner: edgurgel
- License: mit
- Created: 2014-04-26T09:28:51.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-06-28T04:25:07.000Z (4 months ago)
- Last Synced: 2024-10-02T16:21:45.052Z (about 1 month ago)
- Language: Elixir
- Homepage: https://hex.pm/packages/signaturex
- Size: 38.1 KB
- Stars: 26
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Simple key/secret based authentication for APIs. (REST and API)
- fucking-awesome-elixir - signaturex - Simple key/secret based authentication for APIs. (REST and API)
- awesome-elixir - signaturex - Simple key/secret based authentication for APIs. (REST and API)
README
# Signaturex [![Build Status](https://travis-ci.org/edgurgel/signaturex.svg?branch=master)](https://travis-ci.org/edgurgel/signaturex)
Simple key/secret based authentication for APIs ([documentation](http://hexdocs.pm/signaturex/)).
Totally based on https://github.com/mloughran/signature
## Usage
You will need Elixir ~> 1.5 and Erlang ~> 20.0
Client side:
```elixir
params = %{ q: "asdaf" }
signed_params = Signaturex.sign("key", "secret", :put, "/some/path", params)
params = Map.merge(signed_params, params)
query_string = URI.encode_query(params)
HTTPsomething.put("/some/path?" <> query_string)
```Server side:
```elixir
Signaturex.validate("key", "secret", :put, "/some/path", params) # Will return true or false
```