From e501223c11c8a3f8009b1c3867e2411763399ea6 Mon Sep 17 00:00:00 2001 From: Noah Botimer Date: Wed, 13 Dec 2023 15:33:44 -0500 Subject: [PATCH] Send IP from Apache module and allow client IP header --- apache/client/src/lauth/api_client.cpp | 1 + apache/client/test/lauth/api_client_test.cpp | 1 + apache/conf/lauth.conf | 2 ++ 3 files changed, 4 insertions(+) diff --git a/apache/client/src/lauth/api_client.cpp b/apache/client/src/lauth/api_client.cpp index 30aa46c7..fb344f60 100644 --- a/apache/client/src/lauth/api_client.cpp +++ b/apache/client/src/lauth/api_client.cpp @@ -9,6 +9,7 @@ namespace mlibrary::lauth { AuthorizationResult ApiClient::authorize(Request req) { HttpParams params { + {"ip", req.ip}, {"uri", req.uri}, {"user", req.user} }; diff --git a/apache/client/test/lauth/api_client_test.cpp b/apache/client/test/lauth/api_client_test.cpp index 3ae619a1..7124220c 100644 --- a/apache/client/test/lauth/api_client_test.cpp +++ b/apache/client/test/lauth/api_client_test.cpp @@ -23,6 +23,7 @@ TEST(ApiClient, HttpRequestByApiClientIsCorrect) { }; HttpParams params { + {"ip", req.ip}, {"uri", req.uri}, {"user", req.user} }; diff --git a/apache/conf/lauth.conf b/apache/conf/lauth.conf index f3339c0b..044eb062 100644 --- a/apache/conf/lauth.conf +++ b/apache/conf/lauth.conf @@ -2,3 +2,5 @@ LoadModule lauth_module modules/mod_lauth.so SetHandler lauth + +RemoteIPHeader X-Client-IP