def bearer_token_handler(token): try: identity = from_bearer_token(token) except Exception: login_failure_count.inc() logger.error("Failed to validate bearer token value", exc_info=True) abort(401, "Failed to validate bearer token value") return {"uid": identity}
def bearer_token_handler(token): try: identity = from_bearer_token(token) validate(identity) except Exception as e: login_failure_count.inc() logger.debug("Failed to validate bearer token value", exc_info=True) return None return {"uid": identity}
def test_validation_with_invalid_identity(self): identity = from_bearer_token("InvalidPassword") with self.assertRaises(ValueError): validate(identity)
def _build_id(self): identity = from_bearer_token(self.shared_secret) return identity