• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python avatar.ConchUser类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中twisted.conch.avatar.ConchUser的典型用法代码示例。如果您正苦于以下问题:Python ConchUser类的具体用法?Python ConchUser怎么用?Python ConchUser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ConchUser类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

 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})
开发者ID:cwaldbieser,项目名称:txsshadmin,代码行数:8,代码来源:cred_base.py


示例2: requestAvatar

 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.")
开发者ID:nahommarie,项目名称:UrbanFlows,代码行数:9,代码来源:sshserver3.py


示例3: __init__

    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})
开发者ID:Almad,项目名称:twisted,代码行数:10,代码来源:sftp.py


示例4: requestAvatar

    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
开发者ID:ekohl,项目名称:vncauthproxy,代码行数:10,代码来源:ssh.py


示例5: __init__

    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
开发者ID:exarkun,项目名称:Pantheon-SSH,代码行数:11,代码来源:realm.py


示例6: __init__

 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'
开发者ID:PushAMP,项目名称:vcsserver,代码行数:13,代码来源:vcssshd.py


示例7: requestAvatar

    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
开发者ID:bollustrado,项目名称:twisted_conch_pytexas_12,代码行数:35,代码来源:server.py


示例8: __init__

    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})
开发者ID:BarnetteME1,项目名称:indeed_scraper,代码行数:16,代码来源:unix.py


示例9: __init__

 def __init__(self, username, meta):
     ConchUser.__init__(self)
     self.username = username
     self.channelLookup.update({"session": SSHSession})
     self.meta = meta
开发者ID:twistor,项目名称:Drupal.org-Git-Daemons,代码行数:5,代码来源:drupalGitSSHDaemon.py


示例10: requestAvatar

 def requestAvatar(self, avatarId, mind, *interfaces):
     user = ConchUser()
     user.channelLookup['session'] = SimpleSession
     return IConchUser, user, nothing
开发者ID:mizzy,项目名称:twisted-conch-example,代码行数:4,代码来源:ssh-server.py


示例11: __init__

 def __init__(self, username):
     ConchUser.__init__(self)
     self.username = username
     self.channelLookup.update({"session": GitProcessProtocolSession})
开发者ID:stephrdev,项目名称:brigitte,代码行数:4,代码来源:server.py


示例12: __init__

 def __init__(self, username):
     ConchUser.__init__(self)
     self.username = username
开发者ID:hagna,项目名称:forthbot,代码行数:3,代码来源:sftp.py


示例13: __init__

 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
开发者ID:emil2k,项目名称:joltem,代码行数:6,代码来源:auth.py


示例14: __init__

 def __init__(self, username):
     ConchUser.__init__(self)
     self.channelLookup.update({'session': session.SSHSession})
     self.username = username
     self.listeners = {}
开发者ID:saghul,项目名称:TunnelIt,代码行数:5,代码来源:server.py


示例15: __init__

 def __init__(self, avatarId):
     ConchUser.__init__(self)
     self.avatarId = avatarId
     self.channelLookup['session'] = session.SSHSession
开发者ID:zielmicha,项目名称:gitjoin,代码行数:4,代码来源:sshd.py


示例16: __init__

 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
开发者ID:hadoukn,项目名称:hadoukn-git-server,代码行数:6,代码来源:user.py


示例17: __init__

 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})
开发者ID:UfSoft,项目名称:SSHg,代码行数:6,代码来源:avatars.py


示例18: __init__

 def __init__(self, root=None):
     ConchUser.__init__(self)
     self.channelLookup["session"] = ShelllessSession
开发者ID:cyli,项目名称:ess,代码行数:3,代码来源:shelless.py


示例19: __init__

 def __init__(self):
     ConchUser.__init__(self)
     self.channelLookup.update({ 'session': SSHSession })
开发者ID:h4v1nfun,项目名称:painload,代码行数:3,代码来源:test-server.py


示例20: __init__

 def __init__(self):
     ConchUser.__init__(self)
     self.channelLookup['session'] = SSHSession
开发者ID:Architektor,项目名称:PySnip,代码行数:3,代码来源:test_conch.py



注:本文中的twisted.conch.avatar.ConchUser类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python knownhosts.KnownHostsFile类代码示例发布时间:2022-05-27
下一篇:
Python strports.service函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap