]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: include: split common/uri_auth.h into haproxy/uri_auth{,-t}.h
authorWilly Tarreau <w@1wt.eu>
Thu, 4 Jun 2020 17:27:34 +0000 (19:27 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jun 2020 08:18:58 +0000 (10:18 +0200)
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.

13 files changed:
include/haproxy/uri_auth-t.h [moved from include/common/uri_auth.h with 58% similarity]
include/haproxy/uri_auth.h [new file with mode: 0644]
src/acl.c
src/cfgparse-listen.c
src/cfgparse.c
src/cli.c
src/haproxy.c
src/hlua_fcn.c
src/http_act.c
src/http_ana.c
src/sample.c
src/stats.c
src/uri_auth.c

similarity index 58%
rename from include/common/uri_auth.h
rename to include/haproxy/uri_auth-t.h
index 9250f54f9078d163b189c8271f3b0beae8493cac..250979155f64e46f12b183318617207e5b8071e1 100644 (file)
@@ -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 <w@1wt.eu>
+ * Copyright 2006-2020 Willy Tarreau <w@1wt.eu>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  *
  */
 
-#ifndef _COMMON_URI_AUTH_H
-#define _COMMON_URI_AUTH_H
-
+#ifndef _HAPROXY_URI_AUTH_T_H
+#define _HAPROXY_URI_AUTH_T_H
 
+#include <haproxy/acl-t.h>
 #include <haproxy/auth-t.h>
-#include <haproxy/api.h>
+#include <haproxy/list-t.h>
 
 /* 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 (file)
index 0000000..27dca02
--- /dev/null
@@ -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 <w@1wt.eu>
+ *
+ * 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 <haproxy/api.h>
+#include <haproxy/uri_auth-t.h>
+
+/* 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:
+ */
index ea0a54dc15e603e189cd2195e666142729866981..259b79a7b96f0696b629a87828f9be4de9e8245a 100644 (file)
--- a/src/acl.c
+++ b/src/acl.c
@@ -20,7 +20,6 @@
 #include <haproxy/list.h>
 #include <haproxy/pattern.h>
 #include <haproxy/tools.h>
-#include <common/uri_auth.h>
 
 #include <haproxy/global.h>
 
index 0c6fa35b76e75a5944199e176c43b1d1315ecadb..44474fde2097db44ff08da467f046b20c06ee97e 100644 (file)
@@ -12,7 +12,7 @@
 #include <unistd.h>
 
 #include <common/cfgparse.h>
-#include <common/uri_auth.h>
+#include <haproxy/uri_auth.h>
 
 #include <haproxy/acl.h>
 #include <haproxy/capture-t.h>
index 376430f267ce1beb996c7a1adc15a9169cf3dd03..5f2787792a62d5e850b88122c5a090466cc85199 100644 (file)
@@ -58,7 +58,7 @@
 #include <haproxy/session.h>
 #include <haproxy/tools.h>
 #include <haproxy/time.h>
-#include <common/uri_auth.h>
+#include <haproxy/uri_auth-t.h>
 #include <haproxy/namespace.h>
 #include <haproxy/task.h>
 #include <haproxy/thread.h>
index a520787916af663a400442b59668944dd00fca41..186aad424cb96f4136b6d7d494eba9c969197192 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -42,7 +42,6 @@
 #include <haproxy/tools.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
-#include <common/uri_auth.h>
 #include <haproxy/version.h>
 #include <haproxy/base64.h>
 
index b420df9383e5f136e459f2307cd4cab1a03dfc91..26702a9065706f1161353cc56c992732161ef961 100644 (file)
 #include <haproxy/signal.h>
 #include <haproxy/tools.h>
 #include <haproxy/time.h>
-#include <common/uri_auth.h>
+#include <haproxy/uri_auth-t.h>
 #include <haproxy/version.h>
 #include <haproxy/task.h>
 #include <haproxy/thread.h>
index 48a0514f40539e9d2cecabece5541300d23f26ab..f4ac3d5d2471453d6ebb89aefcc070357289366b 100644 (file)
@@ -23,7 +23,6 @@
 #include <haproxy/net_helper.h>
 #include <haproxy/regex.h>
 #include <haproxy/time.h>
-#include <common/uri_auth.h>
 
 #include <types/cli.h>
 #include <types/proxy.h>
index 844eeafbf1edd74c8863057d5fbf6318ef74238a..37966f399bf5d78e01215e28ac41e2b878ca7fca 100644 (file)
@@ -30,7 +30,7 @@
 #include <haproxy/regex.h>
 #include <haproxy/sample.h>
 #include <haproxy/tools.h>
-#include <common/uri_auth.h>
+#include <haproxy/uri_auth-t.h>
 #include <haproxy/version.h>
 
 #include <haproxy/capture-t.h>
index 8555293782b0a7ce156510f8ee3fe8599dacd47d..37ae6481ce37caaca21ca4e526f34643e0330a56 100644 (file)
@@ -21,8 +21,8 @@
 #include <haproxy/htx.h>
 #include <haproxy/net_helper.h>
 #include <haproxy/regex.h>
+#include <haproxy/uri_auth-t.h>
 #include <haproxy/vars.h>
-#include <common/uri_auth.h>
 
 #include <haproxy/capture-t.h>
 
index 8fd043b8e3f95820b220d89bd4f8639020d372f4..23f7bf267bf71cbe1479e53511e468931c0df441 100644 (file)
@@ -29,8 +29,8 @@
 #include <haproxy/regex.h>
 #include <haproxy/sample.h>
 #include <haproxy/tools.h>
+#include <haproxy/uri_auth-t.h>
 #include <haproxy/vars.h>
-#include <common/uri_auth.h>
 #include <haproxy/base64.h>
 
 #include <haproxy/arg.h>
index bc9aaee8b272bf04871e7150672f5eeb3d5270ba..0bb7481828abc77f4f8065a2b4fccec647e57000 100644 (file)
@@ -45,7 +45,7 @@
 #include <haproxy/tools.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
-#include <common/uri_auth.h>
+#include <haproxy/uri_auth-t.h>
 #include <haproxy/version.h>
 #include <haproxy/base64.h>
 
index a2c14261596c10e0a093533b6e0a844ca3e2141f..236f578725506065d6434e4e62e9f56b88014eef 100644 (file)
@@ -15,7 +15,7 @@
 
 #include <haproxy/api.h>
 #include <haproxy/base64.h>
-#include <common/uri_auth.h>
+#include <haproxy/uri_auth.h>
 
 #include <types/stats.h>
 #include <proto/log.h>