@param string $clientIp

@throws InvalidClientIpException
430095
public function authenticateClientIp($clientIp)
    {
        if (false === IpUtils::checkIp($clientIp, self::$xsollaSubnets)) {
            throw new InvalidClientIpException(sprintf(
                'Client IP address (%s) not found in allowed IP addresses whitelist (%s). Please check troubleshooting section in README.md https://github.com/xsolla/xsolla-sdk-php#troubleshooting',
                $clientIp,
                implode(', ', self::$xsollaSubnets)
            ));
        }
    }
46010
public function setClientIp($value)
    {
        if ($value === null || $value === '') {
            $this->_clientIp = null;
        } elseif (TypeCast::canCastToString($value)) {
            $this->_clientIp = (string)$value;
        } else {
            throw new InvalidPropertyValueTypeException(
                'Invalid clientIp value type in CreatePaymentRequest', 0, 'CreatePaymentRequest.clientIp', $value
            );
        }
    }
1046824
public function validateRequest(RequestInterface $request, ResponseInterface $response)
    {
        if (!$clientData = $this->getClientCredentials($request, $response)) {
            return false;
        }

        if (!isset($clientData['client_id'])) {
            throw new LogicException('the clientData array must have "client_id" set');
        }

        if (!isset($clientData['client_secret']) || $clientData['client_secret'] == '') {
            if (!$this->config['allow_public_clients']) {
                $response->setError(400, 'invalid_client', 'client credentials are required');

                return false;
            }

            if (!$this->storage->isPublicClient($clientData['client_id'])) {
                $response->setError(400, 'invalid_client', 'This client is invalid or must authenticate using a client secret');

                return false;
            }
        } elseif ($this->storage->checkClientCredentials($clientData['client_id'], $clientData['client_secret']) === false) {
            $response->setError(400, 'invalid_client', 'The client credentials are invalid');

            return false;
        }

        $this->clientData = $clientData;

        return true;
    }
434008
public function BD_CheckBotIP($UserIP = false)
    {
        // Check if IP present
        if ($UserIP === false)
        {
            if (strpos(\Environment::get('ip'), ',') !== false) //first IP
            {
				$UserIP = trim(substr(\Environment::get('ip'), 0, strpos(\Environment::get('ip'), ',')));
            }
            else
            {
				$UserIP = trim(\Environment::get('ip'));
            }
        }
        \BugBuster\BotDetection\CheckBotIp::setBotIpv4List(TL_ROOT . self::BOT_IP4_LIST);
        \BugBuster\BotDetection\CheckBotIp::setBotIpv6List(TL_ROOT . self::BOT_IP6_LIST);
        return \BugBuster\BotDetection\CheckBotIp::checkIP( $UserIP );
    }
495645
public synchronized void setHttpServerIp( final String serverIp ) {
		this.httpServerIp = serverIp;
		this.dmClient.setHttpServerIp( serverIp );
		this.logger.finer( "Server IP set to " + this.httpServerIp );
	}
381096
public static function getClientIp(ServerRequestInterface $request, string $ipAttribute = null): string
    {
        if (!empty($ipAttribute)) {
            return self::getAttribute($request, $ipAttribute);
        }

        return self::getLocalIp($request);
    }
191933
public function checkClientCredentials($client_id, $client_secret = null)
	{
		$client = $this->repo->find($client_id);

		if(!$client) {
			return false;
		}

		return $client_secret == $client->getSecret();
	}
1133921
private void removeClientId(String clientId) {
        //Sometimes the client Id will be null. For instance in the case QueueConnectionFactory, there is no default client Id specified in metatype.xml. 
        if (clientId == null)
            return; //do nothing

        ConcurrentHashMap<String, Integer> clientIdTable = JmsFactoryFactoryImpl.getClientIdTable();

        if (clientIdTable.containsKey(clientId)) {
            int referenceCount = clientIdTable.get(clientId).intValue();
            if (referenceCount == 1) {
                clientIdTable.remove(clientId);
            } else {
                clientIdTable.put(clientId, clientIdTable.get(clientId).intValue() - 1);
            }
        }
    }
