Verify & return data
339228
def setup_data(self, data, params):
        
        check_required_aesthetics(
            self.REQUIRED_AES,
            data.columns,
            self.__class__.__name__)
        return data
1175710
function getUserData(data, checks) {
  if (Array.isArray(data) ? data.length === 0 : data.total === 0) {
    throw new errors.BadRequest('User not found.', { errors: { $className: 'badParams' } });
  }
  
  const users = Array.isArray(data) ? data : data.data;
  const user = users[0];
  
  if (users.length !== 1) {
    throw new errors.BadRequest('More than 1 user selected.',
      { errors: { $className: 'badParams' } });
  }

  if (checks.indexOf('isNotVerified') !== -1 && user.isVerified) {
    throw new errors.BadRequest('User is already verified.',
      { errors: { $className: 'isNotVerified' } });
  }

  if (checks.indexOf('isVerified') !== -1 && !user.isVerified) {
    throw new errors.BadRequest('User is not verified.',
      { errors: { $className: 'isVerified' } });
  }
  
  if (checks.indexOf('verifyNotExpired') !== -1 && user.verifyExpires < Date.now()) {
    throw new errors.BadRequest('Verification token has expired.',
      { errors: { $className: 'verifyExpired' } });
  }

  if (checks.indexOf('resetNotExpired') !== -1 && user.resetExpires < Date.now()) {
    throw new errors.BadRequest('Password reset token has expired.',
      { errors: { $className: 'resetExpired' } });
  }

  return user;
}
578098
def verify(self, id):
        
        url = self._url('%s/verify' % (id))
        return self.client.post(url)
191963
def verify(ctx):
    """"""
    oks = run_configurations(
        skipper(verify_environments),
        read_sections,
    )
    ctx.exit(0
             if False not in oks
             else 1)
406489
def do(self, params):
        """"""
        request_params = self.create_basic_params()
        request_params.update(params)
        response_data = self.request(request_params)
        try:
            format_json_data = self.format_response_data(response_data)
        # pylint: disable=broad-except
        except Exception:
            # Caused by server force logged out
            return None
        return_data = self.fix_error_data(format_json_data)
        try:
            self.check_login_status(return_data)
        except exceptions.NotLoginError:
            self.autologin()
        return return_data
323501
def receive_verify_post(self, post_params):
        
        if isinstance(post_params,  dict):
            required_params = ['action', 'email', 'send_id', 'sig']
            if not self.check_for_valid_postback_actions(required_params, post_params):
                return False
        else:
            return False

        if post_params['action'] != 'verify':
            return False

        sig = post_params['sig']
        post_params = post_params.copy()
        del post_params['sig']

        if sig != get_signature_hash(post_params, self.secret):
            return False

        send_response = self.get_send(post_params['send_id'])

        try:
            send_body = send_response.get_body()
            send_json = json.loads(send_body)
            if 'email' not in send_body:
                return False
            if send_json['email'] != post_params['email']:
                return False
        except ValueError:
            return False

        return True
728208
def verify(self, connection_type=None):
        
        req_body = self._cli.make_body(connectionType=connection_type)

        resp = self.action('verify', **req_body)
        resp.raise_if_err()
        return resp
639388
def verify(self):
        
        # if we are in a lock don't check anything
        if self._lock != 0:
            return

        # check the hash of our data
        id_new = self._id_function()

        # things changed
        if id_new != self.id_current:
            if len(self.cache) > 0:
                log.debug('%d items cleared from cache: %s',
                          len(self.cache),
                          str(list(self.cache.keys())))
            # hash changed, so dump the cache
            # do it manually rather than calling clear()
            # as we are internal logic and can avoid function calls
            self.cache = {}
            # set the id to the new data hash
            self.id_current = id_new
1241401
def check_data(self, data):
        
        data_objs = {
            data_src: data.objects.get(data_src) for data_src in data.layer
        }
        self._is_data_loaded = all(data_objs.values())
        return data_objs
