Re: ACL and operator

2024-02-03 Thread Willy Tarreau
On Sat, Feb 03, 2024 at 01:18:30PM +, Tristan wrote: > > > > On 3 Feb 2024, at 15:18, Willy Tarreau wrote: > > > > Quite honestly, we've though about it several times but you can't enforce > > such a change on 20 years of configs everywhere. > > That is why I directly mentioned it being so

Re: ACL and operator

2024-02-03 Thread Tristan
> On 3 Feb 2024, at 15:18, Willy Tarreau wrote: > > Quite honestly, we've though about it several times but you can't enforce > such a change on 20 years of configs everywhere. That is why I directly mentioned it being some form of opt-in behavior, because indeed we can’t expect everyone to

Re: ACL and operator

2024-02-03 Thread Willy Tarreau
On Sat, Feb 03, 2024 at 10:31:02AM +, Tristan wrote: > Hi Willy, > > > On 3 Feb 2024, at 12:48, Willy Tarreau wrote: > > > in fact we could check for > >> the presence of "and" or "or" on a line, or some other suspicious > >> constructs > > Another approach might be to optionally enforce qu

Re: ACL and operator

2024-02-03 Thread Tristan
Hi Willy, > On 3 Feb 2024, at 12:48, Willy Tarreau wrote: > in fact we could check for >> the presence of "and" or "or" on a line, or some other suspicious >> constructs Another approach might be to optionally enforce quotes around strings. While it’d be a breaking change and sounds a bit diff

Re: ACL and operator

2024-02-03 Thread Willy Tarreau
On Sat, Feb 03, 2024 at 09:10:42AM +0100, Willy Tarreau wrote: > On Fri, Feb 02, 2024 at 06:43:12PM +, Lukas Tribus wrote: > > On Fri, 2 Feb 2024 at 18:42, John Lauro wrote: > > > > > > Seems like a lint style checker that doesn't require AI. > > > For example, it could recognize that the / in

Re: ACL and operator

2024-02-03 Thread Willy Tarreau
On Fri, Feb 02, 2024 at 06:43:12PM +, Lukas Tribus wrote: > On Fri, 2 Feb 2024 at 18:42, John Lauro wrote: > > > > Seems like a lint style checker that doesn't require AI. > > For example, it could recognize that the / in /api isn't valid for > > req.hdr(host) > > [...] > > The _ in path_beg

Re: ACL and operator

2024-02-02 Thread Lukas Tribus
On Fri, 2 Feb 2024 at 18:42, John Lauro wrote: > > Seems like a lint style checker that doesn't require AI. > For example, it could recognize that the / in /api isn't valid for > req.hdr(host) > [...] > The _ in path_beg is also questionable. You can have _ in dns names, > but are not valid in h

Re: ACL and operator

2024-02-02 Thread Lukas Tribus
On Fri, 2 Feb 2024 at 15:09, Tom Braarup wrote: > > Hi, > > The config validator does not seems to catch this error in syntax and Haproxy > ignores the second part of the expression: > > use_backend api.example.com if { req.hdr(host) -i example.com and path_beg > /api } This is correct syntax a

ACL and operator

2024-02-02 Thread Tom Braarup
Hi, The config validator does not seems to catch this error in syntax and Haproxy ignores the second part of the expression: use_backend api.example.com if { req.hdr(host) -i example.com and path_beg /api } the correct syntax is: use_backend api.example.com if { req.hdr(host) -i example.com }