Ejemplo n.º 1
0
def getShellFactory(interpreterType, **namespace):
    sshPortal = portalFactory(interpreterType, namespace)
    factory = manhole_ssh.ConchFactory(sshPortal)
    factory.privateKeys = {'ssh-rsa': util.getPrivKey()}
    factory.publicKeys = {'ssh-rsa': util.getPubKey()}
    factory.portal.registerChecker(cred.PublicKeyDatabase())
    return factory
Ejemplo n.º 2
0
def getShellFactory(interpreterType, **namespace):
    realm = ShellTerminalRealm(namespace, CommandAPI)
    sshPortal = portal.Portal(realm)
    factory = manhole_ssh.ConchFactory(sshPortal)
    factory.privateKeys = {'ssh-rsa': carapace_util.getPrivKey()}
    factory.publicKeys = {'ssh-rsa': carapace_util.getPubKey()}
    factory.portal.registerChecker(SSHPublicKeyDatabase())
    return factory
Ejemplo n.º 3
0
def getShellFactory(game, **namespace):
    realm = servershell.TerminalRealm(game, namespace)
    sshPortal = portal.Portal(realm)
    factory = manhole_ssh.ConchFactory(sshPortal)
    factory.privateKeys = {'ssh-rsa': util.getPrivKey()}
    factory.publicKeys = {'ssh-rsa': util.getPubKey()}
    factory.portal.registerChecker(SSHPublicKeyDatabase())
    return factory
Ejemplo n.º 4
0
def getHyShellFactory(**namespace):
    """
    The "namespace" kwargs here contains the passed objects that will be
    accessible via the shell, namely:
     * "app"
     * "services"

    These two are passed in the call to hydeyhole.app.service.makeService.
    """
    sshRealm = hyshell.HyTerminalRealm(namespace)
    sshPortal = portal.Portal(sshRealm)
    factory = manhole_ssh.ConchFactory(sshPortal)
    factory.privateKeys = {'ssh-rsa': util.getPrivKey()}
    factory.publicKeys = {'ssh-rsa': util.getPubKey()}
    factory.portal.registerChecker(cred.PublicKeyDatabase())
    return factory
Ejemplo n.º 5
0
def getGameShellFactory(gameFile=None, **namespace):
    """
    The "namespace" kwargs here contains the passed objects that will be
    accessible via the shell, namely:
     * "app"
     * "services"

    These two are passed in the call to peloid.app.service.makeService.
    """
    # XXX can we determine level of permission a user will have at this point?
    # XXX if so, we need to only use shell mode for those with system-level
    # perms, and hall of halls for everyone else... except anonymous users: they
    # can get dumped into hall of observing...
    gameInstance = game.SingleUserGame(gameFile)
    gameInstance.setMode(const.modes.shell)
    sshRealm = gameshell.TerminalRealm(namespace, gameInstance)
    sshPortal = auth.SSHPortal(sshRealm)
    factory = gameshell.GameShellFactory(sshPortal)
    factory.privateKeys = {'ssh-rsa': util.getPrivKey()}
    factory.publicKeys = {'ssh-rsa': util.getPubKey()}
    factory.portal.registerChecker(auth.SSHPublicKeyDatabase())
    return factory