Ops 277/optional ip header (#21)

* OPS-277: Add optional ip header to config

* Add to example config

* Fix CI
This commit is contained in:
ndiezel0 2023-03-31 10:04:45 +03:00 committed by GitHub
parent 88a9112f0b
commit dbedd4bdd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 3 deletions

View File

@ -30,7 +30,7 @@ jobs:
run:
name: Run checks
needs: setup
uses: valitydev/erlang-workflows/.github/workflows/erlang-parallel-build.yml@v1.0.0
uses: valitydev/erlang-workflows/.github/workflows/erlang-parallel-build.yml@v1.0.10
with:
otp-version: ${{ needs.setup.outputs.otp-version }}
rebar-version: ${{ needs.setup.outputs.rebar-version }}

View File

@ -101,7 +101,8 @@ wrap_payment_session(ClientInfo, PaymentSession) ->
determine_peer(Req) ->
Peer = cowboy_req:peer(Req),
Value = cowboy_req:header(<<"x-forwarded-for">>, Req),
IPAddressHeader = genlib_app:env(capi_pcidss, ip_address_header, <<"x-forwarded-for">>),
Value = cowboy_req:header(IPAddressHeader, Req),
determine_peer_from_header(Value, Peer).
-spec determine_peer_from_header(undefined | binary(), {inet:ip_address(), inet:port_number()}) ->

View File

@ -40,6 +40,7 @@
%% {oops_bodies, #{
%% 500 => "oops_bodies/500_body"
%% }},
{ip_address_header, <<"x-forwarded-for">>},
{scoper_event_handler_options, #{
event_handler_opts => #{
formatter_opts => #{

View File

@ -115,7 +115,7 @@
0},
{<<"swag_server">>,
{git,"https://github.com/valitydev/swag-payments.git",
{ref,"41747e0fe3758299b7865f099f4bfe8a91166c13"}},
{ref,"5e355455f1a2cb0735d1ceead4e981712ebe4a92"}},
0},
{<<"tds_proto">>,
{git,"https://github.com/valitydev/tds-proto.git",