aboutsummaryrefslogtreecommitdiff
path: root/srcs/phpmyadmin/vendor/google/recaptcha
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-07-27 10:05:23 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-07-27 10:05:23 +0200
commit5bf66662a9bdd62c5bccab15e607cd95cfb8fcab (patch)
tree39a1a4629749056191c05dfd899f931701b7acf3 /srcs/phpmyadmin/vendor/google/recaptcha
parent5afd237bbd22028b85532b8c0b3fcead49a00764 (diff)
downloadft_server-5bf66662a9bdd62c5bccab15e607cd95cfb8fcab.tar.gz
ft_server-5bf66662a9bdd62c5bccab15e607cd95cfb8fcab.tar.bz2
ft_server-5bf66662a9bdd62c5bccab15e607cd95cfb8fcab.zip
Removed wordpress and phpmyadmin, my server doesn't handle it well and it brings shame on my famillyHEADmaster
Diffstat (limited to 'srcs/phpmyadmin/vendor/google/recaptcha')
-rw-r--r--srcs/phpmyadmin/vendor/google/recaptcha/.github/ISSUE_TEMPLATE/bug_report.md28
-rw-r--r--srcs/phpmyadmin/vendor/google/recaptcha/.travis.yml33
-rw-r--r--srcs/phpmyadmin/vendor/google/recaptcha/ARCHITECTURE.md64
-rw-r--r--srcs/phpmyadmin/vendor/google/recaptcha/CONTRIBUTING.md49
-rw-r--r--srcs/phpmyadmin/vendor/google/recaptcha/LICENSE29
-rw-r--r--srcs/phpmyadmin/vendor/google/recaptcha/README.md140
-rw-r--r--srcs/phpmyadmin/vendor/google/recaptcha/app.yaml8
-rw-r--r--srcs/phpmyadmin/vendor/google/recaptcha/composer.json39
-rw-r--r--srcs/phpmyadmin/vendor/google/recaptcha/phpunit.xml.dist20
-rw-r--r--srcs/phpmyadmin/vendor/google/recaptcha/src/ReCaptcha/ReCaptcha.php269
-rw-r--r--srcs/phpmyadmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod.php50
-rw-r--r--srcs/phpmyadmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Curl.php82
-rw-r--r--srcs/phpmyadmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/CurlPost.php104
-rw-r--r--srcs/phpmyadmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Post.php88
-rw-r--r--srcs/phpmyadmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Socket.php112
-rw-r--r--srcs/phpmyadmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/SocketPost.php108
-rw-r--r--srcs/phpmyadmin/vendor/google/recaptcha/src/ReCaptcha/RequestParameters.php111
-rw-r--r--srcs/phpmyadmin/vendor/google/recaptcha/src/ReCaptcha/Response.php218
-rw-r--r--srcs/phpmyadmin/vendor/google/recaptcha/src/autoload.php69
19 files changed, 0 insertions, 1621 deletions
diff --git a/srcs/phpmyadmin/vendor/google/recaptcha/.github/ISSUE_TEMPLATE/bug_report.md b/srcs/phpmyadmin/vendor/google/recaptcha/.github/ISSUE_TEMPLATE/bug_report.md
deleted file mode 100644
index a14dcfe..0000000
--- a/srcs/phpmyadmin/vendor/google/recaptcha/.github/ISSUE_TEMPLATE/bug_report.md
+++ /dev/null
@@ -1,28 +0,0 @@
----
-name: PHP client issue
-about: Report an issue with the PHP client library
-
----
-
-**Issue description**
-<!-- One or two sentences describing the problem -->
-
-**Environment**
-<!-- The server or development environment where you're seeing the problem -->
-
- * OS name and version:
- * PHP version:
- * Web server name and version:
- * `google/recaptcha` version:
- * Browser name and version:
-
-**Reproducing the issue**
-<!-- Where possible link to a URL where the problem can be seen or show code that causes it -->
-
- * URL (optional): <!-- if your integration is already deployed and the issue is visible -->
- * Code (optional): <!-- share a link to the code you're using or an example in a Gist -->
-
- ***User steps***
- <!-- Detail the necessary steps to reproduce the issue. Include the output of any error messages. -->
-
- 1. Visit page...
diff --git a/srcs/phpmyadmin/vendor/google/recaptcha/.travis.yml b/srcs/phpmyadmin/vendor/google/recaptcha/.travis.yml
deleted file mode 100644
index a625795..0000000
--- a/srcs/phpmyadmin/vendor/google/recaptcha/.travis.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-dist: trusty
-
-language: php
-
-sudo: false
-
-php:
- - '5.5'
- - '5.6'
- - '7.0'
- - '7.1'
- - '7.2'
- - '7.3'
-
-before_script:
- - composer install
- - phpenv version-name | grep ^5.[34] && echo "extension=apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini ; true
- - phpenv version-name | grep ^5.[34] && echo "apc.enable_cli=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini ; true
-
-script:
- - mkdir -p build/logs
- - composer run-script lint
- - composer run-script test
-
-after_success:
- - travis_retry php vendor/bin/php-coveralls
-
-cache:
- directories:
- - "$HOME/.composer/cache/files"
-
-git:
- depth: 5
diff --git a/srcs/phpmyadmin/vendor/google/recaptcha/ARCHITECTURE.md b/srcs/phpmyadmin/vendor/google/recaptcha/ARCHITECTURE.md
deleted file mode 100644
index 13add26..0000000
--- a/srcs/phpmyadmin/vendor/google/recaptcha/ARCHITECTURE.md
+++ /dev/null
@@ -1,64 +0,0 @@
-# Architecture
-
-The general pattern of usage is to instantiate the `ReCaptcha` class with your
-secret key, specify any additional validation rules, and then call `verify()`
-with the reCAPTCHA response and user's IP address. For example:
-
-```php
-<?php
-$recaptcha = new \ReCaptcha\ReCaptcha($secret);
-$resp = $recaptcha->setExpectedHostname('recaptcha-demo.appspot.com')
- ->verify($gRecaptchaResponse, $remoteIp);
-if ($resp->isSuccess()) {
- // Verified!
-} else {
- $errors = $resp->getErrorCodes();
-}
-```
-
-By default, this will use the
-[`stream_context_create()`](https://secure.php.net/stream_context_create) and
-[`file_get_contents()`](https://secure.php.net/file_get_contents) to make a POST
-request to the reCAPTCHA service. This is handled by the
-[`RequestMethod\Post`](./src/ReCaptcha/RequestMethod/Post.php) class.
-
-## Alternate request methods
-
-You may need to use other methods for making requests in your environment. The
-[`ReCaptcha`](./src/ReCaptcha/ReCaptcha.php) class allows an optional
-[`RequestMethod`](./src/ReCaptcha/RequestMethod.php) instance to configure this.
-For example, if you want to use [cURL](https://secure.php.net/curl) instead you
-can do this:
-
-```php
-<?php
-$recaptcha = new \ReCaptcha\ReCaptcha($secret, new \ReCaptcha\RequestMethod\CurlPost());
-```
-
-Alternatively, you can also use a [socket](https://secure.php.net/fsockopen):
-
-```php
-<?php
-$recaptcha = new \ReCaptcha\ReCaptcha($secret, new \ReCaptcha\RequestMethod\SocketPost());
-```
-
-## Adding new request methods
-
-Create a class that implements the
-[`RequestMethod`](./src/ReCaptcha/RequestMethod.php) interface. The convention
-is to name this class `RequestMethod\`_MethodType_`Post` and create a separate
-`RequestMethod\`_MethodType_ class that wraps just the calls to the network
-calls themselves. This means that the `RequestMethod\`_MethodType_`Post` can be
-unit tested by passing in a mock. Take a look at
-[`RequestMethod\CurlPost`](./src/ReCaptcha/RequestMethod/CurlPost.php) and
-[`RequestMethod\Curl`](./src/ReCaptcha/RequestMethod/Curl.php) with the matching
-[`RequestMethod/CurlPostTest`](./tests/ReCaptcha/RequestMethod/CurlPostTest.php)
-to see this pattern in action.
-
-### Error conventions
-
-The client returns the response as provided by the reCAPTCHA services augmented
-with additional error codes based on the client's checks. When adding a new
-[`RequestMethod`](./src/ReCaptcha/RequestMethod.php) ensure that it returns the
-`ReCaptcha::E_CONNECTION_FAILED` and `ReCaptcha::E_BAD_RESPONSE` where
-appropriate.
diff --git a/srcs/phpmyadmin/vendor/google/recaptcha/CONTRIBUTING.md b/srcs/phpmyadmin/vendor/google/recaptcha/CONTRIBUTING.md
deleted file mode 100644
index a236862..0000000
--- a/srcs/phpmyadmin/vendor/google/recaptcha/CONTRIBUTING.md
+++ /dev/null
@@ -1,49 +0,0 @@
-# Contributing
-
-Want to contribute? Great! First, read this page (including the small print at
-the end).
-
-## Contributor License Agreement
-
-Before we can use your code, you must sign the [Google Individual Contributor
-License
-Agreement](https://developers.google.com/open-source/cla/individual?csw=1)
-(CLA), which you can do online. The CLA is necessary mainly because you own the
-copyright to your changes, even after your contribution becomes part of our
-codebase, so we need your permission to use and distribute your code. We also
-need to be sure of various other things—for instance that you'll tell us if you
-know that your code infringes on other people's patents. You don't have to sign
-the CLA until after you've submitted your code for review (a link will be
-automatically added to your Pull Request) and a member has approved it, but you
-must do it before we can put your code into our codebase. Before you start
-working on a larger contribution, you should get in touch with us first through
-the issue tracker with your idea so that we can help out and possibly guide you.
-Coordinating up front makes it much easier to avoid frustration later on.
-
-## Linting and testing
-
-We use PHP Coding Standards Fixer to maintain coding standards and PHPUnit to
-run our tests. For convenience, there are Composer scripts to run each of these:
-
-```sh
-composer run-script lint
-composer run-script test
-```
-
-These are run automatically by [Travis
-CI](https://travis-ci.org/google/recaptcha) against your Pull Request, but it's
-a good idea to run them locally before submission to avoid getting things
-bounced back. That said, tests can be a little daunting so feel free to submit
-your PR and ask for help.
-
-## Code reviews
-
-All submissions, including submissions by project members, require review.
-Reviews are conducted on the Pull Requests. The reviews are there to ensure and
-improve code quality, so treat them like a discussion and opportunity to learn.
-Don't get disheartened if your Pull Request isn't just automatically approved.
-
-### The small print
-
-Contributions made by corporations are covered by a different agreement than the
-one above, the Software Grant and Corporate Contributor License Agreement.
diff --git a/srcs/phpmyadmin/vendor/google/recaptcha/LICENSE b/srcs/phpmyadmin/vendor/google/recaptcha/LICENSE
deleted file mode 100644
index d147b35..0000000
--- a/srcs/phpmyadmin/vendor/google/recaptcha/LICENSE
+++ /dev/null
@@ -1,29 +0,0 @@
-BSD 3-Clause License
-
-Copyright (c) 2019, Google Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
-3. Neither the name of the copyright holder nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/srcs/phpmyadmin/vendor/google/recaptcha/README.md b/srcs/phpmyadmin/vendor/google/recaptcha/README.md
deleted file mode 100644
index 4f056eb..0000000
--- a/srcs/phpmyadmin/vendor/google/recaptcha/README.md
+++ /dev/null
@@ -1,140 +0,0 @@
-# reCAPTCHA PHP client library
-
-[![Build Status](https://travis-ci.org/google/recaptcha.svg)](https://travis-ci.org/google/recaptcha)
-[![Coverage Status](https://coveralls.io/repos/github/google/recaptcha/badge.svg)](https://coveralls.io/github/google/recaptcha)
-[![Latest Stable Version](https://poser.pugx.org/google/recaptcha/v/stable.svg)](https://packagist.org/packages/google/recaptcha)
-[![Total Downloads](https://poser.pugx.org/google/recaptcha/downloads.svg)](https://packagist.org/packages/google/recaptcha)
-
-reCAPTCHA is a free CAPTCHA service that protects websites from spam and abuse.
-This is a PHP library that wraps up the server-side verification step required
-to process responses from the reCAPTCHA service. This client supports both v2
-and v3.
-
-- reCAPTCHA: https://www.google.com/recaptcha
-- This repo: https://github.com/google/recaptcha
-- Hosted demo: https://recaptcha-demo.appspot.com/
-- Version: 1.2.3
-- License: BSD, see [LICENSE](LICENSE)
-
-## Installation
-
-### Composer (recommended)
-
-Use [Composer](https://getcomposer.org) to install this library from Packagist:
-[`google/recaptcha`](https://packagist.org/packages/google/recaptcha)
-
-Run the following command from your project directory to add the dependency:
-
-```sh
-composer require google/recaptcha "^1.2"
-```
-
-Alternatively, add the dependency directly to your `composer.json` file:
-
-```json
-"require": {
- "google/recaptcha": "^1.2"
-}
-```
-
-### Direct download
-
-Download the [ZIP file](https://github.com/google/recaptcha/archive/master.zip)
-and extract into your project. An autoloader script is provided in
-`src/autoload.php` which you can require into your script. For example:
-
-```php
-require_once '/path/to/recaptcha/src/autoload.php';
-$recaptcha = new \ReCaptcha\ReCaptcha($secret);
-```
-
-The classes in the project are structured according to the
-[PSR-4](http://www.php-fig.org/psr/psr-4/) standard, so you can also use your
-own autoloader or require the needed files directly in your code.
-
-## Usage
-
-First obtain the appropriate keys for the type of reCAPTCHA you wish to
-integrate for v2 at https://www.google.com/recaptcha/admin or v3 at
-https://g.co/recaptcha/v3.
-
-Then follow the [integration guide on the developer
-site](https://developers.google.com/recaptcha/intro) to add the reCAPTCHA
-functionality into your frontend.
-
-This library comes in when you need to verify the user's response. On the PHP
-side you need the response from the reCAPTCHA service and secret key from your
-credentials. Instantiate the `ReCaptcha` class with your secret key, specify any
-additional validation rules, and then call `verify()` with the reCAPTCHA
-response and user's IP address. For example:
-
-```php
-<?php
-$recaptcha = new \ReCaptcha\ReCaptcha($secret);
-$resp = $recaptcha->setExpectedHostname('recaptcha-demo.appspot.com')
- ->verify($gRecaptchaResponse, $remoteIp);
-if ($resp->isSuccess()) {
- // Verified!
-} else {
- $errors = $resp->getErrorCodes();
-}
-```
-
-The following methods are available:
-
-- `setExpectedHostname($hostname)`: ensures the hostname matches. You must do
- this if you have disabled "Domain/Package Name Validation" for your
- credentials.
-- `setExpectedApkPackageName($apkPackageName)`: if you're verifying a response
- from an Android app. Again, you must do this if you have disabled
- "Domain/Package Name Validation" for your credentials.
-- `setExpectedAction($action)`: ensures the action matches for the v3 API.
-- `setScoreThreshold($threshold)`: set a score theshold for responses from the
- v3 API
-- `setChallengeTimeout($timeoutSeconds)`: set a timeout between the user passing
- the reCAPTCHA and your server processing it.
-
-Each of the `set`\*`()` methods return the `ReCaptcha` instance so you can chain
-them together. For example:
-
-```php
-<?php
-$recaptcha = new \ReCaptcha\ReCaptcha($secret);
-$resp = $recaptcha->setExpectedHostname('recaptcha-demo.appspot.com')
- ->setExpectedAction('homepage')
- ->setScoreThreshold(0.5)
- ->verify($gRecaptchaResponse, $remoteIp);
-
-if ($resp->isSuccess()) {
- // Verified!
-} else {
- $errors = $resp->getErrorCodes();
-}
-```
-
-You can find the constants for the libraries error codes in the `ReCaptcha`
-class constants, e.g. `ReCaptcha::E_HOSTNAME_MISMATCH`
-
-For more details on usage and structure, see [ARCHITECTURE](ARCHITECTURE.md).
-
-### Examples
-
-You can see examples of each reCAPTCHA type in [examples/](examples/). You can
-run the examples locally by using the Composer script:
-
-```sh
-composer run-script serve-examples
-```
-
-This makes use of the in-built PHP dev server to host the examples at
-http://localhost:8080/
-
-These are also hosted on Google AppEngine Flexible environment at
-https://recaptcha-demo.appspot.com/. This is configured by
-[`app.yaml`](./app.yaml) which you can also use to [deploy to your own AppEngine
-project](https://cloud.google.com/appengine/docs/flexible/php/download).
-
-## Contributing
-
-No one ever has enough engineers, so we're very happy to accept contributions
-via Pull Requests. For details, see [CONTRIBUTING](CONTRIBUTING.md)
diff --git a/srcs/phpmyadmin/vendor/google/recaptcha/app.yaml b/srcs/phpmyadmin/vendor/google/recaptcha/app.yaml
deleted file mode 100644
index b6ccaf1..0000000
--- a/srcs/phpmyadmin/vendor/google/recaptcha/app.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-runtime: php
-env: flex
-
-skip_files:
-- tests
-
-runtime_config:
- document_root: examples
diff --git a/srcs/phpmyadmin/vendor/google/recaptcha/composer.json b/srcs/phpmyadmin/vendor/google/recaptcha/composer.json
deleted file mode 100644
index ab6b4f1..0000000
--- a/srcs/phpmyadmin/vendor/google/recaptcha/composer.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "name": "google/recaptcha",
- "description": "Client library for reCAPTCHA, a free service that protects websites from spam and abuse.",
- "type": "library",
- "keywords": ["recaptcha", "captcha", "spam", "abuse"],
- "homepage": "https://www.google.com/recaptcha/",
- "license": "BSD-3-Clause",
- "support": {
- "forum": "https://groups.google.com/forum/#!forum/recaptcha",
- "source": "https://github.com/google/recaptcha"
- },
- "require": {
- "php": ">=5.5"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.8.36|^5.7.27|^6.59|^7.5.11",
- "friendsofphp/php-cs-fixer": "^2.2.20|^2.15",
- "php-coveralls/php-coveralls": "^2.1"
- },
- "autoload": {
- "psr-4": {
- "ReCaptcha\\": "src/ReCaptcha"
- }
- },
- "extra": {
- "branch-alias": {
- "dev-master": "1.2.x-dev"
- }
- },
- "scripts": {
- "lint": "vendor/bin/php-cs-fixer -vvv fix --using-cache=no --dry-run .",
- "lint-fix": "vendor/bin/php-cs-fixer -vvv fix --using-cache=no .",
- "test": "vendor/bin/phpunit --colors=always",
- "serve-examples": "@php -S localhost:8080 -t examples"
- },
- "config": {
- "process-timeout": 0
- }
-}
diff --git a/srcs/phpmyadmin/vendor/google/recaptcha/phpunit.xml.dist b/srcs/phpmyadmin/vendor/google/recaptcha/phpunit.xml.dist
deleted file mode 100644
index ae86610..0000000
--- a/srcs/phpmyadmin/vendor/google/recaptcha/phpunit.xml.dist
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.4/phpunit.xsd"
- colors="true"
- verbose="true"
- bootstrap="src/autoload.php">
- <testsuites>
- <testsuite name="reCAPTCHA Test Suite">
- <directory>tests/ReCaptcha/</directory>
- </testsuite>
- </testsuites>
- <filter>
- <whitelist>
- <directory suffix=".php">src/ReCaptcha/</directory>
- </whitelist>
- </filter>
- <logging>
- <log type="coverage-clover" target="build/logs/clover.xml"/>
- </logging>
-</phpunit>
diff --git a/srcs/phpmyadmin/vendor/google/recaptcha/src/ReCaptcha/ReCaptcha.php b/srcs/phpmyadmin/vendor/google/recaptcha/src/ReCaptcha/ReCaptcha.php
deleted file mode 100644
index 177fa44..0000000
--- a/srcs/phpmyadmin/vendor/google/recaptcha/src/ReCaptcha/ReCaptcha.php
+++ /dev/null
@@ -1,269 +0,0 @@
-<?php
-/**
- * This is a PHP library that handles calling reCAPTCHA.
- *
- * BSD 3-Clause License
- * @copyright (c) 2019, Google Inc.
- * @link https://www.google.com/recaptcha
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the copyright holder nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-namespace ReCaptcha;
-
-/**
- * reCAPTCHA client.
- */
-class ReCaptcha
-{
- /**
- * Version of this client library.
- * @const string
- */
- const VERSION = 'php_1.2.3';
-
- /**
- * URL for reCAPTCHA siteverify API
- * @const string
- */
- const SITE_VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify';
-
- /**
- * Invalid JSON received
- * @const string
- */
- const E_INVALID_JSON = 'invalid-json';
-
- /**
- * Could not connect to service
- * @const string
- */
- const E_CONNECTION_FAILED = 'connection-failed';
-
- /**
- * Did not receive a 200 from the service
- * @const string
- */
- const E_BAD_RESPONSE = 'bad-response';
-
- /**
- * Not a success, but no error codes received!
- * @const string
- */
- const E_UNKNOWN_ERROR = 'unknown-error';
-
- /**
- * ReCAPTCHA response not provided
- * @const string
- */
- const E_MISSING_INPUT_RESPONSE = 'missing-input-response';
-
- /**
- * Expected hostname did not match
- * @const string
- */
- const E_HOSTNAME_MISMATCH = 'hostname-mismatch';
-
- /**
- * Expected APK package name did not match
- * @const string
- */
- const E_APK_PACKAGE_NAME_MISMATCH = 'apk_package_name-mismatch';
-
- /**
- * Expected action did not match
- * @const string
- */
- const E_ACTION_MISMATCH = 'action-mismatch';
-
- /**
- * Score threshold not met
- * @const string
- */
- const E_SCORE_THRESHOLD_NOT_MET = 'score-threshold-not-met';
-
- /**
- * Challenge timeout
- * @const string
- */
- const E_CHALLENGE_TIMEOUT = 'challenge-timeout';
-
- /**
- * Shared secret for the site.
- * @var string
- */
- private $secret;
-
- /**
- * Method used to communicate with service. Defaults to POST request.
- * @var RequestMethod
- */
- private $requestMethod;
-
- /**
- * Create a configured instance to use the reCAPTCHA service.
- *
- * @param string $secret The shared key between your site and reCAPTCHA.
- * @param RequestMethod $requestMethod method used to send the request. Defaults to POST.
- * @throws \RuntimeException if $secret is invalid
- */
- public function __construct($secret, RequestMethod $requestMethod = null)
- {
- if (empty($secret)) {
- throw new \RuntimeException('No secret provided');
- }
-
- if (!is_string($secret)) {
- throw new \RuntimeException('The provided secret must be a string');
- }
-
- $this->secret = $secret;
- $this->requestMethod = (is_null($requestMethod)) ? new RequestMethod\Post() : $requestMethod;
- }
-
- /**
- * Calls the reCAPTCHA siteverify API to verify whether the user passes
- * CAPTCHA test and additionally runs any specified additional checks
- *
- * @param string $response The user response token provided by reCAPTCHA, verifying the user on your site.
- * @param string $remoteIp The end user's IP address.
- * @return Response Response from the service.
- */
- public function verify($response, $remoteIp = null)
- {
- // Discard empty solution submissions
- if (empty($response)) {
- $recaptchaResponse = new Response(false, array(self::E_MISSING_INPUT_RESPONSE));
- return $recaptchaResponse;
- }
-
- $params = new RequestParameters($this->secret, $response, $remoteIp, self::VERSION);
- $rawResponse = $this->requestMethod->submit($params);
- $initialResponse = Response::fromJson($rawResponse);
- $validationErrors = array();
-
- if (isset($this->hostname) && strcasecmp($this->hostname, $initialResponse->getHostname()) !== 0) {
- $validationErrors[] = self::E_HOSTNAME_MISMATCH;
- }
-
- if (isset($this->apkPackageName) && strcasecmp($this->apkPackageName, $initialResponse->getApkPackageName()) !== 0) {
- $validationErrors[] = self::E_APK_PACKAGE_NAME_MISMATCH;
- }
-
- if (isset($this->action) && strcasecmp($this->action, $initialResponse->getAction()) !== 0) {
- $validationErrors[] = self::E_ACTION_MISMATCH;
- }
-
- if (isset($this->threshold) && $this->threshold > $initialResponse->getScore()) {
- $validationErrors[] = self::E_SCORE_THRESHOLD_NOT_MET;
- }
-
- if (isset($this->timeoutSeconds)) {
- $challengeTs = strtotime($initialResponse->getChallengeTs());
-
- if ($challengeTs > 0 && time() - $challengeTs > $this->timeoutSeconds) {
- $validationErrors[] = self::E_CHALLENGE_TIMEOUT;
- }
- }
-
- if (empty($validationErrors)) {
- return $initialResponse;
- }
-
- return new Response(
- false,
- array_merge($initialResponse->getErrorCodes(), $validationErrors),
- $initialResponse->getHostname(),
- $initialResponse->getChallengeTs(),
- $initialResponse->getApkPackageName(),
- $initialResponse->getScore(),
- $initialResponse->getAction()
- );
- }
-
- /**
- * Provide a hostname to match against in verify()
- * This should be without a protocol or trailing slash, e.g. www.google.com
- *
- * @param string $hostname Expected hostname
- * @return ReCaptcha Current instance for fluent interface
- */
- public function setExpectedHostname($hostname)
- {
- $this->hostname = $hostname;
- return $this;
- }
-
- /**
- * Provide an APK package name to match against in verify()
- *
- * @param string $apkPackageName Expected APK package name
- * @return ReCaptcha Current instance for fluent interface
- */
- public function setExpectedApkPackageName($apkPackageName)
- {
- $this->apkPackageName = $apkPackageName;
- return $this;
- }
-
- /**
- * Provide an action to match against in verify()
- * This should be set per page.
- *
- * @param string $action Expected action
- * @return ReCaptcha Current instance for fluent interface
- */
- public function setExpectedAction($action)
- {
- $this->action = $action;
- return $this;
- }
-
- /**
- * Provide a threshold to meet or exceed in verify()
- * Threshold should be a float between 0 and 1 which will be tested as response >= threshold.
- *
- * @param float $threshold Expected threshold
- * @return ReCaptcha Current instance for fluent interface
- */
- public function setScoreThreshold($threshold)
- {
- $this->threshold = floatval($threshold);
- return $this;
- }
-
- /**
- * Provide a timeout in seconds to test against the challenge timestamp in verify()
- *
- * @param int $timeoutSeconds Expected hostname
- * @return ReCaptcha Current instance for fluent interface
- */
- public function setChallengeTimeout($timeoutSeconds)
- {
- $this->timeoutSeconds = $timeoutSeconds;
- return $this;
- }
-}
diff --git a/srcs/phpmyadmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod.php b/srcs/phpmyadmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod.php
deleted file mode 100644
index 0a2a671..0000000
--- a/srcs/phpmyadmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod.php
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-/**
- * This is a PHP library that handles calling reCAPTCHA.
- *
- * BSD 3-Clause License
- * @copyright (c) 2019, Google Inc.
- * @link https://www.google.com/recaptcha
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the copyright holder nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-namespace ReCaptcha;
-
-/**
- * Method used to send the request to the service.
- */
-interface RequestMethod
-{
-
- /**
- * Submit the request with the specified parameters.
- *
- * @param RequestParameters $params Request parameters
- * @return string Body of the reCAPTCHA response
- */
- public function submit(RequestParameters $params);
-}
diff --git a/srcs/phpmyadmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Curl.php b/srcs/phpmyadmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Curl.php
deleted file mode 100644
index eb99842..0000000
--- a/srcs/phpmyadmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Curl.php
+++ /dev/null
@@ -1,82 +0,0 @@
-<?php
-/**
- * This is a PHP library that handles calling reCAPTCHA.
- *
- * BSD 3-Clause License
- * @copyright (c) 2019, Google Inc.
- * @l