49291
def response(response)
  		raw_response = CGI::parse(decrypt_data(response,@working_Key,"AES-128-CBC"))

  		auth_desc = raw_response["AuthDesc"][0]
  		order_id = raw_response["Order_Id"][0]
  		amount = raw_response["Amount"][0]
  		checksum = raw_response["Checksum"][0]

  		verification = verifyChecksum(order_id,amount,auth_desc,checksum)
  		return auth_desc,verification,raw_response
  	end
37596
def _checkReturnTo(self, message, return_to):
        
        # Check the openid.return_to args against args in the original
        # message.
        try:
            self._verifyReturnToArgs(message.toPostArgs())
        except ProtocolError as why:
            logging.exception("Verifying return_to arguments: %s" % (why, ))
            return False

        # Check the return_to base URL against the one in the message.
        msg_return_to = message.getArg(OPENID_NS, 'return_to')

        # The URL scheme, authority, and path MUST be the same between
        # the two URLs.
        app_parts = urlparse(urinorm.urinorm(return_to))
        msg_parts = urlparse(urinorm.urinorm(msg_return_to))

        # (addressing scheme, network location, path) must be equal in
        # both URLs.
        for part in range(0, 3):
            if app_parts[part] != msg_parts[part]:
                return False

        return True
335993
def receive_verify_post(params, request)
      if request.post?
        [:action, :email, :send_id, :sig].each { |key| return false unless params.has_key?(key) }

        return false unless params[:action] == :verify

        sig = params.delete(:sig)
        params.delete(:controller)
        return false unless sig == get_signature_hash(params, @secret)

        _send = get_send(params[:send_id])
        return false unless _send.has_key?('email')

        return false unless _send['email'] == params[:email]

        return true
      else
        return false
      end
    end
405953
def get_result(self, client, check):
        
        data = self._request('GET', '/results/{}/{}'.format(client, check))
        return data.json()
556398
def verify(self):
		
		logging.debug("\n\n")
		logging.debug("[+] -- Verify debugging")
		logging.debug("\n\n")

		if self.request.body:
			logging.debug("\n Request body")
			logging.debug(self.request.body)
			data = json.loads(self.request.body)
			message = json.dumps(data.get("message")).replace(" ", "")
			logging.debug("\n")
			logging.debug(message)

		elif self.request.arguments:
			logging.debug("\n Arguments")
			logging.debug(self.request.arguments)
			data = {i:self.get_argument(i) for i in self.request.arguments}
			message = data.get("message", "{}")
			logging.debug(message)

		try:
			# Check if required fields exist
			assert "public_key" in data.keys(), "Missed public key in parameters"
			assert "message" in data.keys(), "Missed message in parameters"
			assert "signature" in data.keys(),"Missed signature in parameters"
			public_key = data["public_key"]
			signature = data["signature"]
			timestamp = data.get("timestamp", None)
			
			# Check if
			#assert ManagementSystemHandler.get_time_stamp() == timestamp, "Timestamps does not match. Try again."

		except Exception as e:
			self.set_status(403)
			self.write({"error":403, "reason": "Missing signature " + str(e)})
			raise tornado.web.Finish

		else:
			# Check if message and signature exist
			# If not - return 403 error code
			if not all([message, public_key, signature]):
				raise tornado.web.HTTPError(403)
		# If exist - call verifying static method
		try:
			logging.debug("\n[] Try block. Verifying")
			logging.debug(message)
			logging.debug(signature)
			logging.debug(public_key)
			flag = Qtum.verify_message(message, signature, public_key)
		except Exception as e:
			# If public key is not valid or it`s missing - return 404 error
			#self.set_status(403)
			#self.write({"error":403, 
			#			"reason":"Forbidden. Invalid signature." + str(e)})
			#raise tornado.web.Finish
			logging.debug("\n Exception")
			logging.debug(str(e))
			pass
140449
def verify_hash(self, hashed_data, compare_data):
        
        return self.security.hashing_context.verify(
            encode_string(compare_data), hashed_data)
679168
def validate(self, data):
        
        for v in self.validators:
            v(self, data)
        return data
564193
def extract_payload(self, request, verify=True, *args, **kwargs):
        
        payload = self._verify(
            request, return_payload=True, verify=verify, *args, **kwargs
        )
        return payload