4 This module acts as a loader for the pluggable authorization system.
6 Any Python module which wishes to provide an authorization scheme for
7 Invirt should advertise an entry point in the invirt.authz group with
8 a unique name. That name can then be configured in
9 /etc/invirt/master.yaml as the authz mechanism.
14 from invirt.config import config
17 def expand_owner(name):
18 """Expand an "owner" to a list of authorized users."""
19 for ep in pkg_resources.iter_entry_points('invirt.authz', config['authz.name']):
20 return ep.load().expandOwner(name)
22 def expand_admin(name):
23 """Expand an "administrator" to a list of authorized users."""
24 for ep in pkg_resources.iter_entry_points('invirt.authz', config['authz.name']):
25 return ep.load().expandAdmin(name)