pyzor.config¶
Functions that handle parsing pyzor configuration files.
-
pyzor.config.
expand_homefiles
(homefiles, category, homedir, config)[source]¶ Set the full file path for these configuration files.
-
pyzor.config.
load_access_file
(access_fn, accounts)[source]¶ Load the ACL from the specified file, if it exists, and return an ACL dictionary, where each key is a username and each value is a set of allowed permissions (if the permission is not in the set, then it is not allowed).
‘accounts’ is a dictionary of accounts that exist on the server - only the keys are used, which must be the usernames (these are the users that are granted permission when the ‘all’ keyword is used, as described below).
- Each line of the file should be in the following format:
- operation : user : allow|deny
where ‘operation’ is a space-separated list of pyzor commands or the keyword ‘all’ (meaning all commands), ‘username’ is a space-separated list of usernames or the keyword ‘all’ (meaning all users) - the anonymous user is called “anonymous”, and “allow|deny” indicates whether or not the specified user(s) may execute the specified operations.
The file is processed from top to bottom, with the final match for user/operation being the value taken. Every file has the following implicit final rule:
all : all : deny- If the file does not exist, then the following default is used:
- check report ping info : anonymous : allow