From: Willy Tarreau Date: Thu, 4 Jun 2020 17:27:34 +0000 (+0200) Subject: REORG: include: split common/uri_auth.h into haproxy/uri_auth{,-t}.h X-Git-Tag: v2.2-dev9~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8c42b8a147fa2967a8dced8bb487a76de9d5ce89;p=thirdparty%2Fhaproxy.git REORG: include: split common/uri_auth.h into haproxy/uri_auth{,-t}.h Initially it looked like this could have been placed into auth.h or stats.h but it's not the case as it's what makes the link between them and the HTTP layer. However the file needed to be split in two. Quite a number of call places were dropped because these were mostly leftovers from the early days where the stats and cli were packed together. --- diff --git a/include/common/uri_auth.h b/include/haproxy/uri_auth-t.h similarity index 58% rename from include/common/uri_auth.h rename to include/haproxy/uri_auth-t.h index 9250f54f90..250979155f 100644 --- a/include/common/uri_auth.h +++ b/include/haproxy/uri_auth-t.h @@ -1,7 +1,8 @@ /* - * URI-based user authentication using the HTTP basic method. + * include/haproxy/uri_auth-t.h + * Definitions for URI-based user authentication using the HTTP basic method. * - * Copyright 2006-2011 Willy Tarreau + * Copyright 2006-2020 Willy Tarreau * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -10,12 +11,12 @@ * */ -#ifndef _COMMON_URI_AUTH_H -#define _COMMON_URI_AUTH_H - +#ifndef _HAPROXY_URI_AUTH_T_H +#define _HAPROXY_URI_AUTH_T_H +#include #include -#include +#include /* This is a list of proxies we are allowed to see. Later, it should go in the * user list, but before this we need to support de/re-authentication. @@ -46,25 +47,7 @@ struct stats_admin_rule { struct acl_cond *cond; /* acl condition to meet */ }; - -/* Various functions used to set the fields during the configuration parsing. - * Please that all those function can initialize the root entry in order not to - * force the user to respect a certain order in the configuration file. - * - * Default values are used during initialization. Check STATS_DEFAULT_* for - * more information. - */ -struct uri_auth *stats_check_init_uri_auth(struct uri_auth **root); -struct uri_auth *stats_set_uri(struct uri_auth **root, char *uri); -struct uri_auth *stats_set_realm(struct uri_auth **root, char *realm); -struct uri_auth *stats_set_refresh(struct uri_auth **root, int interval); -struct uri_auth *stats_set_flag(struct uri_auth **root, int flag); -struct uri_auth *stats_add_auth(struct uri_auth **root, char *user); -struct uri_auth *stats_add_scope(struct uri_auth **root, char *scope); -struct uri_auth *stats_set_node(struct uri_auth **root, char *name); -struct uri_auth *stats_set_desc(struct uri_auth **root, char *desc); - -#endif /* _COMMON_URI_AUTH_H */ +#endif /* _HAPROXY_URI_AUTH_T_H */ /* * Local variables: diff --git a/include/haproxy/uri_auth.h b/include/haproxy/uri_auth.h new file mode 100644 index 0000000000..27dca02c70 --- /dev/null +++ b/include/haproxy/uri_auth.h @@ -0,0 +1,44 @@ +/* + * include/haproxy/uri_auth.h + * Functions for URI-based user authentication using the HTTP basic method. + * + * Copyright 2006-2020 Willy Tarreau + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + */ + +#ifndef _HAPROXY_URI_AUTH_H +#define _HAPROXY_URI_AUTH_H + +#include +#include + +/* Various functions used to set the fields during the configuration parsing. + * Please that all those function can initialize the root entry in order not to + * force the user to respect a certain order in the configuration file. + * + * Default values are used during initialization. Check STATS_DEFAULT_* for + * more information. + */ +struct uri_auth *stats_check_init_uri_auth(struct uri_auth **root); +struct uri_auth *stats_set_uri(struct uri_auth **root, char *uri); +struct uri_auth *stats_set_realm(struct uri_auth **root, char *realm); +struct uri_auth *stats_set_refresh(struct uri_auth **root, int interval); +struct uri_auth *stats_set_flag(struct uri_auth **root, int flag); +struct uri_auth *stats_add_auth(struct uri_auth **root, char *user); +struct uri_auth *stats_add_scope(struct uri_auth **root, char *scope); +struct uri_auth *stats_set_node(struct uri_auth **root, char *name); +struct uri_auth *stats_set_desc(struct uri_auth **root, char *desc); + +#endif /* _HAPROXY_URI_AUTH_H */ + +/* + * Local variables: + * c-indent-level: 8 + * c-basic-offset: 8 + * End: + */ diff --git a/src/acl.c b/src/acl.c index ea0a54dc15..259b79a7b9 100644 --- a/src/acl.c +++ b/src/acl.c @@ -20,7 +20,6 @@ #include #include #include -#include #include diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c index 0c6fa35b76..44474fde20 100644 --- a/src/cfgparse-listen.c +++ b/src/cfgparse-listen.c @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include diff --git a/src/cfgparse.c b/src/cfgparse.c index 376430f267..5f2787792a 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -58,7 +58,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/cli.c b/src/cli.c index a520787916..186aad424c 100644 --- a/src/cli.c +++ b/src/cli.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #include diff --git a/src/haproxy.c b/src/haproxy.c index b420df9383..26702a9065 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -107,7 +107,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c index 48a0514f40..f4ac3d5d24 100644 --- a/src/hlua_fcn.c +++ b/src/hlua_fcn.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff --git a/src/http_act.c b/src/http_act.c index 844eeafbf1..37966f399b 100644 --- a/src/http_act.c +++ b/src/http_act.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/http_ana.c b/src/http_ana.c index 8555293782..37ae6481ce 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -21,8 +21,8 @@ #include #include #include +#include #include -#include #include diff --git a/src/sample.c b/src/sample.c index 8fd043b8e3..23f7bf267b 100644 --- a/src/sample.c +++ b/src/sample.c @@ -29,8 +29,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/src/stats.c b/src/stats.c index bc9aaee8b2..0bb7481828 100644 --- a/src/stats.c +++ b/src/stats.c @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/uri_auth.c b/src/uri_auth.c index a2c1426159..236f578725 100644 --- a/src/uri_auth.c +++ b/src/uri_auth.c @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include