コード例 #1
0
 def isExpired(self):
     print "Current Datetime: %s, %s" % (current_datetime(), current_datetime().tzinfo)
     print "Expires: %s, %s" % (self.expires, self.expires.tzinfo)
     if current_datetime() >= self.expires:
         logger.info("Expired token: %s, Current: %s" % (self.expires, current_datetime()))
         return True
     return False
コード例 #2
0
 def baIsExpired(self):
     """ Checks if AuthToken has expired based on overlap conditions for basic auth """
     if self.expires <= current_datetime() + datetime.timedelta(hours=1):
         logger.warn("Expires between now and +1hr: %s, Current: %s" % (self.expireDate, current_datetime()))
         return True
     return False