149702
@Override
	public final void setClientID(String clientID) throws JMSException
    {
        super.setClientID(clientID);
        
        SetClientIDQuery query = new SetClientIDQuery();
        query.setClientID(clientID);
        transportEndpoint.blockingRequest(query);
    }
665589
protected function execute(InputInterface $input, OutputInterface $output): void
    {
        $restUrl = $input->getArgument('rest-url');

        /** @var TenantInterface $tenant */
        if ($input->getOption('tenant-id')) {
            $tenant = $this->em->getRepository($this->tenantClass)->find($input->getOption('tenant-id'));
        } elseif ($input->getOption('client-key')) {
            /** @noinspection PhpUndefinedMethodInspection */
            $tenant = $this->em->getRepository($this->tenantClass)->findOneByClientKey($input->getOption('client-key'));
        } else {
            throw new \RuntimeException('Please provide client-key or tenant-id');
        }

        $request = new AtlassianRestClient($tenant);
        $json = $request->get($restUrl);

        $output->writeln('');
        echo \json_encode($json, \JSON_PRETTY_PRINT);
        $output->writeln('');
    }
234143
public static function checkIp($requestIp, $ips) {

        $method = substr_count($requestIp, ':') > 1 ? 'checkIp6' : 'checkIp4';

        foreach ((array) $ips as $ip) {
            if (self::$method($requestIp, $ip)) {
                return TRUE;
            }
        }

        return FALSE;

    }
554255
@Override
    public void setClientID(String clientID) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setClientID", clientID);

        // Make empty and null look the same.
        if ("".equals(clientID))
            clientID = null;
        jcaManagedConnectionFactory.setClientID(clientID);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setClientID");
    }
298885
protected function createClient(
        string $apiKey,
        string $spaceId,
        string $environmentId,
        ClientOptions $clientOptions
    ): ClientInterface {
        return new Client($apiKey, $spaceId, $environmentId, $clientOptions);
    }
466630
public function checkPermission($ip, $context)
    {
        if (!is_string($ip)) {
            throw new \TypeError('The ip parameter must be a string.');
        }
        if (!$ip) {
            throw new \InvalidArgumentException('The ip parameter cannot be empty.');
        }

        $currentRequest = $this->requestStack->getCurrentRequest();

        if (!$currentRequest) {
            return false;
        }

        return IpUtils::checkIp($currentRequest->getClientIp(), $ip);
    }
763955
public function handle(Client $client, $index, $alias)
    {
        $settings = $this->configurations->getSettings($alias);

        if (null === $settings) {
            throw new \InvalidArgumentException();
        }

        $client->getIndex($index)->setSettings($settings);
    }
979759
public function handle(Client $client, $index, $alias)
    {
        $config = $this->configurations->get($alias);

        if (null === $config) {
            throw new \InvalidArgumentException();
        }

        $client->getIndex($index)->create($config);
    }
67667
public static function init(Client $client, &$request)
    {
        // Verification for required parameters
        $config = $client->getConfig();
        if (empty($config['public_key']) || empty($config['private_key'])) {
            throw new InvalidKeysHmacException('Both, public and private key are required for hmac authentication');
        }

        // Data to process
        switch ($request->getMethod()) {
            case 'POST':
                $data = count($request->getBody()->getFields()) ? json_encode($request->getBody()->getFields()) : null;
                break;
            case 'GET' :
                $data = count($request->getQuery()) ? json_encode((string)$request->getQuery()) : null;
                break;
            case 'PUT' :
                $data = $request->getBody()->getContents();
                break;
            case 'DELETE':
                $data = $request->getQuery();
                break;
        }

        // Setting the credentials
        $request->setHeaders([
            'X-PUBLIC-KEY' => $config['public_key'],
            'X-SIGNATURE' => base64_encode(hash_hmac('sha256', $data, $config['private_key'])),
            'X-NONCE' => time(),
        ]);
    }