def makeService(config): port, user, password = config['port'], config['user'], config['password'] p = portal.Portal( service.Realm( service.Service(config["tracebacks"], config.get('namespace'))), [checkers.InMemoryUsernamePasswordDatabaseDontUse(**{user: password})]) return strports.service(port, pb.PBServerFactory(p, config["tracebacks"]))
def getPorts(app, config): svc = service.Service(application=app) p = svc.createPerspective(config.user) p.makeIdentity(config.password) try: portno = config.portno except AttributeError: portno = pb.portno return [(portno, pb.BrokerFactory(pb.AuthRoot(app)))]
def setUp(self): self.service = service.Service() self.p = service.Perspective(self.service) self.client = DummyManholeClient() self.p.attached(self.client, None)
def setUp(self): self.service = service.Service(application=DummyApp()) self.p = service.Perspective("UnitTest") self.p.setService(self.service) self.client = DummyManholeClient() self.p.attached(self.client, None)