diff --git a/src/openid.erl b/src/openid.erl index fa0d7e5..b8dbf4b 100644 --- a/src/openid.erl +++ b/src/openid.erl @@ -11,10 +11,6 @@ -include("openid.hrl"). --define(GV(E, P), proplists:get_value(E, P)). --define(GVD(E, P, D), proplists:get_value(E, P, D)). --define(DBG(Term), io:format("~p: ~p~n", [self(), Term])). - %% ------------------------------------------------------------ @@ -25,7 +21,7 @@ discover(Identifier) -> Req = case yadis:retrieve(Identifier) of {none, Body} -> html_discovery(Body); #xrds{}=XRDS -> extract_authreq(XRDS); - {error, Error} -> + {error, _Error} -> %?DBG({error, Error}), none end, @@ -143,7 +139,7 @@ associate(OpURL) -> %?DBG({pub_priv, Public, Private, size(Public), size(Private)}), - RollPub = roll(Public), + _RollPub = roll(Public), %?DBG({rolled, RollPub, size(RollPub)}), Params = [{"openid.ns", "http://specs.openid.net/auth/2.0"}, diff --git a/src/openid.hrl b/src/openid.hrl index 97db0b3..b632e83 100644 --- a/src/openid.hrl +++ b/src/openid.hrl @@ -6,6 +6,10 @@ %%% Created : 18 Sep 2009 by Brendon Hogger %%%------------------------------------------------------------------- +-define(GV(E, P), proplists:get_value(E, P)). +-define(GVD(E, P, D), proplists:get_value(E, P, D)). +-define(DBG(Term), io:format("~p: ~p~n", [self(), Term])). + -record(xrdService, { types, uris, diff --git a/src/openid_srv.erl b/src/openid_srv.erl index c565a63..786dbd2 100644 --- a/src/openid_srv.erl +++ b/src/openid_srv.erl @@ -43,10 +43,6 @@ start_link(Name) -> %% gen_server callbacks %%==================================================================== --define(GV(E, P), proplists:get_value(E, P)). --define(GVD(E, P, D), proplists:get_value(E, P, D)). --define(DBG(Term), io:format("~p: ~p~n", [self(), Term])). - init(_Args) -> AuthReqs = ets:new(openid_authreqs, [set, private]), Assocs = ets:new(openid_assocs, [set, private]), @@ -248,9 +244,9 @@ verify_signature(ClaimedID, Assoc, Fields) -> Invalidate = ?GVD("openid.invalidate_handle", Fields, false), verify_signature(ClaimedID, Invalidate, Assoc, Fields). -verify_signature(_, _, none, Fields) -> +verify_signature(_, _, none, _Fields) -> {error, "Direct verification not implemented yet"}; -verify_signature(ClaimedID, false, #assoc{}=Assoc, Fields) -> +verify_signature(_ClaimedID, false, #assoc{}=Assoc, Fields) -> KV = lists:flatten([[Key,$:,?GV("openid." ++ Key, Fields),$\n] || Key <- string:tokens(?GV("openid.signed", Fields), ",")]), MAC = Assoc#assoc.mac, diff --git a/src/openid_utils.erl b/src/openid_utils.erl index 797e858..bc28fea 100644 --- a/src/openid_utils.erl +++ b/src/openid_utils.erl @@ -11,10 +11,6 @@ -include("openid.hrl"). --define(GV(E, P), proplists:get_value(E, P)). --define(GVD(E, P, D), proplists:get_value(E, P, D)). --define(DBG(Term), io:format("~p: ~p~n", [self(), Term])). - get_tags(Content, Tag) -> find_tags(Content, {[], Tag, none, none}). diff --git a/src/yadis.erl b/src/yadis.erl index 138d092..b7487c6 100644 --- a/src/yadis.erl +++ b/src/yadis.erl @@ -12,8 +12,6 @@ -include("openid.hrl"). -include_lib("xmerl/include/xmerl.hrl"). --define(GVD(E, P, D), proplists:get_value(E, P, D)). - -define(HTTP_HEADERS, [{"Accept", "application/xrds+xml"}, {"Connection", "close"}, {"User-Agent", "Erlang/openid"}]). @@ -48,7 +46,7 @@ retrieve(Identifier) -> false -> Normalized end, - case http:request(get, {URL, ?HTTP_HEADERS}, ?HTTP_OPTIONS, ?REQ_OPTIONS) of + case httpc:request(get, {URL, ?HTTP_HEADERS}, ?HTTP_OPTIONS, ?REQ_OPTIONS) of {ok, {_Status, Headers, Body}} -> DescriptorURL = get_descriptor_url(Headers, Body), XRDS = handle_response(DescriptorURL, Headers, Body), @@ -103,7 +101,7 @@ try_descriptor_url(URL) -> retrieve_step_two(URL). retrieve_step_two(YadisURL) -> - case http:request(get, {YadisURL, ?HTTP_HEADERS}, ?HTTP_OPTIONS, ?REQ_OPTIONS) of + case httpc:request(get, {YadisURL, ?HTTP_HEADERS}, ?HTTP_OPTIONS, ?REQ_OPTIONS) of {ok, {_Status, Headers, Body}} -> get_xrds(?GVD("content-type", Headers, none), Body); Other ->