Esempio n. 1
0
    def test_get1(self):
        sredis = StorageRedis()
        pubkey = 'AAAAB3NzaC1yc2EAAAABIwAAAGEArzJx8OYOnJmzf4tfBEvLi8DVPrJ3/c9k2I/Az64fxjHf9imyRJbixtQhlH9lfNjUIx+4LmrJH5QNRsFporcHDKOTwTTYLh5KmRpslkYHRivcJSkbh/C+BR3utDS555mV'
        username = sredis.get_username(pubkey)
        self.assertEqual(username, "rauburtin")

        userinfo = sredis.get_userinfo(username)
        self.assertDictEqual(userinfo, {'remote': 'localhost', 'port': '22'})
Esempio n. 2
0
    def test_get1(self):
        sredis = StorageRedis()
        pubkey = "AAAAB3NzaC1yc2EAAAABIwAAAGEArzJx8OYOnJmzf4tfBEvLi8DVPrJ3/c9k2I/Az64fxjHf9imyRJbixtQhlH9lfNjUIx+4LmrJH5QNRsFporcHDKOTwTTYLh5KmRpslkYHRivcJSkbh/C+BR3utDS555mV"
        username = sredis.get_username(pubkey)
        self.assertEqual(username, "rauburtin")

        userinfo = sredis.get_userinfo(username)
        self.assertDictEqual(userinfo, {"remote": "localhost", "port": "22"})
Esempio n. 3
0
    def __init__(self, username):
        avatar.ConchUser.__init__(self)
        self.username = username
        self.otherGroups = []

        self.channelLookup.update({'session':session.SSHSession})
        self.subsystemLookup['sftp'] = filetransfer.FileTransferServer
        #here we can create the client
        #need to pass the remote ssh server ip and port
        log.msg("Start SFTPServerProxyClient", logLevel=logging.DEBUG)
        sredis = StorageRedis()
        self.userinfo = sredis.get_userinfo(username)

        log.msg("userinfo from redis",self.userinfo, logLevel=logging.DEBUG)

        self.proxyclient = SFTPServerProxyClient(
                remote=self.userinfo['remote'],
                port=int(self.userinfo['port']),
                user=self.userinfo['user'])
Esempio n. 4
0
    def __init__(self, username):
        avatar.ConchUser.__init__(self)
        self.username = username
        self.otherGroups = []

        self.channelLookup.update({'session': session.SSHSession})
        self.subsystemLookup['sftp'] = filetransfer.FileTransferServer
        #here we can create the client
        #need to pass the remote ssh server ip and port
        log.msg("Start SFTPServerProxyClient", logLevel=logging.DEBUG)
        sredis = StorageRedis()
        self.userinfo = sredis.get_userinfo(username)

        log.msg("userinfo from redis", self.userinfo, logLevel=logging.DEBUG)

        self.proxyclient = SFTPServerProxyClient(
            remote=self.userinfo['remote'],
            port=int(self.userinfo['port']),
            user=self.userinfo['user'])