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