def validate_token(token_string):
 token = Token.get(token_string)
 if (token.expiry <= date_utils.get_datetime_utc_now()):
  LOG.audit(('Token with id "%s" has expired.' % token.id))
  raise exceptions.TokenExpiredError('Token has expired.')
 LOG.audit(('Token with id "%s" is validated.' % token.id))
 return token

def validate_token ( token_string ) : token = Token . get ( token_string ) if ( token . expiry <= date_utils . get_datetime_utc_now ( ) ) : LOG . audit ( ( 'Token with id "%s" has expired.' % token . id ) ) raise exceptions . TokenExpiredError ( 'Token has expired.' ) LOG . audit ( ( 'Token with id "%s" is validated.' % token . id ) ) return token
validate the provided authentication token .