Current section
42 Versions
Jump to
Current section
42 Versions
Compare versions
3
files changed
+16
additions
-10
deletions
| @@ -9,8 +9,13 @@ | |
| 9 9 | <<"lib/facebook/graph.ex">>,<<"mix.exs">>,<<"README.md">>,<<"LICENSE">>]}. |
| 10 10 | {<<"licenses">>,[<<"MIT">>]}. |
| 11 11 | {<<"links">>,#{<<"GitHub">> => <<"https://github.com/mweibel/facebook.ex">>}}. |
| 12 | + {<<"name">>,<<"facebook">>}. |
| 12 13 | {<<"requirements">>, |
| 13 | - #{<<"hackney">> => #{<<"optional">> => nil,<<"requirement">> => <<"~> 0.14.1">>}, |
| 14 | - <<"json">> => #{<<"optional">> => nil,<<"requirement">> => <<">= 0.3.0">>}, |
| 15 | - <<"libex_config">> => #{<<"optional">> => nil,<<"requirement">> => <<">= 0.1.0">>}}}. |
| 16 | - {<<"version">>,<<"0.2.1">>}. |
| 14 | + #{<<"hackney">> => #{<<"app">> => <<"hackney">>, |
| 15 | + <<"optional">> => nil, |
| 16 | + <<"requirement">> => <<"~> 0.14.1">>}, |
| 17 | + <<"json">> => #{<<"app">> => <<"json">>,<<"optional">> => nil,<<"requirement">> => <<">= 0.3.0">>}, |
| 18 | + <<"libex_config">> => #{<<"app">> => <<"libex_config">>, |
| 19 | + <<"optional">> => nil, |
| 20 | + <<"requirement">> => <<">= 0.1.0">>}}}. |
| 21 | + {<<"version">>,<<"0.2.2">>}. |
| @@ -60,7 +60,7 @@ defmodule Facebook do | |
| 60 60 | @spec me(fields, access_token, options) :: response |
| 61 61 | def me(fields, access_token, options) do |
| 62 62 | if !is_nil(Config.appsecret) do |
| 63 | - fields = fields ++ [appsecret_token: encrypt(access_token)] |
| 63 | + fields = fields ++ [appsecret_proof: encrypt(access_token)] |
| 64 64 | end |
| 65 65 | |
| 66 66 | Facebook.Graph.get("/me", fields ++ [access_token: access_token], options) |
| @@ -85,7 +85,7 @@ defmodule Facebook do | |
| 85 85 | def myLikes(access_token, options) do |
| 86 86 | fields = [access_token: access_token] |
| 87 87 | if !is_nil(Config.appsecret) do |
| 88 | - fields = fields ++ [appsecret_token: encrypt(access_token)] |
| 88 | + fields = fields ++ [appsecret_proof: encrypt(access_token)] |
| 89 89 | end |
| 90 90 | Facebook.Graph.get("/me/likes", fields, options) |
| 91 91 | end |
| @@ -109,12 +109,12 @@ defmodule Facebook do | |
| 109 109 | def permissions(user_id, access_token, options) do |
| 110 110 | fields = [access_token: access_token] |
| 111 111 | if !is_nil(Config.appsecret) do |
| 112 | - fields = fields ++ [appsecret_token: encrypt(access_token)] |
| 112 | + fields = fields ++ [appsecret_proof: encrypt(access_token)] |
| 113 113 | end |
| 114 114 | Facebook.Graph.get(~s(/#{user_id}/permissions), fields, options) |
| 115 115 | end |
| 116 116 | |
| 117 117 | defp encrypt(token) do |
| 118 | - :crypto.hmac(:sha256, Config.appsecret, token) |
| 118 | + :hmac.hexlify(:crypto.hmac(:sha256, Config.appsecret, token), [:string, :lower]) |
| 119 119 | end |
| 120 120 | end |
| @@ -6,7 +6,7 @@ defmodule Facebook.Mixfile do | |
| 6 6 | def project do |
| 7 7 | [ |
| 8 8 | app: :facebook, |
| 9 | - version: "0.2.1", |
| 9 | + version: "0.2.2", |
| 10 10 | elixir: "~> 1.0.0", |
| 11 11 | description: description, |
| 12 12 | package: package, |
| @@ -56,7 +56,8 @@ defmodule Facebook.Mixfile do | |
| 56 56 | [ |
| 57 57 | {:json, ">= 0.3.0"}, |
| 58 58 | {:hackney, "~> 0.14.1"}, |
| 59 | - {:libex_config, ">= 0.1.0"} |
| 59 | + {:libex_config, ">= 0.1.0"}, |
| 60 | + {:erlsha2, github: "vinoski/erlsha2", tag: "2.1"} |
| 60 61 | ] |
| 61 62 | end |
| 62 63 | end |