[MAJOR] use the new auth framework for http stats
Support the new syntax (http-request allow/deny/auth) in
http stats.
Now it is possible to use the same syntax is the same like in
the frontend/backend http-request access control:
acl src_nagios src 192.168.66.66
acl stats_auth_ok http_auth(L1)
stats http-request allow if src_nagios
stats http-request allow if stats_auth_ok
stats http-request auth realm LB
The old syntax is still supported, but now it is emulated
via private acls and an aditional userlist.
diff --git a/src/acl.c b/src/acl.c
index 6605094..007751d 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -17,6 +17,7 @@
#include <common/config.h>
#include <common/mini-clist.h>
#include <common/standard.h>
+#include <common/uri_auth.h>
#include <proto/acl.h>
#include <proto/auth.h>
@@ -1218,7 +1219,11 @@
continue;
}
- ul = auth_find_userlist(expr->arg.str);
+ if (p->uri_auth && p->uri_auth->userlist &&
+ !strcmp(p->uri_auth->userlist->name, expr->arg.str))
+ ul = p->uri_auth->userlist;
+ else
+ ul = auth_find_userlist(expr->arg.str);
if (!ul) {
Alert("proxy %s: acl %s %s(%s): unable to find userlist.\n",