mirror of
https://github.com/valitydev/capi-pcidss-v2.git
synced 2024-11-06 01:35:24 +00:00
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:
parent
88a9112f0b
commit
dbedd4bdd5
2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
@ -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 }}
|
||||
|
@ -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()}) ->
|
||||
|
@ -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 => #{
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user