diff options
| author | Magnus Feuer <mfeuer@jaguarlandrover.com> | 2015-10-02 11:05:35 -0700 |
|---|---|---|
| committer | Magnus Feuer <mfeuer@jaguarlandrover.com> | 2015-10-02 11:05:35 -0700 |
| commit | 0e4cf3c3f28a9f7c4fc5df568b25c951a5e8cdc5 (patch) | |
| tree | 765eae1c1d93004b247b1991575e90c050520c78 /components | |
| parent | e4de840236570e2e25d756cf8345c4f796bb9de5 (diff) | |
| download | rvi_core-0e4cf3c3f28a9f7c4fc5df568b25c951a5e8cdc5.tar.gz | |
Signature for messsages now generated with correct timeout.
Timeout validation in authorize_rpc is now compared with msec unix epoch timestamp that was stashed in signature.
Diffstat (limited to 'components')
| -rw-r--r-- | components/authorize/src/authorize_rpc.erl | 2 | ||||
| -rw-r--r-- | components/service_edge/src/service_edge_rpc.erl | 27 |
2 files changed, 16 insertions, 13 deletions
diff --git a/components/authorize/src/authorize_rpc.erl b/components/authorize/src/authorize_rpc.erl index 2df4298..b78e3b4 100644 --- a/components/authorize/src/authorize_rpc.erl +++ b/components/authorize/src/authorize_rpc.erl @@ -331,7 +331,7 @@ handle_call({rvi, authorize_remote_message, [_Service, Params]}, ?debug("authorize_rpc:authorize_remote_message(): service_name1: ~p~n", [SvcName1]), ?debug("authorize_rpc:authorize_remote_message(): parameters1: ~p~n", [Params1]), - if Timeout =:= Timeout1 * 1000, + if Timeout =:= Timeout1, SvcName =:= SvcName1, Parameters =:= Params1 -> ?debug("Remote message authorized.~n", []), diff --git a/components/service_edge/src/service_edge_rpc.erl b/components/service_edge/src/service_edge_rpc.erl index c2f0503..e48c2b7 100644 --- a/components/service_edge/src/service_edge_rpc.erl +++ b/components/service_edge/src/service_edge_rpc.erl @@ -397,18 +397,6 @@ handle_call({ rvi, handle_local_message, ?debug("service_edge_rpc:local_msg: service_name: ~p", [SvcName]), ?debug("service_edge_rpc:local_msg: timeout: ~p", [TimeoutArg]), ?debug("service_edge_rpc:local_msg: parameters: ~p", [Parameters]), - %% - %% Authorize local message and retrieve a certificate / signature - %% that will be accepted by the receiving node that will deliver - %% the messaage to its locally connected service_name service. - %% - [ok, Signature ] = - authorize_rpc:authorize_local_message( - St#st.cs, SvcName, [{service_name, SvcName}, - {timeout, TimeoutArg}, - %% {parameters, Parameters}, - {parameters, {struct, Parameters}} - ]), %% %% Slick but ugly. @@ -428,6 +416,21 @@ handle_call({ rvi, handle_local_message, false -> %% Absolute timoeut. Convert to unix time msec TimeoutArg * 1000 end, + + + %% + %% Authorize local message and retrieve a certificate / signature + %% that will be accepted by the receiving node that will deliver + %% the messaage to its locally connected service_name service. + %% + [ok, Signature ] = + authorize_rpc:authorize_local_message( + St#st.cs, SvcName, [{service_name, SvcName}, + {timeout, Timeout}, + %% {parameters, Parameters}, + {parameters, {struct, Parameters}} + ]), + %% %% Check if this is a local service by trying to resolve its service name. %% If successful, just forward it to its service_name. |
