Skip to content

Commit

Permalink
Send the filename as URI from the module
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
botimer committed Dec 7, 2023
1 parent 58fcf5d commit 703e07d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apache/module/mod_lauth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) : ""
};

Expand Down
6 changes: 3 additions & 3 deletions db/test-fixture.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Location>)
'/lauth/test-site/web/restricted-by-username%', -- dlpsPath (path on disk, for Apache <Directory>)
'lauth-by-username', -- coll.uniqueIdentifier
CURRENT_TIMESTAMP, 'root', -- modified info
'f' -- deleted
);

-- Add a test case for full local file path via <Directory>
-- 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 <Directory>)
-- '/restricted-by-username%', -- dlpsPath (URL as Apache sees it for <Location>)
-- 'lauth-by-username', -- coll.uniqueIdentifier
-- CURRENT_TIMESTAMP, 'root', -- modified info
-- 'f' -- deleted
Expand Down

0 comments on commit 703e07d

Please sign in to comment.