]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: include: move auth.h to haproxy/auth{,-t}.h
authorWilly Tarreau <w@1wt.eu>
Thu, 4 Jun 2020 08:36:03 +0000 (10:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jun 2020 08:18:57 +0000 (10:18 +0200)
The STATS_DEFAULT_REALM and STATS_DEFAULT_URI were moved to defaults.h.
It was required to include types/pattern.h and types/sample.h since they
are mentioned in function prototypes.

It would be wise to merge this with uri_auth.h later.

12 files changed:
include/common/uri_auth.h
include/haproxy/auth-t.h [moved from include/types/auth.h with 84% similarity]
include/haproxy/auth.h [moved from include/proto/auth.h with 78% similarity]
include/haproxy/defaults.h
include/types/acl.h
src/acl.c
src/auth.c
src/cfgparse.c
src/haproxy.c
src/http_acl.c
src/http_fetch.c
src/sample.c

index 33596534e4ad2b2c6224575123d34580351a0090..9250f54f9078d163b189c8271f3b0beae8493cac 100644 (file)
@@ -14,8 +14,8 @@
 #define _COMMON_URI_AUTH_H
 
 
+#include <haproxy/auth-t.h>
 #include <haproxy/api.h>
-#include <types/auth.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.
@@ -41,21 +41,6 @@ struct uri_auth {
        struct uri_auth *next;          /* Used at deinit() to build a list of unique elements */
 };
 
-/* This is the default statistics URI */
-#ifdef CONFIG_STATS_DEFAULT_URI
-#define STATS_DEFAULT_URI CONFIG_STATS_DEFAULT_URI
-#else
-#define STATS_DEFAULT_URI "/haproxy?stats"
-#endif
-
-/* This is the default statistics realm */
-#ifdef CONFIG_STATS_DEFAULT_REALM
-#define STATS_DEFAULT_REALM CONFIG_STATS_DEFAULT_REALM
-#else
-#define STATS_DEFAULT_REALM "HAProxy Statistics"
-#endif
-
-
 struct stats_admin_rule {
        struct list list;       /* list linked to from the proxy */
        struct acl_cond *cond;  /* acl condition to meet */
similarity index 84%
rename from include/types/auth.h
rename to include/haproxy/auth-t.h
index f9b56f1ad2778f5e80aa5a1c7e3cd7f51ca9a1d3..83f2c7c43ca58b62d438663a0bf8bfdc32bef6b8 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * User authentication & authorization.
+ * include/haproxy/auth-t.h
+ * Types definitions for user authentication & authorization.
  *
  * Copyright 2010 Krzysztof Piotr Oledzki <ole@ans.pl>
  *
  *
  */
 
-#ifndef _TYPES_AUTH_H
-#define _TYPES_AUTH_H
+#ifndef _HAPROXY_AUTH_T_H
+#define _HAPROXY_AUTH_T_H
 
+#include <haproxy/auth-t.h>
 #include <haproxy/api-t.h>
 #include <haproxy/list-t.h>
 
-#include <types/auth.h>
-
 #define AU_O_INSECURE  0x00000001              /* insecure, unencrypted password */
 
 struct auth_groups {
@@ -48,7 +48,7 @@ struct userlist {
        struct auth_groups *groups;
 };
 
-#endif /* _TYPES_AUTH_H */
+#endif /* _HAPROXY_AUTH_T_H */
 
 /*
  * Local variables:
similarity index 78%
rename from include/proto/auth.h
rename to include/haproxy/auth.h
index 853e38cbbacf47524fbd5330bd983aa84052cafb..39cc0aab1d07eb71da099bd0cdaeab4afcdcd39d 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * User authentication & authorization.
+ * include/haproxy/auth.h
+ * Functions for user authentication & authorization.
  *
  * Copyright 2010 Krzysztof Piotr Oledzki <ole@ans.pl>
  *
  *
  */
 
-#ifndef _PROTO_AUTH_H
-#define _PROTO_AUTH_H
+#ifndef _HAPROXY_AUTH_H
+#define _HAPROXY_AUTH_H
 
+#include <haproxy/auth-t.h>
 #include <haproxy/api.h>
-#include <types/auth.h>
+#include <types/pattern.h>
+#include <types/sample.h>
 
 extern struct userlist *userlist;
 
@@ -26,7 +29,7 @@ struct pattern *pat_match_auth(struct sample *smp, struct pattern_expr *expr, in
 int check_user(struct userlist *ul, const char *user, const char *pass);
 int check_group(struct userlist *ul, char *name);
 
-#endif /* _PROTO_AUTH_H */
+#endif /* _HAPROXY_AUTH_H */
 
 /*
  * Local variables:
index dff5436d598a3c3613d2bee189b1516bf9446fb7..e359a3ea24f6ce941938e06093208ad9377691f9 100644 (file)
 #define STATS_VERSION_STRING " version " HAPROXY_VERSION ", released " HAPROXY_DATE
 #endif
 
+/* This is the default statistics URI */
+#ifdef CONFIG_STATS_DEFAULT_URI
+#define STATS_DEFAULT_URI CONFIG_STATS_DEFAULT_URI
+#else
+#define STATS_DEFAULT_URI "/haproxy?stats"
+#endif
+
+/* This is the default statistics realm */
+#ifdef CONFIG_STATS_DEFAULT_REALM
+#define STATS_DEFAULT_REALM CONFIG_STATS_DEFAULT_REALM
+#else
+#define STATS_DEFAULT_REALM "HAProxy Statistics"
+#endif
+
 /* Maximum signal queue size, and also number of different signals we can
  * handle.
  */
index 89c3c93c8f95189b9b474d1cd3889e27232171a3..78b26125c73bd1f27d0280370909d2df1e82fb0a 100644 (file)
 #ifndef _TYPES_ACL_H
 #define _TYPES_ACL_H
 
+#include <haproxy/auth-t.h>
 #include <haproxy/api-t.h>
 #include <haproxy/list-t.h>
 
 #include <haproxy/arg-t.h>
-#include <types/auth.h>
 #include <types/pattern.h>
 #include <types/proxy.h>
 #include <types/server.h>
index 5b5fd1d3b99fe0e7ca6436c223f6828e86c158a1..1ecacb1d94d0bfbea2ad48a3ba0bb4a52a522182 100644 (file)
--- a/src/acl.c
+++ b/src/acl.c
@@ -14,6 +14,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <haproxy/auth.h>
 #include <haproxy/api.h>
 #include <haproxy/list.h>
 #include <haproxy/tools.h>
@@ -23,7 +24,6 @@
 
 #include <proto/acl.h>
 #include <haproxy/arg.h>
-#include <proto/auth.h>
 #include <proto/channel.h>
 #include <proto/log.h>
 #include <proto/pattern.h>
index 2058f1fe2f96fdc1fee724253c343b8303a088af..30fec83f5942831bd49a38556ea5cda85275d32c 100644 (file)
@@ -25,6 +25,7 @@
 #include <string.h>
 #include <unistd.h>
 
+#include <haproxy/auth-t.h>
 #include <haproxy/api.h>
 #include <types/global.h>
 #include <haproxy/errors.h>
@@ -33,7 +34,6 @@
 #include <proto/acl.h>
 #include <proto/log.h>
 
-#include <types/auth.h>
 #include <types/pattern.h>
 
 struct userlist *userlist = NULL;    /* list of all existing userlists */
index 0505611537322eebbd0542836a52c461e2de4694..23a290e3a9c385136c4f1e8b0279e411f8209236 100644 (file)
@@ -34,6 +34,7 @@
 #include <unistd.h>
 
 #include <haproxy/action-t.h>
+#include <haproxy/auth.h>
 #include <haproxy/api.h>
 #include <common/cfgparse.h>
 #include <haproxy/chunk.h>
@@ -55,7 +56,6 @@
 #include <types/stats.h>
 
 #include <proto/acl.h>
-#include <proto/auth.h>
 #include <proto/backend.h>
 #include <proto/channel.h>
 #include <proto/checks.h>
index 94a37c3f6977037e1119850d598e51a070c67587..33b4abf279911c37e24bdca748622074f9fec328 100644 (file)
@@ -78,6 +78,7 @@
 #include <systemd/sd-daemon.h>
 #endif
 
+#include <haproxy/auth.h>
 #include <haproxy/api.h>
 #include <import/sha1.h>
 
 #include <proto/acl.h>
 #include <haproxy/activity.h>
 #include <haproxy/arg.h>
-#include <proto/auth.h>
 #include <proto/backend.h>
 #include <proto/channel.h>
 #include <proto/cli.h>
index 2fe7e85e1f4e090d4862a8cf6cfa52624d19a909..fdb5a0042ea10dc5d88969b93b3f8fefe6910adf 100644 (file)
@@ -16,6 +16,7 @@
 #include <string.h>
 #include <time.h>
 
+#include <haproxy/auth.h>
 #include <haproxy/api.h>
 #include <haproxy/chunk.h>
 #include <haproxy/http.h>
@@ -27,7 +28,6 @@
 
 #include <proto/acl.h>
 #include <haproxy/arg.h>
-#include <proto/auth.h>
 #include <proto/pattern.h>
 
 
index 31a69e768058f8824c96cd6114ba114263201a5e..c14b95bd41bc59edbb1868a3669c540808d775cf 100644 (file)
@@ -16,6 +16,7 @@
 #include <string.h>
 #include <time.h>
 
+#include <haproxy/auth.h>
 #include <haproxy/api.h>
 #include <haproxy/base64.h>
 #include <haproxy/chunk.h>
@@ -31,7 +32,6 @@
 #include <types/global.h>
 
 #include <haproxy/arg.h>
-#include <proto/auth.h>
 #include <proto/channel.h>
 #include <proto/connection.h>
 #include <proto/http_fetch.h>
index c1a4bb9bb600e24d2e79ada19d54045a424ae5fb..c13a1ead12c06ca637374019a6cbaa309abf5a30 100644 (file)
@@ -19,6 +19,7 @@
 #include <haproxy/api.h>
 #include <types/global.h>
 
+#include <haproxy/auth.h>
 #include <haproxy/buf.h>
 #include <haproxy/chunk.h>
 #include <haproxy/hash.h>
@@ -30,7 +31,6 @@
 #include <haproxy/base64.h>
 
 #include <haproxy/arg.h>
-#include <proto/auth.h>
 #include <proto/log.h>
 #include <proto/proxy.h>
 #include <proto/protocol_buffers.h>