[mod_auth*] rename http_auth.* -> mod_auth_api.*

rename http_auth.[ch] -> mod_auth_api.[ch]
personal/stbuehler/tests-path
Glenn Strauss 2021-05-22 17:08:47 -04:00
parent 1a8ac120b4
commit 3538f8f2a4
20 changed files with 81 additions and 67 deletions

View File

@ -810,7 +810,7 @@ add_and_install_library(mod_access mod_access.c)
add_and_install_library(mod_accesslog mod_accesslog.c)
add_and_install_library(mod_ajp13 mod_ajp13.c)
add_and_install_library(mod_alias mod_alias.c)
add_and_install_library(mod_auth "mod_auth.c;http_auth.c")
add_and_install_library(mod_auth "mod_auth.c;mod_auth_api.c")
add_and_install_library(mod_authn_file "mod_authn_file.c")
if(NOT WIN32)
add_and_install_library(mod_cgi mod_cgi.c)

View File

@ -332,7 +332,7 @@ mod_deflate_la_LDFLAGS = $(BROTLI_CFLAGS) $(common_module_ldflags)
mod_deflate_la_LIBADD = $(Z_LIB) $(ZSTD_LIB) $(BZ_LIB) $(BROTLI_LIBS) $(common_libadd)
lib_LTLIBRARIES += mod_auth.la
mod_auth_la_SOURCES = mod_auth.c http_auth.c
mod_auth_la_SOURCES = mod_auth.c mod_auth_api.c
mod_auth_la_LDFLAGS = $(common_module_ldflags)
mod_auth_la_LIBADD = $(CRYPTO_LIB) $(common_libadd)
@ -463,7 +463,7 @@ hdr = base64.h buffer.h burl.h network.h log.h http_kv.h keyvalue.h \
algo_hmac.h \
algo_md.h algo_md5.h algo_sha1.h algo_splaytree.h algo_xxhash.h \
ck.h \
http_auth.h http_cgi.h http_date.h \
http_cgi.h http_date.h \
http_header.h http_range.h http_vhostdb.h \
fdevent.h gw_backend.h connections.h base.h base_decls.h stat_cache.h \
plugin.h plugin_config.h \
@ -477,6 +477,7 @@ hdr = base64.h buffer.h burl.h network.h log.h http_kv.h keyvalue.h \
sys-endian.h sys-mmap.h sys-socket.h sys-strings.h sys-time.h \
mod_cml.h mod_cml_funcs.h \
sock_addr.h status_counter.h \
mod_auth_api.h \
mod_magnet_cache.h \
ls-hpack/lshpack.h \
ls-hpack/lsxpack_header.h \
@ -498,6 +499,7 @@ lighttpd_SOURCES = \
mod_ajp13.c \
mod_alias.c \
mod_auth.c \
mod_auth_api.c \
mod_authn_file.c \
mod_cgi.c \
mod_deflate.c \

View File

