]> git.ipfire.org Git - thirdparty/squid.git/commit - src/acl/Note.h
Note ACL substrings matching
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 24 Dec 2015 06:57:04 +0000 (08:57 +0200)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 24 Dec 2015 06:57:04 +0000 (08:57 +0200)
commit76ee67ac663acdd0a364d226b72f0df2c94f58da
tree0981977f82b3548f6168f2b8b598a4067e7109f3
parent2c63936edba37e9923f1896cbcdac51692331f34
Note ACL substrings matching

There are several use cases where an annotation may contain a list of values
for a single key. Today it is only possible to match the full annotation value.

This patch investigates the -m flag which can be used to enable delimiter
separated substrings matching on annotations:
   acl aclname note [-m[=delimiters]] name value ...
The '-m' flag by default matches comma separated substrings. The optional
"delimiters" parameter is a list of non-alphanumeric characters, which can
be used as alternate delimiters.

E.g. if an external ACL sets an annotation like:
   "applications=http,facebook,facebook-chat"
the following ACLs can be used to block access to certain applications:

acl fb_chat      note -m applications facebook-chat
acl db_upload    note -m  applications dropbox-upload
http_access      deny fb_chat
http_access      deny db_upload

This is a Measurement Factory project
src/AclRegs.cc
src/acl/Acl.cc
src/acl/Acl.h
src/acl/Note.cc
src/acl/Note.h
src/acl/NoteData.cc
src/acl/NoteData.h
src/acl/StringData.cc
src/acl/StringData.h
src/cf.data.pre