Skip to content

Commit e58a480

Browse files
committed
BZ-62497: Make r.ap_auth_type writable via mod_lua
This completes the option of setting the remote user by the authentication mechanism which actually verified the user. One possible usecase is that a proxied (upstream) server performs the authentication, but the access log of HTTPd does not contain this information. The upstream server can pass this kind of information back to HTTPd and both servers will have consistent access logs.
1 parent fd9c416 commit e58a480

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

docs/manual/mod/mod_lua.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ end
360360
<tr>
361361
<td><code>ap_auth_type</code></td>
362362
<td>string</td>
363-
<td>no</td>
363+
<td>yes</td>
364364
<td>If an authentication check was made, this is set to the type
365365
of authentication (f.x. <code>basic</code>)</td>
366366
</tr>

docs/manual/mod/mod_lua.xml.fr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ end
383383
<tr>
384384
<td><code>ap_auth_type</code></td>
385385
<td>string</td>
386-
<td>non</td>
386+
<td>oui</td>
387387
<td>Ce champ contient le type d'authentification effectuée
388388
(par exemple <code>basic</code>)</td>
389389
</tr>

modules/lua/lua_request.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2551,6 +2551,12 @@ static int req_newindex(lua_State *L)
25512551
request_rec *r = ap_lua_check_request_rec(L, 1);
25522552
key = luaL_checkstring(L, 2);
25532553

2554+
if (0 == strcmp("ap_auth_type", key)) {
2555+
const char *value = luaL_checkstring(L, 3);
2556+
r->ap_auth_type = apr_pstrdup(r->pool, value);
2557+
return 0;
2558+
}
2559+
25542560
if (0 == strcmp("args", key)) {
25552561
const char *value = luaL_checkstring(L, 3);
25562562
r->args = apr_pstrdup(r->pool, value);

0 commit comments

Comments
 (0)