@ -101,7 +101,7 @@ modules = {
'mod_accesslog' : { 'src' : [ 'mod_accesslog.c' ] },
'mod_ajp13' : { 'src' : [ 'mod_ajp13.c' ] },
'mod_alias' : { 'src' : [ 'mod_alias.c' ] },
'mod_auth' : { 'src' : [ 'mod_auth.c', 'http_auth.c' ], 'lib' : [ env['LIBCRYPTO'] ] },
'mod_auth' : { 'src' : [ 'mod_auth.c', 'mod_auth_api.c' ], 'lib' : [ env['LIBCRYPTO'] ] },
'mod_authn_file' : { 'src' : [ 'mod_authn_file.c' ], 'lib' : [ env['LIBCRYPT'], env['LIBCRYPTO'] ] },
'mod_cgi' : { 'src' : [ 'mod_cgi.c' ] },
'mod_deflate' : { 'src' : [ 'mod_deflate.c' ], 'lib' : [ env['LIBZ'], env['LIBZSTD'], env['LIBBZ2'], env['LIBBROTLI'], 'm' ] },

View File

@ -425,7 +425,7 @@ static void config_compat_module_load (server *srv) {
#endif
}
/* mod_auth.c,http_auth.c auth backends were split into separate modules
/* mod_auth.c,mod_auth_api.c auth backends were split into separate modules
* Automatically load auth backend modules for compatibility with
* existing lighttpd 1.4.x configs */
if (contains_mod_auth) {

View File

@ -984,7 +984,7 @@ modules = [
[ 'mod_accesslog', [ 'mod_accesslog.c' ] ],
[ 'mod_ajp13', [ 'mod_ajp13.c' ] ],
[ 'mod_alias', [ 'mod_alias.c' ] ],
[ 'mod_auth', [ 'mod_auth.c', 'http_auth.c' ], [ libcrypto ] ],
[ 'mod_auth', [ 'mod_auth.c', 'mod_auth_api.c' ], [ libcrypto ] ],
[ 'mod_authn_file', [ 'mod_authn_file.c' ], [ libcrypt, libcrypto ] ],
[ 'mod_deflate', [ 'mod_deflate.c' ], libbz2 + libz + libzstd + libbrotli ],
[ 'mod_dirlisting', [ 'mod_dirlisting.c' ] ],

View File

@ -1,18 +1,25 @@
/*
* http_auth - HTTP authentication and authorization
*
* Largely-rewritten from original
* Copyright(c) 2016,2021 Glenn Strauss gstrauss()gluelogic.com All rights reserved
* License: BSD 3-clause (same as lighttpd)
*/
#include "first.h"
#include <stdlib.h>
#include <string.h>
#include "mod_auth_api.h"
#include "sys-crypto-md.h" /* USE_LIB_CRYPTO */
#include "base.h"
#include "ck.h"
#include "plugin.h"
#include "plugin_config.h"
#include "http_auth.h"
#include "http_header.h"
#include "log.h"
#include "algo_splaytree.h"
#include "plugin.h"
#include "plugin_config.h"
/**
* auth framework

View File

@ -1,5 +1,5 @@
/*
* http_auth - HTTP Auth backend registration, low-level shared funcs
* mod_auth_api - HTTP Auth backend registration, low-level shared funcs
*
* Fully-rewritten from original
* Copyright(c) 2016 Glenn Strauss gstrauss()gluelogic.com All rights reserved
@ -7,7 +7,7 @@
*/
#include "first.h"
#include "http_auth.h"
#include "mod_auth_api.h"
#include "http_header.h"
#include <stdlib.h>

View File

@ -1,5 +1,12 @@
#ifndef _HTTP_AUTH_H_
#define _HTTP_AUTH_H_
/*
* mod_auth_api - HTTP auth backend registration, low-level shared funcs
*
* Fully-rewritten from original
* Copyright(c) 2016 Glenn Strauss gstrauss()gluelogic.com All rights reserved
* License: BSD 3-clause (same as lighttpd)
*/
#ifndef INCLUDED_MOD_AUTH_API_H
#define INCLUDED_MOD_AUTH_API_H
#include "first.h"
#include "base_decls.h"

View File

@ -33,15 +33,15 @@
#include <crypt.h>
#endif
#include <dbi/dbi.h>
#include <string.h>
#include <stdlib.h>
#include <dbi/dbi.h>
#include "mod_auth_api.h"
#include "sys-crypto-md.h"
#include "base.h"
#include "ck.h"
#include "http_auth.h"
#include "fdevent.h"
#include "log.h"
#include "plugin.h"

View File

@ -16,19 +16,18 @@
# define HAVE_CRYPT
#endif
#include <stdlib.h>
#include <string.h>
#include "mod_auth_api.h"
#include "sys-crypto-md.h" /* USE_LIB_CRYPTO */
#include "base.h"
#include "ck.h"
#include "plugin.h"
#include "fdevent.h"
#include "http_auth.h"
#include "log.h"
#include "base64.h"
#include <stdlib.h>
#include <string.h>
#include "ck.h"
#include "fdevent.h"
#include "log.h"
#include "plugin.h"
/*
* htdigest, htpasswd, plain auth backends

View File

@ -20,21 +20,20 @@
* TODO: attempt async?
*/
#include "plugin.h"
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <krb5.h>
#include <gssapi.h>
#include <gssapi/gssapi_krb5.h>
#include "http_auth.h"
#include "http_header.h"
#include "mod_auth_api.h"
#include "base.h"
#include "log.h"
#include "base64.h"
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "http_header.h"
#include "log.h"
#include "plugin.h"
typedef struct {
const buffer *auth_gssapi_keytab;

View File

@ -7,16 +7,16 @@
*/
#include "first.h"
#include <ldap.h>
#include "base.h"
#include "http_auth.h"
#include "log.h"
#include "plugin.h"
#include <stdlib.h>
#include <string.h>
#include <ldap.h>
#include "mod_auth_api.h"
#include "base.h"
#include "log.h"
#include "plugin.h"
typedef struct {
LDAP *ldap;
log_error_st *errh;

View File

@ -27,19 +27,19 @@
#include <crypt.h>
#endif
#include <mysql.h>
#include "base.h"
#include "ck.h"
#include "http_auth.h"
#include "log.h"
#include "plugin.h"
#include <stdlib.h>
#include <string.h>
#include <mysql.h>
#include "mod_auth_api.h"
#include "sys-crypto-md.h"
#include "base.h"
#include "ck.h"
#include "log.h"
#include "plugin.h"
typedef struct {
int auth_mysql_port;
const char *auth_mysql_host;

View File

@ -17,16 +17,16 @@
* - database query is synchronous and blocks waiting for response
*/
#include <security/pam_appl.h>
#include "base.h"
#include "http_auth.h"
#include "log.h"
#include "plugin.h"
#include <stdlib.h>
#include <string.h>
#include <security/pam_appl.h>
#include "mod_auth_api.h"
#include "base.h"
#include "log.h"
#include "plugin.h"
typedef struct {
const char *service;
} plugin_config;

View File

@ -17,17 +17,17 @@
* - database query is synchronous and blocks waiting for response
*/
#include <sasl/sasl.h>
#include "base.h"
#include "http_auth.h"
#include "log.h"
#include "plugin.h"
#include <sys/utsname.h>
#include <stdlib.h>
#include <string.h>
#include <sasl/sasl.h>
#include "mod_auth_api.h"
#include "base.h"
#include "log.h"
#include "plugin.h"
typedef struct {
const char *service;
const char *fqdn;

View File

@ -2861,7 +2861,7 @@ https_add_ssl_client_entries (request_st * const r, handler_ctx * const hctx)
*/
const buffer *varname = hctx->conf.ssl_verifyclient_username;
vb = http_header_env_get(r, CONST_BUF_LEN(varname));
if (vb) { /* same as http_auth.c:http_auth_setenv() */
if (vb) { /* same as mod_auth_api.c:http_auth_setenv() */
http_header_env_set(r,
CONST_STR_LEN("REMOTE_USER"),
CONST_BUF_LEN(vb));

View File

@ -2495,7 +2495,7 @@ https_add_ssl_client_entries (request_st * const r, handler_ctx * const hctx)
*/
const buffer *varname = hctx->conf.ssl_verifyclient_username;
vb = http_header_env_get(r, CONST_BUF_LEN(varname));
if (vb) { /* same as http_auth.c:http_auth_setenv() */
if (vb) { /* same as mod_auth_api.c:http_auth_setenv() */
http_header_env_set(r,
CONST_STR_LEN("REMOTE_USER"),
CONST_BUF_LEN(vb));

View File

@ -2608,7 +2608,7 @@ https_add_ssl_client_entries (request_st * const r, handler_ctx * const hctx)
*/
const buffer *varname = hctx->conf.ssl_verifyclient_username;
vb = http_header_env_get(r, CONST_BUF_LEN(varname));
if (vb) { /* same as http_auth.c:http_auth_setenv() */
if (vb) { /* same as mod_auth_api.c:http_auth_setenv() */
http_header_env_set(r,
CONST_STR_LEN("REMOTE_USER"),
CONST_BUF_LEN(vb));

View File

@ -3513,7 +3513,7 @@ https_add_ssl_client_entries (request_st * const r, handler_ctx * const hctx)
*/
const buffer *varname = hctx->conf.ssl_verifyclient_username;
vb = http_header_env_get(r, CONST_BUF_LEN(varname));
if (vb) { /* same as http_auth.c:http_auth_setenv() */
if (vb) { /* same as mod_auth_api.c:http_auth_setenv() */
http_header_env_set(r,
CONST_STR_LEN("REMOTE_USER"),
CONST_BUF_LEN(vb));

View File

@ -3283,7 +3283,7 @@ https_add_ssl_client_entries (request_st * const r, handler_ctx * const hctx)
*/
const buffer *varname = hctx->conf.ssl_verifyclient_username;
vb = http_header_env_get(r, CONST_BUF_LEN(varname));
if (vb) { /* same as http_auth.c:http_auth_setenv() */
if (vb) { /* same as mod_auth_api.c:http_auth_setenv() */
http_header_env_set(r,
CONST_STR_LEN("REMOTE_USER"),
CONST_BUF_LEN(vb));