def __init__(self, loggly_token: str, fqdn=False, localname=None, facility=None, cookies=None): super().__init__() self.fqdn = fqdn self.localname = localname self.facility = facility self.cookies = cookies or {} self.url = "https://logs-01.loggly.com/inputs/{token}/tag/{tag}".format( token=utils.deobfuscate(loggly_token), tag='lbrynet-' + __version__ )
def __init__(self, loggly_token: str, config: 'Config'): super().__init__() self.cookies = {} self.url = "https://logs-01.loggly.com/inputs/{token}/tag/{tag}".format( token=utils.deobfuscate(loggly_token), tag='lbrynet-' + __version__) self._loop = asyncio.get_event_loop() self._session = aiohttp.ClientSession() self._config = config
def __init__(self, conf: Config, installation_id: str, session_id: str): self.conf = conf self.cookies = {} self.url = ANALYTICS_ENDPOINT self._write_key = utils.deobfuscate(ANALYTICS_TOKEN) self._tracked_data = collections.defaultdict(list) self.context = _make_context(system_info.get_platform()) self.installation_id = installation_id self.session_id = session_id self.task: typing.Optional[asyncio.Task] = None self.external_ip: typing.Optional[str] = None
def test_can_use_unicode(self): plain = '☃' obf = utils.obfuscate(plain.encode()) self.assertEqual(plain, utils.deobfuscate(obf))
def test_deobfuscation_reverses_obfuscation(self): plain = "my_test_string" obf = utils.obfuscate(plain.encode()) self.assertEqual(plain, utils.deobfuscate(obf))