From 703e07de321ec485f65acbbabc842fb691ef5c42 Mon Sep 17 00:00:00 2001 From: Noah Botimer Date: Thu, 7 Dec 2023 10:58:35 -0500 Subject: [PATCH] Send the filename as URI from the module Most of our existing authorizations are done by full file path. We do use URIs for some, but we'll add another test scenario for that. --- apache/module/mod_lauth.cpp | 2 +- db/test-fixture.sql | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apache/module/mod_lauth.cpp b/apache/module/mod_lauth.cpp index f95d3ec6..acb5a111 100644 --- a/apache/module/mod_lauth.cpp +++ b/apache/module/mod_lauth.cpp @@ -40,7 +40,7 @@ static authz_status lauth_check_authorization(request_rec *r, Request req { .ip = r->useragent_ip ? std::string(r->useragent_ip) : "", - .uri = r->uri ? std::string(r->uri) : "", + .uri = r->filename ? std::string(r->filename) : "", .user = r->user ? std::string(r->user) : "" }; diff --git a/db/test-fixture.sql b/db/test-fixture.sql index e25bb34c..cca30b29 100644 --- a/db/test-fixture.sql +++ b/db/test-fixture.sql @@ -24,17 +24,17 @@ INSERT INTO aa_coll VALUES( INSERT INTO aa_coll_obj VALUES( 'www.lauth.local', -- server hostname, not vhost - '/restricted-by-username%', -- dlpsPath (URL as Apache sees it for ) + '/lauth/test-site/web/restricted-by-username%', -- dlpsPath (path on disk, for Apache ) 'lauth-by-username', -- coll.uniqueIdentifier CURRENT_TIMESTAMP, 'root', -- modified info 'f' -- deleted ); --- Add a test case for full local file path via +-- Our "proxied" tests will covered URI-based locations ------------- !!!! ----------------- -- INSERT INTO aa_coll_obj VALUES( -- 'www.lauth.local', -- server hostname, not vhost --- '/lauth/test-site/web/restricted-by-username%', -- dlpsPath (path on disk, for Apache ) +-- '/restricted-by-username%', -- dlpsPath (URL as Apache sees it for ) -- 'lauth-by-username', -- coll.uniqueIdentifier -- CURRENT_TIMESTAMP, 'root', -- modified info -- 'f' -- deleted