mirror of
https://github.com/valitydev/bouncer.git
synced 2024-11-06 02:15:18 +00:00
ED-124: -drop legacy ContextTokens (#35)
This commit is contained in:
parent
6dbd5079a7
commit
90f64bb523
@ -2,7 +2,7 @@
|
||||
[{<<"bear">>,{pkg,<<"bear">>,<<"0.9.0">>},2},
|
||||
{<<"bouncer_proto">>,
|
||||
{git,"git@github.com:rbkmoney/bouncer-proto.git",
|
||||
{ref,"8da12fe98bc751e7f8f17f64ad4f571a6a63b0fe"}},
|
||||
{ref,"cc50cc4549ce4598a023dea5b1ab0a25a449a2d0"}},
|
||||
0},
|
||||
{<<"cache">>,{pkg,<<"cache">>,<<"2.3.3">>},1},
|
||||
{<<"certifi">>,{pkg,<<"certifi">>,<<"2.6.1">>},2},
|
||||
|
@ -61,29 +61,10 @@ from_thrift_context(Ctx) ->
|
||||
|
||||
-spec try_upgrade(thrift_ctx_fragment()) -> thrift_ctx_fragment().
|
||||
try_upgrade(#bctx_v1_ContextFragment{vsn = 1} = Ctx) ->
|
||||
% TODO #ED-124 #ED-162 rbkmoney/bouncer-policies#46
|
||||
% tokens.replacement_ip -> client_info.ip
|
||||
% удалить после выкатки capi_pcidss|bouncer-proto без bctx_v1_ContextTokens
|
||||
ContextCAPI =
|
||||
case Ctx#bctx_v1_ContextFragment.tokens of
|
||||
#bctx_v1_ContextTokens{replacement_ip = undefined} ->
|
||||
Ctx#bctx_v1_ContextFragment.capi;
|
||||
#bctx_v1_ContextTokens{replacement_ip = IP} ->
|
||||
CAPI = Ctx#bctx_v1_ContextFragment.capi,
|
||||
Operation = CAPI#bctx_v1_ContextCommonAPI.op,
|
||||
ClientInfo = #bctx_v1_ClientInfo{ip = IP},
|
||||
CAPI#bctx_v1_ContextCommonAPI{
|
||||
op = Operation#bctx_v1_CommonAPIOperation{
|
||||
client_info = ClientInfo
|
||||
}
|
||||
};
|
||||
_ ->
|
||||
Ctx#bctx_v1_ContextFragment.capi
|
||||
end,
|
||||
Ctx#bctx_v1_ContextFragment{
|
||||
vsn = ?BCTX_V1_HEAD,
|
||||
capi = ContextCAPI
|
||||
};
|
||||
% no legacy data producers
|
||||
% legacy structures have been removed
|
||||
% nothing to update
|
||||
Ctx#bctx_v1_ContextFragment{vsn = ?BCTX_V1_HEAD};
|
||||
try_upgrade(#bctx_v1_ContextFragment{vsn = ?BCTX_V1_HEAD} = Ctx) ->
|
||||
Ctx.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user