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/service_edge/src | |
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/service_edge/src')
-rw-r--r-- | components/service_edge/src/service_edge_rpc.erl | 27 |
1 files changed, 15 insertions, 12 deletions
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. |