Exemplo n.º 1
0
 def renamed_group(self, event):
     if demangle_name(event.oldname)[0] == SEPL_DIRECTORY_NAME:
         # directorymanager has already added the new name to global groups
         return CONTINUE
     self.rename_group_subgroup(None, event.type, event.oldname,
             event.newname)
     return CONTINUE
Exemplo n.º 2
0
    def __init__(self, query={}):
        """Accepts a dictionary of key/value pairs which it uses to
        compare against dictionaries of object attributes"""
        self._query = query
        self._dir = ""

        # split names into directory/name
        if self._query.has_key('name'):
            self._dir, self._query['name'] =\
                demangle_name(self._query['name'])
Exemplo n.º 3
0
    def __init__(self, query = {}):
        """Accepts a dictionary of key/value pairs which it uses to
        compare against dictionaries of object attributes"""
        self._query = query
        self._dir   = ""

        # split names into directory/name
        if self._query.has_key('name'):
            self._dir, self._query['name'] =\
                demangle_name(self._query['name'])
Exemplo n.º 4
0
# along with NOX.  If not, see <http://www.gnu.org/licenses/>.

from nox.apps.authenticator import pyauth
from nox.apps.directory.directorymanager import demangle_name
from nox.apps.directory.simple_directory import simple_directory
from nox.lib.directory import Directory, GroupInfo

# principal is unauthenticated
UNAUTHENTICATED = pyauth.Authenticator.get_unauthenticated_name()
# principal is authenticated but more specific name is unknown
AUTHENTICATED = pyauth.Authenticator.get_authenticated_name()
# don't know principal's name (for throwing auth events)
UNKNOWN = pyauth.Authenticator.get_unknown_name()

UNMODIFIABLE = [
    demangle_name(UNAUTHENTICATED)[1],
    demangle_name(AUTHENTICATED)[1],
    demangle_name(UNKNOWN)[1]
]

DISCOVERED_DIR_NAME = "discovered"


class discovered_directory(simple_directory):
    GATEWAYS_GROUP_NAME = "gateways"
    SWITCH_MGMT_GROUP_NAME = "switch_management_ports"

    def __init__(self):
        simple_directory.__init__(self)

        for name in UNMODIFIABLE:
Exemplo n.º 5
0
 def _del_member(groups):
     for groupname in groups:
         groupname = demangle_name(groupname)[1]
         if member_name in grouptbl[groupname].member_names:
             grouptbl[groupname].member_names.remove(member_name)
     return retval
# You should have received a copy of the GNU General Public License
# along with NOX.  If not, see <http://www.gnu.org/licenses/>.

from nox.apps.authenticator import pyauth
from nox.apps.directory.directorymanager import demangle_name
from nox.apps.directory.simple_directory import simple_directory 
from nox.lib.directory import Directory, GroupInfo

# principal is unauthenticated
UNAUTHENTICATED = pyauth.Authenticator.get_unauthenticated_name()
# principal is authenticated but more specific name is unknown
AUTHENTICATED   = pyauth.Authenticator.get_authenticated_name()
# don't know principal's name (for throwing auth events)
UNKNOWN         = pyauth.Authenticator.get_unknown_name()

UNMODIFIABLE = [ demangle_name(UNAUTHENTICATED)[1],
                 demangle_name(AUTHENTICATED)[1],
                 demangle_name(UNKNOWN)[1] ]

DISCOVERED_DIR_NAME = "discovered"

class discovered_directory(simple_directory):
    GATEWAYS_GROUP_NAME = "gateways"
    SWITCH_MGMT_GROUP_NAME = "switch_management_ports"

    def __init__(self):
        simple_directory.__init__(self)        
        
        for name in UNMODIFIABLE:
            self.restricted_names.add(name)
        self.restricted_names.add(None)
Exemplo n.º 7
0
 def _del_member(groups):
     for groupname in groups:
         groupname = demangle_name(groupname)[1]
         if member_name in grouptbl[groupname].member_names:
             grouptbl[groupname].member_names.remove(member_name)
     return retval