def test_wrapResourceWeb(self): if not getTwistedWeb(): raise SkipTest("This test requires both twisted.web.") from twisted.web.resource import IResource, Resource root = Resource() wrapped = wrapResource(root, [self.checker]) self.assertTrue(IResource.providedBy(wrapped))
def run_reactor(): main = CoreServices() observer = log.PythonLoggingObserver() observer.start() if CREDENTIALS: checker = BasicCredChecker(CREDENTIALS) main = wrapResource(main, [checker], realmName=CORE_ID) reactor.listenTCP(CORE_PORT, server.Site(resource=main)) reactor.suggestThreadPoolSize(pool) reactor.run(installSignalHandlers=False)
def set_auth(self, resource): passwordfile = ARMORYD_CONF_FILE checker = FilePasswordDB(passwordfile) realmName = "Armory JSON-RPC App" wrapper = wrapResource(resource, [checker], realmName=realmName) return wrapper
def test_wrapResourceWeb(self): from twisted.web.resource import IResource, Resource root = Resource() wrapped = wrapResource(root, [self.checker]) self.assertTrue(IResource.providedBy(wrapped))
def set_auth(self, resource): passwordfile = "credentials.txt" # TODO change to bitcoin credentials checker = FilePasswordDB(passwordfile) realmName = "Armory JSON-RPC App" wrapper = wrapResource(resource, [checker], realmName=realmName) return wrapper