Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 

README.md

SignedRequest

SignedRequest is an Elixir module created to sign request query strings using HMAC.

Installation

def deps do
  [{:signed_request, "~> 0.1.0"}]
end

Configuration

config :signed_request, :secret_key, "foo"

Encoding query

iex> SignedRequest.SignedURI.encode_query(%{size: 512})
"sig=7dc5fc28fa59ff89dff64bed05920978471f10ced63aca98452b54574a3aef0e&size=512"

Decoding query string

iex> SignedRequest.SignedURI.decode_query("sig=7dc5fc28fa59ff89dff64bed05920978471f10ced63aca98452b54574a3aef0e&size=512")
{:ok, %{
  "sig" => "7dc5fc28fa59ff89dff64bed05920978471f10ced63aca98452b54574a3aef0e",
  "size" => "512"}
}

iex> SignedRequest.SignedURI.decode_query("sig=invalid&size=512")
{:error, :invalid_hmac}

About

signed request encoder/decoder for elixir

Topics

Resources

License

Releases

No releases published

Languages

You can’t perform that action at this time.