Imported Upstream version 1.3.0
[platform/upstream/augeas.git] / lenses / aptcacherngsecurity.aug
1 (* Module: AptCacherNGSecurity
2
3    Lens for config files like the one found in
4    /etc/apt-cacher-ng/security.conf
5
6
7    About: License
8    Copyright 2013 Erik B. Andersen; this file is licenced under the LGPL v2+.
9 *)
10 module AptCacherNGSecurity =
11         autoload xfm
12
13         (* Define a Username/PW pair *)
14         let authpair = [ key /[^ \t:\/]*/ . del /:/ ":" . store /[^: \t\n]*/ ]
15
16         (* Define a record. So far as I can tell, the only auth level supported is Admin *)
17         let record = [ key "AdminAuth". del /[ \t]*:[ \t]*/ ": ". authpair . Util.del_str "\n"]
18
19         (* Define the basic lens *)
20         let lns = ( record | Util.empty | Util.comment )*
21
22         let filter = incl "/etc/apt-cacher-ng/security.conf"
23                 . Util.stdexcl
24
25         let xfm = transform lns filter