def __init__(self, repo, db): ConchUser.__init__(self) self.repo = repo self.db = db self.channelLookup.update( {b'fzone-chan': FZoneChanServerChannel, b'fzone-blob': FZoneBlobServerChannel})
def __init__(self, user_id): ConchUser.__init__(self) self.user_id = user_id self.avatar_id = uuid.uuid4().hex self.channelLookup.update({'session': SSHSession}) self.terminal = None self.term_size = (20, 80) self.ssh_protocol = None
def __init__(self, username, root): ConchUser.__init__(self) self.username = username self.filesystem = pathutils.FileSystem(root) self.listeners = {} # dict mapping (interface, port) -> listener self.channelLookup.update({"session": session.SSHSession}) self.subsystemLookup.update({"sftp": FileTransferServer})
def __init__(self, avatarId): assert self.protocolFactory is not None, ( "When subclassing SSHBaseAvatar, set the " "`protocolFactory` attribute to a protocol factory`. " "E.g. `SSHDemoProtocolFactory`") ConchUser.__init__(self) self.avatarId = avatarId self.channelLookup.update({'session': SSHSession})
def requestAvatar(self, avatarId, mind, *interfaces): print "running requestAvatar" if IConchUser in interfaces: print "if statement" user = ConchUser() user.channelLookup['session'] = SimpleSession return IConchUser, user, nothing else: raise NotImplementedError("No supported interfaces found.")
def __init__(self, username, root): ConchUser.__init__(self) self.username = username self.filesystem = pathutils.FileSystem(root) self.listeners = {} # dict mapping (interface, port) -> listener self.channelLookup.update( {"session": session.SSHSession}) self.subsystemLookup.update( {"sftp": FileTransferServer})
def requestAvatar(self, avatarId, mind, *interfaces): if IConchUser in interfaces: user = ConchUser() user.channelLookup["session"] = Session return IConchUser, user, lambda: None if ITelnetProtocol in interfaces: return ITelnetProtocol, TelnetProxy(), lambda: None return None
def __init__(self, siteId, cwd, uid): ConchUser.__init__(self) # Allow the user to open a channel of type session. This implementation # will look up the ISession adapter for this site and use the resulting # object to authorize any SSH actions. self.channelLookup['session'] = SSHSession self.siteId = siteId self.cwd = cwd self.uid = uid
def __init__(self, username, authnz, vcs_config): ConchUser.__init__(self) self.username = username self.authnz = authnz self.vcs_config = vcs_config self.channelLookup.update({"session": VCSSession}) self.shell = {} # Find git-shell path. # Adapted from http://bugs.python.org/file15381/shutil_which.patch self.path = os.environ.get("PATH", os.defpath) self.shell['git'] = self._shells_find('git-shell') # self.shell['hd'] = self._shells_find('hg') self.shell['hg'] = '/usr/local/bin/hg'
def requestAvatar(self, username, mind, *interfaces): """" The connection has already been authenticated at this point. Our job is to return some objects representing the logged in user. `username' is also known as the Avatar ID in `twisted.cred' terminology. """ try: # treat username as an OTP and attempt transport, protocol = self.tickets.pop(username) # reset routing ticket since it is one-time only. ticket = tickets.newTicket() self.tickets[ticket] = (transport, protocol) log.msg("Reset routing ticket from %s to %s" % (username, ticket,)) u = ConchUser() # Add a custom field to indicate that this connection # is going to be connected (routed) using this ticket. u._connectTo = (transport, protocol) u.factory = self.factory u.options = self.factory.options return IConchUser, u, lambda:None except KeyError: log.msg('Username %r not recognized as access ticket. Connecting to public AMP subsystem only!' % (username,)) # logged in user gets access to AMP subsystem only. No shells. u = ConchUser() u.factory = self.factory u.options = self.factory.options u.channelLookup['session'] = AMPSession return IConchUser, u, lambda:None
def __init__(self, username): ConchUser.__init__(self) self.username = username self.pwdData = pwd.getpwnam(self.username) l = [self.pwdData[3]] for groupname, password, gid, userlist in grp.getgrall(): if username in userlist: l.append(gid) self.otherGroups = l self.listeners = {} # Dict mapping (interface, port) -> listener self.channelLookup.update( {b"session": session.SSHSession, b"direct-tcpip": forwarding.openConnectForwardingClient}) self.subsystemLookup.update( {b"sftp": filetransfer.FileTransferServer})
def __init__(self, username): ConchUser.__init__(self) self.username = username self.pwdData = pwd.getpwnam(self.username) l = [self.pwdData[3]] for groupname, password, gid, userlist in grp.getgrall(): if username in userlist: l.append(gid) self.otherGroups = l self.listeners = {} # Dict mapping (interface, port) -> listener self.channelLookup.update( {"session": session.SSHSession, "direct-tcpip": forwarding.openConnectForwardingClient}) self.subsystemLookup.update( {"sftp": filetransfer.FileTransferServer})
def requestAvatar(self, username, mind, *interfaces): """" The connection has already been authenticated at this point. Our job is to return some objects representing the logged in user. `username' is also known as the Avatar ID in `twisted.cred' terminology. """ try: # treat username as an OTP and attempt transport, protocol = self.tickets.pop(username) # reset routing ticket since it is one-time only. ticket = tickets.newTicket() self.tickets[ticket] = (transport, protocol) log.msg("Reset routing ticket from %s to %s" % ( username, ticket, )) u = ConchUser() # Add a custom field to indicate that this connection # is going to be connected (routed) using this ticket. u._connectTo = (transport, protocol) u.factory = self.factory u.options = self.factory.options return IConchUser, u, lambda: None except KeyError: log.msg( 'Username %r not recognized as access ticket. Connecting to public AMP subsystem only!' % (username, )) # logged in user gets access to AMP subsystem only. No shells. u = ConchUser() u.factory = self.factory u.options = self.factory.options u.channelLookup['session'] = AMPSession return IConchUser, u, lambda: None
def __init__(self, username, meta): ConchUser.__init__(self) self.username = username self.channelLookup.update({"session": SSHSession}) self.meta = meta
def __init__(self): ConchUser.__init__(self) self.channelLookup.update({'session': SSHSession})
def requestAvatar(self, avatarId, mind, *interfaces): user = ConchUser() user.channelLookup['session'] = SimpleSession return IConchUser, user, nothing
def __init__(self, username): ConchUser.__init__(self) self.username = username self.channelLookup.update({"session": GitProcessProtocolSession})
def __init__(self, root=None): ConchUser.__init__(self) self.channelLookup["session"] = ShelllessSession
def __init__(self, key): ConchUser.__init__(self) # django, authentication model instance for logged in avatar self.user = key.user self.project = key.project self.channelLookup['session'] = GatewaySession
def __init__(self): ConchUser.__init__(self) self.channelLookup.update({ 'session': SSHSession })
def __init__(self): ConchUser.__init__(self) self.channelLookup['session'] = SSHSession
def __init__(self): ConchUser.__init__(self) self.channelLookup[b'session'] = session.SSHSession self.subsystemLookup[b'sftp'] = filetransfer.FileTransferServer
def __init__(self, avatarId): ConchUser.__init__(self) self.avatarId = avatarId self.channelLookup['session'] = session.SSHSession
def __init__(self, username, datapath): ConchUser.__init__(self) self.username = username self.datapath = datapath self.channelLookup["session"] = SSHSession
def requestAvatar(self, avatarId, mind, *interfaces): avatar = ConchUser() avatar.channelLookup = self.channelLookup return (IConchUser, avatar, lambda: None)
def __init__(self, original, username): components.Adapter.__init__(self, original) ConchUser.__init__(self) self.username = username self.channelLookup.update({'session': FixedSSHSession}) self.subsystemLookup.update({'sftp': FileTransferServer})
def __init__(self, settings, username, api_key): ConchUser.__init__(self) self.settings = settings self.username = username self.api_key = api_key self.channelLookup['session'] = SSHSession
def __init__(self, username): ConchUser.__init__(self) self.username = username
def __init__(self, avatarId): ConchUser.__init__(self) self.email, self.pydas, self.url = avatarId self.channelLookup['session'] = SSHSession self.subsystemLookup.update( {'sftp': MidasFileTransferServer})
def requestAvatar(avatar_id, mind, *interfaces): user = ConchUser() user.channelLookup['session'] = SimpleSession return IConchUser, user, lambda: None
def __init__(self, username): ConchUser.__init__(self) self.channelLookup.update({'session': session.SSHSession}) self.username = username self.listeners = {}