def check_authentication(self, response_dict):
if isinstance(response_dict, dict) and ('auth_ticket' in response_dict) and \
('expire_timestamp_ms' in response_dict['auth_ticket']) and \
(self._auth_provider.is_new_ticket(response_dict['auth_ticket']['expire_timestamp_ms'])):
had_ticket = self._auth_provider.has_ticket()
auth_ticket = response_dict['auth_ticket']
self._auth_provider.set_ticket(
[auth_ticket['expire_timestamp_ms'], base64.standard_b64decode(auth_ticket['start']), base64.standard_b64decode(auth_ticket['end'])])
now_ms = get_time(ms=True)
h, m, s = get_format_time_diff(now_ms, auth_ticket['expire_timestamp_ms'], True)
if had_ticket:
self.log.debug('Replacing old Session Ticket with new one valid for %02d:%02d:%02d hours (%s < %s)', h, m, s, now_ms, auth_ticket['expire_timestamp_ms'])
else:
self.log.debug('Received Session Ticket valid for %02d:%02d:%02d hours (%s < %s)', h, m, s, now_ms, auth_ticket['expire_timestamp_ms'])
评论列表
文章目录