CauseFX 6 лет назад
Родитель
Сommit
24236a8c34
69 измененных файлов с 1889 добавлено и 2890 удалено
  1. 8 11
      api/composer.lock
  2. 9 12
      api/vendor/composer/installed.json
  3. 3 2
      api/vendor/lcobucci/jwt/.gitignore
  4. 5 5
      api/vendor/lcobucci/jwt/.travis.yml
  5. 82 37
      api/vendor/lcobucci/jwt/README.md
  6. 5 8
      api/vendor/lcobucci/jwt/composer.json
  7. 0 1898
      api/vendor/lcobucci/jwt/composer.lock
  8. 6 12
      api/vendor/lcobucci/jwt/phpunit.xml.dist
  9. 237 42
      api/vendor/lcobucci/jwt/src/Builder.php
  10. 2 0
      api/vendor/lcobucci/jwt/src/Claim/Basic.php
  11. 2 0
      api/vendor/lcobucci/jwt/src/Claim/EqualsTo.php
  12. 2 0
      api/vendor/lcobucci/jwt/src/Claim/Factory.php
  13. 2 0
      api/vendor/lcobucci/jwt/src/Claim/GreaterOrEqualsTo.php
  14. 2 0
      api/vendor/lcobucci/jwt/src/Claim/LesserOrEqualsTo.php
  15. 2 0
      api/vendor/lcobucci/jwt/src/Claim/Validatable.php
  16. 8 1
      api/vendor/lcobucci/jwt/src/Signer/BaseSigner.php
  17. 24 104
      api/vendor/lcobucci/jwt/src/Signer/Ecdsa.php
  18. 0 102
      api/vendor/lcobucci/jwt/src/Signer/Ecdsa/KeyParser.php
  19. 134 0
      api/vendor/lcobucci/jwt/src/Signer/Ecdsa/MultibyteStringConverter.php
  20. 1 1
      api/vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha256.php
  21. 1 1
      api/vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha384.php
  22. 1 1
      api/vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha512.php
  23. 38 0
      api/vendor/lcobucci/jwt/src/Signer/Ecdsa/SignatureConverter.php
  24. 4 0
      api/vendor/lcobucci/jwt/src/Signer/Hmac.php
  25. 13 6
      api/vendor/lcobucci/jwt/src/Signer/Key.php
  26. 115 0
      api/vendor/lcobucci/jwt/src/Signer/OpenSSL.php
  27. 4 58
      api/vendor/lcobucci/jwt/src/Signer/Rsa.php
  28. 18 9
      api/vendor/lcobucci/jwt/src/ValidationData.php
  29. 22 14
      api/vendor/lcobucci/jwt/test/functional/EcdsaTokenTest.php
  30. 1 1
      api/vendor/lcobucci/jwt/test/functional/HmacTokenTest.php
  31. 154 0
      api/vendor/lcobucci/jwt/test/functional/RFC6978VectorTest.php
  32. 28 20
      api/vendor/lcobucci/jwt/test/functional/RsaTokenTest.php
  33. 25 1
      api/vendor/lcobucci/jwt/test/functional/UnsignedTokenTest.php
  34. 117 183
      api/vendor/lcobucci/jwt/test/unit/BuilderTest.php
  35. 1 1
      api/vendor/lcobucci/jwt/test/unit/Claim/BasicTest.php
  36. 4 1
      api/vendor/lcobucci/jwt/test/unit/Claim/EqualsToTest.php
  37. 1 1
      api/vendor/lcobucci/jwt/test/unit/Claim/FactoryTest.php
  38. 5 1
      api/vendor/lcobucci/jwt/test/unit/Claim/GreaterOrEqualsToTest.php
  39. 5 1
      api/vendor/lcobucci/jwt/test/unit/Claim/LesserOrEqualsToTest.php
  40. 4 4
      api/vendor/lcobucci/jwt/test/unit/ParserTest.php
  41. 1 1
      api/vendor/lcobucci/jwt/test/unit/Parsing/DecoderTest.php
  42. 1 1
      api/vendor/lcobucci/jwt/test/unit/Parsing/EncoderTest.php
  43. 2 2
      api/vendor/lcobucci/jwt/test/unit/SignatureTest.php
  44. 1 1
      api/vendor/lcobucci/jwt/test/unit/Signer/BaseSignerTest.php
  45. 0 178
      api/vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/KeyParserTest.php
  46. 127 0
      api/vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/MultibyteStringConverterTest.php
  47. 7 7
      api/vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/Sha256Test.php
  48. 7 7
      api/vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/Sha384Test.php
  49. 7 7
      api/vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/Sha512Test.php
  50. 65 121
      api/vendor/lcobucci/jwt/test/unit/Signer/EcdsaTest.php
  51. 1 1
      api/vendor/lcobucci/jwt/test/unit/Signer/Hmac/Sha256Test.php
  52. 1 1
      api/vendor/lcobucci/jwt/test/unit/Signer/Hmac/Sha384Test.php
  53. 1 1
      api/vendor/lcobucci/jwt/test/unit/Signer/Hmac/Sha512Test.php
  54. 1 1
      api/vendor/lcobucci/jwt/test/unit/Signer/HmacTest.php
  55. 19 2
      api/vendor/lcobucci/jwt/test/unit/Signer/KeyTest.php
  56. 1 1
      api/vendor/lcobucci/jwt/test/unit/Signer/KeychainTest.php
  57. 1 1
      api/vendor/lcobucci/jwt/test/unit/Signer/Rsa/Sha256Test.php
  58. 1 1
      api/vendor/lcobucci/jwt/test/unit/Signer/Rsa/Sha384Test.php
  59. 1 1
      api/vendor/lcobucci/jwt/test/unit/Signer/Rsa/Sha512Test.php
  60. 188 0
      api/vendor/lcobucci/jwt/test/unit/Signer/RsaTest.php
  61. 78 7
      api/vendor/lcobucci/jwt/test/unit/TokenTest.php
  62. 56 10
      api/vendor/lcobucci/jwt/test/unit/ValidationDataTest.php
  63. 46 0
      api/vendor/phpmailer/phpmailer/COMMITMENT
  64. 51 0
      api/vendor/phpmailer/phpmailer/composer.json
  65. 25 0
      api/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php
  66. 26 0
      api/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php
  67. 25 0
      api/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php
  68. 27 0
      api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php
  69. 27 0
      api/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php

+ 8 - 11
api/composer.lock

@@ -674,33 +674,30 @@
         },
         {
             "name": "lcobucci/jwt",
-            "version": "3.2.2",
+            "version": "3.3.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/lcobucci/jwt.git",
-                "reference": "0b5930be73582369e10c4d4bb7a12bac927a203c"
+                "reference": "a11ec5f4b4d75d1fcd04e133dede4c317aac9e18"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/lcobucci/jwt/zipball/0b5930be73582369e10c4d4bb7a12bac927a203c",
-                "reference": "0b5930be73582369e10c4d4bb7a12bac927a203c",
+                "url": "https://api.github.com/repos/lcobucci/jwt/zipball/a11ec5f4b4d75d1fcd04e133dede4c317aac9e18",
+                "reference": "a11ec5f4b4d75d1fcd04e133dede4c317aac9e18",
                 "shasum": ""
             },
             "require": {
+                "ext-mbstring": "*",
                 "ext-openssl": "*",
-                "php": ">=5.5"
+                "php": "^5.6 || ^7.0"
             },
             "require-dev": {
-                "mdanter/ecc": "~0.3.1",
                 "mikey179/vfsstream": "~1.5",
                 "phpmd/phpmd": "~2.2",
                 "phpunit/php-invoker": "~1.1",
-                "phpunit/phpunit": "~4.5",
+                "phpunit/phpunit": "^5.7 || ^7.3",
                 "squizlabs/php_codesniffer": "~2.3"
             },
-            "suggest": {
-                "mdanter/ecc": "Required to use Elliptic Curves based algorithms."
-            },
             "type": "library",
             "extra": {
                 "branch-alias": {
@@ -728,7 +725,7 @@
                 "JWS",
                 "jwt"
             ],
-            "time": "2017-09-01T08:23:26+00:00"
+            "time": "2019-05-24T18:30:49+00:00"
         },
         {
             "name": "paragonie/constant_time_encoding",

+ 9 - 12
api/vendor/composer/installed.json

@@ -693,35 +693,32 @@
     },
     {
         "name": "lcobucci/jwt",
-        "version": "3.2.2",
-        "version_normalized": "3.2.2.0",
+        "version": "3.3.1",
+        "version_normalized": "3.3.1.0",
         "source": {
             "type": "git",
             "url": "https://github.com/lcobucci/jwt.git",
-            "reference": "0b5930be73582369e10c4d4bb7a12bac927a203c"
+            "reference": "a11ec5f4b4d75d1fcd04e133dede4c317aac9e18"
         },
         "dist": {
             "type": "zip",
-            "url": "https://api.github.com/repos/lcobucci/jwt/zipball/0b5930be73582369e10c4d4bb7a12bac927a203c",
-            "reference": "0b5930be73582369e10c4d4bb7a12bac927a203c",
+            "url": "https://api.github.com/repos/lcobucci/jwt/zipball/a11ec5f4b4d75d1fcd04e133dede4c317aac9e18",
+            "reference": "a11ec5f4b4d75d1fcd04e133dede4c317aac9e18",
             "shasum": ""
         },
         "require": {
+            "ext-mbstring": "*",
             "ext-openssl": "*",
-            "php": ">=5.5"
+            "php": "^5.6 || ^7.0"
         },
         "require-dev": {
-            "mdanter/ecc": "~0.3.1",
             "mikey179/vfsstream": "~1.5",
             "phpmd/phpmd": "~2.2",
             "phpunit/php-invoker": "~1.1",
-            "phpunit/phpunit": "~4.5",
+            "phpunit/phpunit": "^5.7 || ^7.3",
             "squizlabs/php_codesniffer": "~2.3"
         },
-        "suggest": {
-            "mdanter/ecc": "Required to use Elliptic Curves based algorithms."
-        },
-        "time": "2017-09-01T08:23:26+00:00",
+        "time": "2019-05-24T18:30:49+00:00",
         "type": "library",
         "extra": {
             "branch-alias": {

+ 3 - 2
api/vendor/lcobucci/jwt/.gitignore

@@ -1,2 +1,3 @@
-vendor
-phpunit.xml
+/vendor
+/phpunit.xml
+/composer.lock

+ 5 - 5
api/vendor/lcobucci/jwt/.travis.yml

@@ -1,15 +1,15 @@
 language: php
 php:
-  - 5.5
   - 5.6
   - 7.0
-  - hhvm
-  - hhvm-nightly
+  - 7.1
+  - 7.2
+  - 7.3
+  - nightly
 
 matrix:
   allow_failures:
-    - php: hhvm-nightly
+    - php: nightly
 
 before_script:
-  - composer selfupdate
   - composer install --prefer-dist -o

+ 82 - 37
api/vendor/lcobucci/jwt/README.md

@@ -6,8 +6,8 @@
 [![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/lcobucci/jwt/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/lcobucci/jwt/?branch=master)
 [![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/lcobucci/jwt/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/lcobucci/jwt/?branch=master)
 
-A simple library to work with JSON Web Token and JSON Web Signature (requires PHP 5.5+).
-The implementation is based on the [current draft](http://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).
+A simple library to work with JSON Web Token and JSON Web Signature (requires PHP 5.6+).
+The implementation is based on the [RFC 7519](https://tools.ietf.org/html/rfc7519).
 
 ## Installation
 
@@ -20,7 +20,7 @@ composer require lcobucci/jwt
 
 ### Dependencies
 
-- PHP 5.5+
+- PHP 5.6+
 - OpenSSL Extension
 
 ## Basic usage
@@ -32,13 +32,14 @@ Just use the builder to create a new JWT/JWS tokens:
 ```php
 use Lcobucci\JWT\Builder;
 
-$token = (new Builder())->setIssuer('http://example.com') // Configures the issuer (iss claim)
-                        ->setAudience('http://example.org') // Configures the audience (aud claim)
-                        ->setId('4f1g23a12aa', true) // Configures the id (jti claim), replicating as a header item
-                        ->setIssuedAt(time()) // Configures the time that the token was issue (iat claim)
-                        ->setNotBefore(time() + 60) // Configures the time that the token can be used (nbf claim)
-                        ->setExpiration(time() + 3600) // Configures the expiration time of the token (nbf claim)
-                        ->set('uid', 1) // Configures a new claim, called "uid"
+$time = time();
+$token = (new Builder())->issuedBy('http://example.com') // Configures the issuer (iss claim)
+                        ->permittedFor('http://example.org') // Configures the audience (aud claim)
+                        ->identifiedBy('4f1g23a12aa', true) // Configures the id (jti claim), replicating as a header item
+                        ->issuedAt($time) // Configures the time that the token was issue (iat claim)
+                        ->canOnlyBeUsedAfter($time + 60) // Configures the time that the token can be used (nbf claim)
+                        ->expiresAt($time + 3600) // Configures the expiration time of the token (exp claim)
+                        ->withClaim('uid', 1) // Configures a new claim, called "uid"
                         ->getToken(); // Retrieves the generated token
 
 
@@ -69,7 +70,7 @@ echo $token->getClaim('uid'); // will print "1"
 
 ### Validating
 
-We can easily validate if the token is valid (using the previous token as example):
+We can easily validate if the token is valid (using the previous token and time as example):
 
 ```php
 use Lcobucci\JWT\ValidationData;
@@ -79,40 +80,84 @@ $data->setIssuer('http://example.com');
 $data->setAudience('http://example.org');
 $data->setId('4f1g23a12aa');
 
-var_dump($token->validate($data)); // false, because we created a token that cannot be used before of `time() + 60`
+var_dump($token->validate($data)); // false, because token cannot be used before now() + 60
 
-$data->setCurrentTime(time() + 60); // changing the validation time to future
+$data->setCurrentTime($time + 61); // changing the validation time to future
 
-var_dump($token->validate($data)); // true, because validation information is equals to data contained on the token
+var_dump($token->validate($data)); // true, because current time is between "nbf" and "exp" claims
 
-$data->setCurrentTime(time() + 4000); // changing the validation time to future
+$data->setCurrentTime($time + 4000); // changing the validation time to future
 
 var_dump($token->validate($data)); // false, because token is expired since current time is greater than exp
+
+// We can also use the $leeway parameter to deal with clock skew (see notes below)
+// If token's claimed time is invalid but the difference between that and the validation time is less than $leeway, 
+// then token is still considered valid
+$dataWithLeeway = new ValidationData($time, 20); 
+$dataWithLeeway->setIssuer('http://example.com');
+$dataWithLeeway->setAudience('http://example.org');
+$dataWithLeeway->setId('4f1g23a12aa');
+
+var_dump($token->validate($dataWithLeeway)); // false, because token can't be used before now() + 60, not within leeway
+
+$dataWithLeeway->setCurrentTime($time + 51); // changing the validation time to future
+
+var_dump($token->validate($dataWithLeeway)); // true, because current time plus leeway is between "nbf" and "exp" claims
+
+$dataWithLeeway->setCurrentTime($time + 3610); // changing the validation time to future but within leeway
+
+var_dump($token->validate($dataWithLeeway)); // true, because current time - 20 seconds leeway is less than exp
+
+$dataWithLeeway->setCurrentTime($time + 4000); // changing the validation time to future outside of leeway
+
+var_dump($token->validate($dataWithLeeway)); // false, because token is expired since current time is greater than exp
 ```
 
+#### Important
+
+- You have to configure ```ValidationData``` informing all claims you want to validate the token.
+- If ```ValidationData``` contains claims that are not being used in token or token has claims that are not
+configured in ```ValidationData``` they will be ignored by ```Token::validate()```.
+- ```exp```, ```nbf``` and ```iat``` claims are configured by default in ```ValidationData::__construct()```
+with the current UNIX time (```time()```).
+- The optional ```$leeway``` parameter of ```ValidationData``` will cause us to use that number of seconds of leeway 
+when validating the time-based claims, pretending we are further in the future for the "Issued At" (```iat```) and "Not 
+Before" (```nbf```) claims and pretending we are further in the past for the "Expiration Time" (```exp```) claim. This
+allows for situations where the clock of the issuing server has a different time than the clock of the verifying server, 
+as mentioned in [section 4.1 of RFC 7519](https://tools.ietf.org/html/rfc7519#section-4.1).
+
 ## Token signature
 
 We can use signatures to be able to verify if the token was not modified after its generation. This library implements Hmac, RSA and ECDSA signatures (using 256, 384 and 512).
 
+### Important
+
+Do not allow the string sent to the Parser to dictate which signature algorithm
+to use, or else your application will be vulnerable to a [critical JWT security vulnerability](https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries).
+
+The examples below are safe because the choice in `Signer` is hard-coded and
+cannot be influenced by malicious users.
+
 ### Hmac
 
 Hmac signatures are really simple to be used:
 
 ```php
 use Lcobucci\JWT\Builder;
+use Lcobucci\JWT\Signer\Key;
 use Lcobucci\JWT\Signer\Hmac\Sha256;
 
 $signer = new Sha256();
+$time = time();
 
-$token = (new Builder())->setIssuer('http://example.com') // Configures the issuer (iss claim)
-                        ->setAudience('http://example.org') // Configures the audience (aud claim)
-                        ->setId('4f1g23a12aa', true) // Configures the id (jti claim), replicating as a header item
-                        ->setIssuedAt(time()) // Configures the time that the token was issue (iat claim)
-                        ->setNotBefore(time() + 60) // Configures the time that the token can be used (nbf claim)
-                        ->setExpiration(time() + 3600) // Configures the expiration time of the token (exp claim)
-                        ->set('uid', 1) // Configures a new claim, called "uid"
-                        ->sign($signer, 'testing') // creates a signature using "testing" as key
-                        ->getToken(); // Retrieves the generated token
+$token = (new Builder())->issuedBy('http://example.com') // Configures the issuer (iss claim)
+                        ->permittedFor('http://example.org') // Configures the audience (aud claim)
+                        ->identifiedBy('4f1g23a12aa', true) // Configures the id (jti claim), replicating as a header item
+                        ->issuedAt($time) // Configures the time that the token was issue (iat claim)
+                        ->canOnlyBeUsedAfter($time + 60) // Configures the time that the token can be used (nbf claim)
+                        ->expiresAt($time + 3600) // Configures the expiration time of the token (exp claim)
+                        ->withClaim('uid', 1) // Configures a new claim, called "uid"
+                        ->getToken($signer, new Key('testing')); // Retrieves the generated token
 
 
 var_dump($token->verify($signer, 'testing 1')); // false, because the key is different
@@ -125,25 +170,25 @@ RSA and ECDSA signatures are based on public and private keys so you have to gen
 
 ```php
 use Lcobucci\JWT\Builder;
-use Lcobucci\JWT\Signer\Keychain; // just to make our life simpler
+use Lcobucci\JWT\Signer\Key;
 use Lcobucci\JWT\Signer\Rsa\Sha256; // you can use Lcobucci\JWT\Signer\Ecdsa\Sha256 if you're using ECDSA keys
 
 $signer = new Sha256();
+$privateKey = new Key('file://{path to your private key}');
+$time = time();
 
-$keychain = new Keychain();
-
-$token = (new Builder())->setIssuer('http://example.com') // Configures the issuer (iss claim)
-                        ->setAudience('http://example.org') // Configures the audience (aud claim)
-                        ->setId('4f1g23a12aa', true) // Configures the id (jti claim), replicating as a header item
-                        ->setIssuedAt(time()) // Configures the time that the token was issue (iat claim)
-                        ->setNotBefore(time() + 60) // Configures the time that the token can be used (nbf claim)
-                        ->setExpiration(time() + 3600) // Configures the expiration time of the token (nbf claim)
-                        ->set('uid', 1) // Configures a new claim, called "uid"
-                        ->sign($signer,  $keychain->getPrivateKey('file://{path to your private key}')) // creates a signature using your private key
-                        ->getToken(); // Retrieves the generated token
+$token = (new Builder())->issuedBy('http://example.com') // Configures the issuer (iss claim)
+                        ->permittedFor('http://example.org') // Configures the audience (aud claim)
+                        ->identifiedBy('4f1g23a12aa', true) // Configures the id (jti claim), replicating as a header item
+                        ->issuedAt($time) // Configures the time that the token was issue (iat claim)
+                        ->canOnlyBeUsedAfter($time + 60) // Configures the time that the token can be used (nbf claim)
+                        ->expiresAt($time + 3600) // Configures the expiration time of the token (exp claim)
+                        ->withClaim('uid', 1) // Configures a new claim, called "uid"
+                        ->getToken($signer,  $privateKey); // Retrieves the generated token
 
+$publicKey = new Key('file://{path to your public key}');
 
-var_dump($token->verify($signer, $keychain->getPublicKey('file://{path to your public key}')); // true when the public key was generated by the private one =)
+var_dump($token->verify($signer, $publicKey)); // true when the public key was generated by the private one =)
 ```
 
 **It's important to say that if you're using RSA keys you shouldn't invoke ECDSA signers (and vice-versa), otherwise ```sign()``` and ```verify()``` will raise an exception!**

+ 5 - 8
api/vendor/lcobucci/jwt/composer.json

@@ -17,19 +17,16 @@
         "BSD-3-Clause"
     ],
     "require": {
-        "php": ">=5.5",
+        "php": "^5.6 || ^7.0",
+        "ext-mbstring": "*",
         "ext-openssl": "*"
     },
     "require-dev": {
-        "phpunit/phpunit": "~4.5",
+        "phpunit/phpunit": "^5.7 || ^7.3",
         "squizlabs/php_codesniffer": "~2.3",
         "phpmd/phpmd": "~2.2",
         "phpunit/php-invoker": "~1.1",
-        "mikey179/vfsStream": "~1.5",
-        "mdanter/ecc": "~0.3.1"
-    },
-    "suggest":{
-        "mdanter/ecc": "Required to use Elliptic Curves based algorithms."
+        "mikey179/vfsstream": "~1.5"
     },
     "autoload": {
         "psr-4": {
@@ -39,7 +36,7 @@
     "autoload-dev": {
         "psr-4": {
             "Lcobucci\\JWT\\": [
-                "test/unit", 
+                "test/unit",
                 "test/functional"
             ]
         }

+ 0 - 1898
api/vendor/lcobucci/jwt/composer.lock

@@ -1,1898 +0,0 @@
-{
-    "_readme": [
-        "This file locks the dependencies of your project to a known state",
-        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
-        "This file is @generated automatically"
-    ],
-    "hash": "82547d7474ec5fcbf6718c4f2dca46d6",
-    "content-hash": "1c87e501c8e2df5e27eac6bfefe0c1f9",
-    "packages": [],
-    "packages-dev": [
-        {
-            "name": "doctrine/instantiator",
-            "version": "1.0.5",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/doctrine/instantiator.git",
-                "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
-                "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.3,<8.0-DEV"
-            },
-            "require-dev": {
-                "athletic/athletic": "~0.1.8",
-                "ext-pdo": "*",
-                "ext-phar": "*",
-                "phpunit/phpunit": "~4.0",
-                "squizlabs/php_codesniffer": "~2.0"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.0.x-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Marco Pivetta",
-                    "email": "ocramius@gmail.com",
-                    "homepage": "http://ocramius.github.com/"
-                }
-            ],
-            "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
-            "homepage": "https://github.com/doctrine/instantiator",
-            "keywords": [
-                "constructor",
-                "instantiate"
-            ],
-            "time": "2015-06-14 21:17:01"
-        },
-        {
-            "name": "fgrosse/phpasn1",
-            "version": "1.3.2",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/fgrosse/PHPASN1.git",
-                "reference": "ee6d1abd18f8bcbaf0b55563ba87e5ed16cd0c98"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/fgrosse/PHPASN1/zipball/ee6d1abd18f8bcbaf0b55563ba87e5ed16cd0c98",
-                "reference": "ee6d1abd18f8bcbaf0b55563ba87e5ed16cd0c98",
-                "shasum": ""
-            },
-            "require": {
-                "ext-gmp": "*",
-                "php": ">=5.3.0"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "~4.5"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.3.x-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "FG\\": "lib/"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Friedrich Große",
-                    "email": "friedrich.grosse@gmail.com",
-                    "homepage": "https://github.com/FGrosse",
-                    "role": "Author"
-                },
-                {
-                    "name": "All contributors",
-                    "homepage": "https://github.com/FGrosse/PHPASN1/contributors"
-                }
-            ],
-            "description": "A PHP Framework that allows you to encode and decode arbitrary ASN.1 structures using the ITU-T X.690 Encoding Rules.",
-            "homepage": "https://github.com/FGrosse/PHPASN1",
-            "time": "2015-07-15 21:26:40"
-        },
-        {
-            "name": "mdanter/ecc",
-            "version": "v0.3.1",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/phpecc/phpecc.git",
-                "reference": "182d94bc3bbeee6a8591bde36e66a80d8b07ae4b"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/phpecc/phpecc/zipball/182d94bc3bbeee6a8591bde36e66a80d8b07ae4b",
-                "reference": "182d94bc3bbeee6a8591bde36e66a80d8b07ae4b",
-                "shasum": ""
-            },
-            "require": {
-                "ext-gmp": "*",
-                "ext-mcrypt": "*",
-                "fgrosse/phpasn1": "~1.3.1",
-                "php": ">=5.4.0",
-                "symfony/console": "~2.6"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "~4.1",
-                "squizlabs/php_codesniffer": "~2",
-                "symfony/yaml": "~2.6"
-            },
-            "type": "library",
-            "autoload": {
-                "psr-4": {
-                    "Mdanter\\Ecc\\": "src/"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Matyas Danter",
-                    "homepage": "http://matejdanter.com/",
-                    "role": "Author"
-                },
-                {
-                    "name": "Thibaud Fabre",
-                    "email": "thibaud@aztech.io",
-                    "homepage": "http://aztech.io",
-                    "role": "Maintainer"
-                },
-                {
-                    "name": "Drak",
-                    "email": "drak@zikula.org",
-                    "homepage": "http://zikula.org",
-                    "role": "Maintainer"
-                }
-            ],
-            "description": "PHP Elliptic Curve Cryptography library",
-            "homepage": "https://github.com/mdanter/phpecc",
-            "time": "2014-07-07 12:44:15"
-        },
-        {
-            "name": "mikey179/vfsStream",
-            "version": "v1.6.4",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/mikey179/vfsStream.git",
-                "reference": "0247f57b2245e8ad2e689d7cee754b45fbabd592"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/0247f57b2245e8ad2e689d7cee754b45fbabd592",
-                "reference": "0247f57b2245e8ad2e689d7cee754b45fbabd592",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.3.0"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "~4.5"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.6.x-dev"
-                }
-            },
-            "autoload": {
-                "psr-0": {
-                    "org\\bovigo\\vfs\\": "src/main/php"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Frank Kleine",
-                    "homepage": "http://frankkleine.de/",
-                    "role": "Developer"
-                }
-            ],
-            "description": "Virtual file system to mock the real file system in unit tests.",
-            "homepage": "http://vfs.bovigo.org/",
-            "time": "2016-07-18 14:02:57"
-        },
-        {
-            "name": "pdepend/pdepend",
-            "version": "2.2.4",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/pdepend/pdepend.git",
-                "reference": "b086687f3a01dc6bb92d633aef071d2c5dd0db06"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/pdepend/pdepend/zipball/b086687f3a01dc6bb92d633aef071d2c5dd0db06",
-                "reference": "b086687f3a01dc6bb92d633aef071d2c5dd0db06",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.3.7",
-                "symfony/config": "^2.3.0|^3",
-                "symfony/dependency-injection": "^2.3.0|^3",
-                "symfony/filesystem": "^2.3.0|^3"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "^4.4.0,<4.8",
-                "squizlabs/php_codesniffer": "^2.0.0"
-            },
-            "bin": [
-                "src/bin/pdepend"
-            ],
-            "type": "library",
-            "autoload": {
-                "psr-4": {
-                    "PDepend\\": "src/main/php/PDepend"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "description": "Official version of pdepend to be handled with Composer",
-            "time": "2016-03-10 15:15:04"
-        },
-        {
-            "name": "phpdocumentor/reflection-common",
-            "version": "1.0",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
-                "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c",
-                "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.5"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "^4.6"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.0.x-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "phpDocumentor\\Reflection\\": [
-                        "src"
-                    ]
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Jaap van Otterdijk",
-                    "email": "opensource@ijaap.nl"
-                }
-            ],
-            "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
-            "homepage": "http://www.phpdoc.org",
-            "keywords": [
-                "FQSEN",
-                "phpDocumentor",
-                "phpdoc",
-                "reflection",
-                "static analysis"
-            ],
-            "time": "2015-12-27 11:43:31"
-        },
-        {
-            "name": "phpdocumentor/reflection-docblock",
-            "version": "3.1.1",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
-                "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e",
-                "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.5",
-                "phpdocumentor/reflection-common": "^1.0@dev",
-                "phpdocumentor/type-resolver": "^0.2.0",
-                "webmozart/assert": "^1.0"
-            },
-            "require-dev": {
-                "mockery/mockery": "^0.9.4",
-                "phpunit/phpunit": "^4.4"
-            },
-            "type": "library",
-            "autoload": {
-                "psr-4": {
-                    "phpDocumentor\\Reflection\\": [
-                        "src/"
-                    ]
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Mike van Riel",
-                    "email": "me@mikevanriel.com"
-                }
-            ],
-            "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
-            "time": "2016-09-30 07:12:33"
-        },
-        {
-            "name": "phpdocumentor/type-resolver",
-            "version": "0.2",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/phpDocumentor/TypeResolver.git",
-                "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443",
-                "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.5",
-                "phpdocumentor/reflection-common": "^1.0"
-            },
-            "require-dev": {
-                "mockery/mockery": "^0.9.4",
-                "phpunit/phpunit": "^5.2||^4.8.24"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.0.x-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "phpDocumentor\\Reflection\\": [
-                        "src/"
-                    ]
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Mike van Riel",
-                    "email": "me@mikevanriel.com"
-                }
-            ],
-            "time": "2016-06-10 07:14:17"
-        },
-        {
-            "name": "phpmd/phpmd",
-            "version": "2.4.3",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/phpmd/phpmd.git",
-                "reference": "2b9c2417a18696dfb578b38c116cd0ddc19b256e"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/phpmd/phpmd/zipball/2b9c2417a18696dfb578b38c116cd0ddc19b256e",
-                "reference": "2b9c2417a18696dfb578b38c116cd0ddc19b256e",
-                "shasum": ""
-            },
-            "require": {
-                "pdepend/pdepend": "^2.0.4",
-                "php": ">=5.3.0"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "^4.0",
-                "squizlabs/php_codesniffer": "^2.0"
-            },
-            "bin": [
-                "src/bin/phpmd"
-            ],
-            "type": "project",
-            "autoload": {
-                "psr-0": {
-                    "PHPMD\\": "src/main/php"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Manuel Pichler",
-                    "email": "github@manuel-pichler.de",
-                    "homepage": "https://github.com/manuelpichler",
-                    "role": "Project Founder"
-                },
-                {
-                    "name": "Other contributors",
-                    "homepage": "https://github.com/phpmd/phpmd/graphs/contributors",
-                    "role": "Contributors"
-                },
-                {
-                    "name": "Marc Würth",
-                    "email": "ravage@bluewin.ch",
-                    "homepage": "https://github.com/ravage84",
-                    "role": "Project Maintainer"
-                }
-            ],
-            "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.",
-            "homepage": "http://phpmd.org/",
-            "keywords": [
-                "mess detection",
-                "mess detector",
-                "pdepend",
-                "phpmd",
-                "pmd"
-            ],
-            "time": "2016-04-04 11:52:04"
-        },
-        {
-            "name": "phpspec/prophecy",
-            "version": "v1.6.1",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/phpspec/prophecy.git",
-                "reference": "58a8137754bc24b25740d4281399a4a3596058e0"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0",
-                "reference": "58a8137754bc24b25740d4281399a4a3596058e0",
-                "shasum": ""
-            },
-            "require": {
-                "doctrine/instantiator": "^1.0.2",
-                "php": "^5.3|^7.0",
-                "phpdocumentor/reflection-docblock": "^2.0|^3.0.2",
-                "sebastian/comparator": "^1.1",
-                "sebastian/recursion-context": "^1.0"
-            },
-            "require-dev": {
-                "phpspec/phpspec": "^2.0"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.6.x-dev"
-                }
-            },
-            "autoload": {
-                "psr-0": {
-                    "Prophecy\\": "src/"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Konstantin Kudryashov",
-                    "email": "ever.zet@gmail.com",
-                    "homepage": "http://everzet.com"
-                },
-                {
-                    "name": "Marcello Duarte",
-                    "email": "marcello.duarte@gmail.com"
-                }
-            ],
-            "description": "Highly opinionated mocking framework for PHP 5.3+",
-            "homepage": "https://github.com/phpspec/prophecy",
-            "keywords": [
-                "Double",
-                "Dummy",
-                "fake",
-                "mock",
-                "spy",
-                "stub"
-            ],
-            "time": "2016-06-07 08:13:47"
-        },
-        {
-            "name": "phpunit/php-code-coverage",
-            "version": "2.2.4",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
-                "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979",
-                "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.3.3",
-                "phpunit/php-file-iterator": "~1.3",
-                "phpunit/php-text-template": "~1.2",
-                "phpunit/php-token-stream": "~1.3",
-                "sebastian/environment": "^1.3.2",
-                "sebastian/version": "~1.0"
-            },
-            "require-dev": {
-                "ext-xdebug": ">=2.1.4",
-                "phpunit/phpunit": "~4"
-            },
-            "suggest": {
-                "ext-dom": "*",
-                "ext-xdebug": ">=2.2.1",
-                "ext-xmlwriter": "*"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "2.2.x-dev"
-                }
-            },
-            "autoload": {
-                "classmap": [
-                    "src/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Sebastian Bergmann",
-                    "email": "sb@sebastian-bergmann.de",
-                    "role": "lead"
-                }
-            ],
-            "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
-            "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
-            "keywords": [
-                "coverage",
-                "testing",
-                "xunit"
-            ],
-            "time": "2015-10-06 15:47:00"
-        },
-        {
-            "name": "phpunit/php-file-iterator",
-            "version": "1.4.1",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
-                "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
-                "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.3.3"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.4.x-dev"
-                }
-            },
-            "autoload": {
-                "classmap": [
-                    "src/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Sebastian Bergmann",
-                    "email": "sb@sebastian-bergmann.de",
-                    "role": "lead"
-                }
-            ],
-            "description": "FilterIterator implementation that filters files based on a list of suffixes.",
-            "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
-            "keywords": [
-                "filesystem",
-                "iterator"
-            ],
-            "time": "2015-06-21 13:08:43"
-        },
-        {
-            "name": "phpunit/php-invoker",
-            "version": "1.1.4",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/sebastianbergmann/php-invoker.git",
-                "reference": "86074bf0fc2caf02ec8819a93f65a37cd0b44c8e"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/86074bf0fc2caf02ec8819a93f65a37cd0b44c8e",
-                "reference": "86074bf0fc2caf02ec8819a93f65a37cd0b44c8e",
-                "shasum": ""
-            },
-            "require": {
-                "ext-pcntl": "*",
-                "php": ">=5.3.3",
-                "phpunit/php-timer": ">=1.0.6"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "~4"
-            },
-            "type": "library",
-            "autoload": {
-                "classmap": [
-                    "src/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Sebastian Bergmann",
-                    "email": "sebastian@phpunit.de",
-                    "role": "lead"
-                }
-            ],
-            "description": "Utility class for invoking callables with a timeout.",
-            "homepage": "https://github.com/sebastianbergmann/php-invoker/",
-            "keywords": [
-                "process"
-            ],
-            "time": "2015-06-21 13:32:55"
-        },
-        {
-            "name": "phpunit/php-text-template",
-            "version": "1.2.1",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/sebastianbergmann/php-text-template.git",
-                "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
-                "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.3.3"
-            },
-            "type": "library",
-            "autoload": {
-                "classmap": [
-                    "src/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Sebastian Bergmann",
-                    "email": "sebastian@phpunit.de",
-                    "role": "lead"
-                }
-            ],
-            "description": "Simple template engine.",
-            "homepage": "https://github.com/sebastianbergmann/php-text-template/",
-            "keywords": [
-                "template"
-            ],
-            "time": "2015-06-21 13:50:34"
-        },
-        {
-            "name": "phpunit/php-timer",
-            "version": "1.0.8",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/sebastianbergmann/php-timer.git",
-                "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260",
-                "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.3.3"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "~4|~5"
-            },
-            "type": "library",
-            "autoload": {
-                "classmap": [
-                    "src/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Sebastian Bergmann",
-                    "email": "sb@sebastian-bergmann.de",
-                    "role": "lead"
-                }
-            ],
-            "description": "Utility class for timing",
-            "homepage": "https://github.com/sebastianbergmann/php-timer/",
-            "keywords": [
-                "timer"
-            ],
-            "time": "2016-05-12 18:03:57"
-        },
-        {
-            "name": "phpunit/php-token-stream",
-            "version": "1.4.8",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/sebastianbergmann/php-token-stream.git",
-                "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
-                "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
-                "shasum": ""
-            },
-            "require": {
-                "ext-tokenizer": "*",
-                "php": ">=5.3.3"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "~4.2"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.4-dev"
-                }
-            },
-            "autoload": {
-                "classmap": [
-                    "src/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Sebastian Bergmann",
-                    "email": "sebastian@phpunit.de"
-                }
-            ],
-            "description": "Wrapper around PHP's tokenizer extension.",
-            "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
-            "keywords": [
-                "tokenizer"
-            ],
-            "time": "2015-09-15 10:49:45"
-        },
-        {
-            "name": "phpunit/phpunit",
-            "version": "4.8.27",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/sebastianbergmann/phpunit.git",
-                "reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c062dddcb68e44b563f66ee319ddae2b5a322a90",
-                "reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90",
-                "shasum": ""
-            },
-            "require": {
-                "ext-dom": "*",
-                "ext-json": "*",
-                "ext-pcre": "*",
-                "ext-reflection": "*",
-                "ext-spl": "*",
-                "php": ">=5.3.3",
-                "phpspec/prophecy": "^1.3.1",
-                "phpunit/php-code-coverage": "~2.1",
-                "phpunit/php-file-iterator": "~1.4",
-                "phpunit/php-text-template": "~1.2",
-                "phpunit/php-timer": "^1.0.6",
-                "phpunit/phpunit-mock-objects": "~2.3",
-                "sebastian/comparator": "~1.1",
-                "sebastian/diff": "~1.2",
-                "sebastian/environment": "~1.3",
-                "sebastian/exporter": "~1.2",
-                "sebastian/global-state": "~1.0",
-                "sebastian/version": "~1.0",
-                "symfony/yaml": "~2.1|~3.0"
-            },
-            "suggest": {
-                "phpunit/php-invoker": "~1.1"
-            },
-            "bin": [
-                "phpunit"
-            ],
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "4.8.x-dev"
-                }
-            },
-            "autoload": {
-                "classmap": [
-                    "src/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Sebastian Bergmann",
-                    "email": "sebastian@phpunit.de",
-                    "role": "lead"
-                }
-            ],
-            "description": "The PHP Unit Testing framework.",
-            "homepage": "https://phpunit.de/",
-            "keywords": [
-                "phpunit",
-                "testing",
-                "xunit"
-            ],
-            "time": "2016-07-21 06:48:14"
-        },
-        {
-            "name": "phpunit/phpunit-mock-objects",
-            "version": "2.3.8",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
-                "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983",
-                "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983",
-                "shasum": ""
-            },
-            "require": {
-                "doctrine/instantiator": "^1.0.2",
-                "php": ">=5.3.3",
-                "phpunit/php-text-template": "~1.2",
-                "sebastian/exporter": "~1.2"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "~4.4"
-            },
-            "suggest": {
-                "ext-soap": "*"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "2.3.x-dev"
-                }
-            },
-            "autoload": {
-                "classmap": [
-                    "src/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Sebastian Bergmann",
-                    "email": "sb@sebastian-bergmann.de",
-                    "role": "lead"
-                }
-            ],
-            "description": "Mock Object library for PHPUnit",
-            "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
-            "keywords": [
-                "mock",
-                "xunit"
-            ],
-            "time": "2015-10-02 06:51:40"
-        },
-        {
-            "name": "psr/log",
-            "version": "1.0.2",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/php-fig/log.git",
-                "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
-                "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.3.0"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.0.x-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "Psr\\Log\\": "Psr/Log/"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "PHP-FIG",
-                    "homepage": "http://www.php-fig.org/"
-                }
-            ],
-            "description": "Common interface for logging libraries",
-            "homepage": "https://github.com/php-fig/log",
-            "keywords": [
-                "log",
-                "psr",
-                "psr-3"
-            ],
-            "time": "2016-10-10 12:19:37"
-        },
-        {
-            "name": "sebastian/comparator",
-            "version": "1.2.0",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/sebastianbergmann/comparator.git",
-                "reference": "937efb279bd37a375bcadf584dec0726f84dbf22"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22",
-                "reference": "937efb279bd37a375bcadf584dec0726f84dbf22",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.3.3",
-                "sebastian/diff": "~1.2",
-                "sebastian/exporter": "~1.2"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "~4.4"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.2.x-dev"
-                }
-            },
-            "autoload": {
-                "classmap": [
-                    "src/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Jeff Welch",
-                    "email": "whatthejeff@gmail.com"
-                },
-                {
-                    "name": "Volker Dusch",
-                    "email": "github@wallbash.com"
-                },
-                {
-                    "name": "Bernhard Schussek",
-                    "email": "bschussek@2bepublished.at"
-                },
-                {
-                    "name": "Sebastian Bergmann",
-                    "email": "sebastian@phpunit.de"
-                }
-            ],
-            "description": "Provides the functionality to compare PHP values for equality",
-            "homepage": "http://www.github.com/sebastianbergmann/comparator",
-            "keywords": [
-                "comparator",
-                "compare",
-                "equality"
-            ],
-            "time": "2015-07-26 15:48:44"
-        },
-        {
-            "name": "sebastian/diff",
-            "version": "1.4.1",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/sebastianbergmann/diff.git",
-                "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e",
-                "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.3.3"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "~4.8"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.4-dev"
-                }
-            },
-            "autoload": {
-                "classmap": [
-                    "src/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Kore Nordmann",
-                    "email": "mail@kore-nordmann.de"
-                },
-                {
-                    "name": "Sebastian Bergmann",
-                    "email": "sebastian@phpunit.de"
-                }
-            ],
-            "description": "Diff implementation",
-            "homepage": "https://github.com/sebastianbergmann/diff",
-            "keywords": [
-                "diff"
-            ],
-            "time": "2015-12-08 07:14:41"
-        },
-        {
-            "name": "sebastian/environment",
-            "version": "1.3.8",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/sebastianbergmann/environment.git",
-                "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea",
-                "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea",
-                "shasum": ""
-            },
-            "require": {
-                "php": "^5.3.3 || ^7.0"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "^4.8 || ^5.0"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.3.x-dev"
-                }
-            },
-            "autoload": {
-                "classmap": [
-                    "src/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Sebastian Bergmann",
-                    "email": "sebastian@phpunit.de"
-                }
-            ],
-            "description": "Provides functionality to handle HHVM/PHP environments",
-            "homepage": "http://www.github.com/sebastianbergmann/environment",
-            "keywords": [
-                "Xdebug",
-                "environment",
-                "hhvm"
-            ],
-            "time": "2016-08-18 05:49:44"
-        },
-        {
-            "name": "sebastian/exporter",
-            "version": "1.2.2",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/sebastianbergmann/exporter.git",
-                "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4",
-                "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.3.3",
-                "sebastian/recursion-context": "~1.0"
-            },
-            "require-dev": {
-                "ext-mbstring": "*",
-                "phpunit/phpunit": "~4.4"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.3.x-dev"
-                }
-            },
-            "autoload": {
-                "classmap": [
-                    "src/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Jeff Welch",
-                    "email": "whatthejeff@gmail.com"
-                },
-                {
-                    "name": "Volker Dusch",
-                    "email": "github@wallbash.com"
-                },
-                {
-                    "name": "Bernhard Schussek",
-                    "email": "bschussek@2bepublished.at"
-                },
-                {
-                    "name": "Sebastian Bergmann",
-                    "email": "sebastian@phpunit.de"
-                },
-                {
-                    "name": "Adam Harvey",
-                    "email": "aharvey@php.net"
-                }
-            ],
-            "description": "Provides the functionality to export PHP variables for visualization",
-            "homepage": "http://www.github.com/sebastianbergmann/exporter",
-            "keywords": [
-                "export",
-                "exporter"
-            ],
-            "time": "2016-06-17 09:04:28"
-        },
-        {
-            "name": "sebastian/global-state",
-            "version": "1.1.1",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/sebastianbergmann/global-state.git",
-                "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
-                "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.3.3"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "~4.2"
-            },
-            "suggest": {
-                "ext-uopz": "*"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.0-dev"
-                }
-            },
-            "autoload": {
-                "classmap": [
-                    "src/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Sebastian Bergmann",
-                    "email": "sebastian@phpunit.de"
-                }
-            ],
-            "description": "Snapshotting of global state",
-            "homepage": "http://www.github.com/sebastianbergmann/global-state",
-            "keywords": [
-                "global state"
-            ],
-            "time": "2015-10-12 03:26:01"
-        },
-        {
-            "name": "sebastian/recursion-context",
-            "version": "1.0.2",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/sebastianbergmann/recursion-context.git",
-                "reference": "913401df809e99e4f47b27cdd781f4a258d58791"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791",
-                "reference": "913401df809e99e4f47b27cdd781f4a258d58791",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.3.3"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "~4.4"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.0.x-dev"
-                }
-            },
-            "autoload": {
-                "classmap": [
-                    "src/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Jeff Welch",
-                    "email": "whatthejeff@gmail.com"
-                },
-                {
-                    "name": "Sebastian Bergmann",
-                    "email": "sebastian@phpunit.de"
-                },
-                {
-                    "name": "Adam Harvey",
-                    "email": "aharvey@php.net"
-                }
-            ],
-            "description": "Provides functionality to recursively process PHP variables",
-            "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
-            "time": "2015-11-11 19:50:13"
-        },
-        {
-            "name": "sebastian/version",
-            "version": "1.0.6",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/sebastianbergmann/version.git",
-                "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
-                "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
-                "shasum": ""
-            },
-            "type": "library",
-            "autoload": {
-                "classmap": [
-                    "src/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Sebastian Bergmann",
-                    "email": "sebastian@phpunit.de",
-                    "role": "lead"
-                }
-            ],
-            "description": "Library that helps with managing the version number of Git-hosted PHP projects",
-            "homepage": "https://github.com/sebastianbergmann/version",
-            "time": "2015-06-21 13:59:46"
-        },
-        {
-            "name": "squizlabs/php_codesniffer",
-            "version": "2.7.0",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
-                "reference": "571e27b6348e5b3a637b2abc82ac0d01e6d7bbed"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/571e27b6348e5b3a637b2abc82ac0d01e6d7bbed",
-                "reference": "571e27b6348e5b3a637b2abc82ac0d01e6d7bbed",
-                "shasum": ""
-            },
-            "require": {
-                "ext-simplexml": "*",
-                "ext-tokenizer": "*",
-                "ext-xmlwriter": "*",
-                "php": ">=5.1.2"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "~4.0"
-            },
-            "bin": [
-                "scripts/phpcs",
-                "scripts/phpcbf"
-            ],
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "2.x-dev"
-                }
-            },
-            "autoload": {
-                "classmap": [
-                    "CodeSniffer.php",
-                    "CodeSniffer/CLI.php",
-                    "CodeSniffer/Exception.php",
-                    "CodeSniffer/File.php",
-                    "CodeSniffer/Fixer.php",
-                    "CodeSniffer/Report.php",
-                    "CodeSniffer/Reporting.php",
-                    "CodeSniffer/Sniff.php",
-                    "CodeSniffer/Tokens.php",
-                    "CodeSniffer/Reports/",
-                    "CodeSniffer/Tokenizers/",
-                    "CodeSniffer/DocGenerators/",
-                    "CodeSniffer/Standards/AbstractPatternSniff.php",
-                    "CodeSniffer/Standards/AbstractScopeSniff.php",
-                    "CodeSniffer/Standards/AbstractVariableSniff.php",
-                    "CodeSniffer/Standards/IncorrectPatternException.php",
-                    "CodeSniffer/Standards/Generic/Sniffs/",
-                    "CodeSniffer/Standards/MySource/Sniffs/",
-                    "CodeSniffer/Standards/PEAR/Sniffs/",
-                    "CodeSniffer/Standards/PSR1/Sniffs/",
-                    "CodeSniffer/Standards/PSR2/Sniffs/",
-                    "CodeSniffer/Standards/Squiz/Sniffs/",
-                    "CodeSniffer/Standards/Zend/Sniffs/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Greg Sherwood",
-                    "role": "lead"
-                }
-            ],
-            "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
-            "homepage": "http://www.squizlabs.com/php-codesniffer",
-            "keywords": [
-                "phpcs",
-                "standards"
-            ],
-            "time": "2016-09-01 23:53:02"
-        },
-        {
-            "name": "symfony/config",
-            "version": "v3.1.6",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/symfony/config.git",
-                "reference": "949e7e846743a7f9e46dc50eb639d5fde1f53341"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/symfony/config/zipball/949e7e846743a7f9e46dc50eb639d5fde1f53341",
-                "reference": "949e7e846743a7f9e46dc50eb639d5fde1f53341",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.5.9",
-                "symfony/filesystem": "~2.8|~3.0"
-            },
-            "suggest": {
-                "symfony/yaml": "To use the yaml reference dumper"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "3.1-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "Symfony\\Component\\Config\\": ""
-                },
-                "exclude-from-classmap": [
-                    "/Tests/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Fabien Potencier",
-                    "email": "fabien@symfony.com"
-                },
-                {
-                    "name": "Symfony Community",
-                    "homepage": "https://symfony.com/contributors"
-                }
-            ],
-            "description": "Symfony Config Component",
-            "homepage": "https://symfony.com",
-            "time": "2016-09-25 08:27:07"
-        },
-        {
-            "name": "symfony/console",
-            "version": "v2.8.13",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/symfony/console.git",
-                "reference": "7350016c8abcab897046f1aead2b766b84d3eff8"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/symfony/console/zipball/7350016c8abcab897046f1aead2b766b84d3eff8",
-                "reference": "7350016c8abcab897046f1aead2b766b84d3eff8",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.3.9",
-                "symfony/debug": "~2.7,>=2.7.2|~3.0.0",
-                "symfony/polyfill-mbstring": "~1.0"
-            },
-            "require-dev": {
-                "psr/log": "~1.0",
-                "symfony/event-dispatcher": "~2.1|~3.0.0",
-                "symfony/process": "~2.1|~3.0.0"
-            },
-            "suggest": {
-                "psr/log": "For using the console logger",
-                "symfony/event-dispatcher": "",
-                "symfony/process": ""
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "2.8-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "Symfony\\Component\\Console\\": ""
-                },
-                "exclude-from-classmap": [
-                    "/Tests/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Fabien Potencier",
-                    "email": "fabien@symfony.com"
-                },
-                {
-                    "name": "Symfony Community",
-                    "homepage": "https://symfony.com/contributors"
-                }
-            ],
-            "description": "Symfony Console Component",
-            "homepage": "https://symfony.com",
-            "time": "2016-10-06 01:43:09"
-        },
-        {
-            "name": "symfony/debug",
-            "version": "v3.0.9",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/symfony/debug.git",
-                "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/symfony/debug/zipball/697c527acd9ea1b2d3efac34d9806bf255278b0a",
-                "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.5.9",
-                "psr/log": "~1.0"
-            },
-            "conflict": {
-                "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
-            },
-            "require-dev": {
-                "symfony/class-loader": "~2.8|~3.0",
-                "symfony/http-kernel": "~2.8|~3.0"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "3.0-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "Symfony\\Component\\Debug\\": ""
-                },
-                "exclude-from-classmap": [
-                    "/Tests/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Fabien Potencier",
-                    "email": "fabien@symfony.com"
-                },
-                {
-                    "name": "Symfony Community",
-                    "homepage": "https://symfony.com/contributors"
-                }
-            ],
-            "description": "Symfony Debug Component",
-            "homepage": "https://symfony.com",
-            "time": "2016-07-30 07:22:48"
-        },
-        {
-            "name": "symfony/dependency-injection",
-            "version": "v3.1.6",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/symfony/dependency-injection.git",
-                "reference": "c578891216090069cd6d2e573402e13e39b3ad5c"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/c578891216090069cd6d2e573402e13e39b3ad5c",
-                "reference": "c578891216090069cd6d2e573402e13e39b3ad5c",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.5.9"
-            },
-            "require-dev": {
-                "symfony/config": "~2.8|~3.0",
-                "symfony/expression-language": "~2.8|~3.0",
-                "symfony/yaml": "~2.8.7|~3.0.7|~3.1.1|~3.2"
-            },
-            "suggest": {
-                "symfony/config": "",
-                "symfony/expression-language": "For using expressions in service container configuration",
-                "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
-                "symfony/yaml": ""
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "3.1-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "Symfony\\Component\\DependencyInjection\\": ""
-                },
-                "exclude-from-classmap": [
-                    "/Tests/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Fabien Potencier",
-                    "email": "fabien@symfony.com"
-                },
-                {
-                    "name": "Symfony Community",
-                    "homepage": "https://symfony.com/contributors"
-                }
-            ],
-            "description": "Symfony DependencyInjection Component",
-            "homepage": "https://symfony.com",
-            "time": "2016-10-24 15:52:44"
-        },
-        {
-            "name": "symfony/filesystem",
-            "version": "v3.1.6",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/symfony/filesystem.git",
-                "reference": "0565b61bf098cb4dc09f4f103f033138ae4f42c6"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/symfony/filesystem/zipball/0565b61bf098cb4dc09f4f103f033138ae4f42c6",
-                "reference": "0565b61bf098cb4dc09f4f103f033138ae4f42c6",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.5.9"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "3.1-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "Symfony\\Component\\Filesystem\\": ""
-                },
-                "exclude-from-classmap": [
-                    "/Tests/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Fabien Potencier",
-                    "email": "fabien@symfony.com"
-                },
-                {
-                    "name": "Symfony Community",
-                    "homepage": "https://symfony.com/contributors"
-                }
-            ],
-            "description": "Symfony Filesystem Component",
-            "homepage": "https://symfony.com",
-            "time": "2016-10-18 04:30:12"
-        },
-        {
-            "name": "symfony/polyfill-mbstring",
-            "version": "v1.2.0",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/symfony/polyfill-mbstring.git",
-                "reference": "dff51f72b0706335131b00a7f49606168c582594"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594",
-                "reference": "dff51f72b0706335131b00a7f49606168c582594",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.3.3"
-            },
-            "suggest": {
-                "ext-mbstring": "For best performance"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.2-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "Symfony\\Polyfill\\Mbstring\\": ""
-                },
-                "files": [
-                    "bootstrap.php"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Nicolas Grekas",
-                    "email": "p@tchwork.com"
-                },
-                {
-                    "name": "Symfony Community",
-                    "homepage": "https://symfony.com/contributors"
-                }
-            ],
-            "description": "Symfony polyfill for the Mbstring extension",
-            "homepage": "https://symfony.com",
-            "keywords": [
-                "compatibility",
-                "mbstring",
-                "polyfill",
-                "portable",
-                "shim"
-            ],
-            "time": "2016-05-18 14:26:46"
-        },
-        {
-            "name": "symfony/yaml",
-            "version": "v3.1.6",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/symfony/yaml.git",
-                "reference": "7ff51b06c6c3d5cc6686df69004a42c69df09e27"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/symfony/yaml/zipball/7ff51b06c6c3d5cc6686df69004a42c69df09e27",
-                "reference": "7ff51b06c6c3d5cc6686df69004a42c69df09e27",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.5.9"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "3.1-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "Symfony\\Component\\Yaml\\": ""
-                },
-                "exclude-from-classmap": [
-                    "/Tests/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Fabien Potencier",
-                    "email": "fabien@symfony.com"
-                },
-                {
-                    "name": "Symfony Community",
-                    "homepage": "https://symfony.com/contributors"
-                }
-            ],
-            "description": "Symfony Yaml Component",
-            "homepage": "https://symfony.com",
-            "time": "2016-10-24 18:41:13"
-        },
-        {
-            "name": "webmozart/assert",
-            "version": "1.1.0",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/webmozart/assert.git",
-                "reference": "bb2d123231c095735130cc8f6d31385a44c7b308"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/webmozart/assert/zipball/bb2d123231c095735130cc8f6d31385a44c7b308",
-                "reference": "bb2d123231c095735130cc8f6d31385a44c7b308",
-                "shasum": ""
-            },
-            "require": {
-                "php": "^5.3.3|^7.0"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "^4.6",
-                "sebastian/version": "^1.0.1"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.2-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "Webmozart\\Assert\\": "src/"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Bernhard Schussek",
-                    "email": "bschussek@gmail.com"
-                }
-            ],
-            "description": "Assertions to validate method input/output with nice error messages.",
-            "keywords": [
-                "assert",
-                "check",
-                "validate"
-            ],
-            "time": "2016-08-09 15:02:57"
-        }
-    ],
-    "aliases": [],
-    "minimum-stability": "stable",
-    "stability-flags": [],
-    "prefer-stable": false,
-    "prefer-lowest": false,
-    "platform": {
-        "php": ">=5.5",
-        "ext-openssl": "*"
-    },
-    "platform-dev": []
-}

+ 6 - 12
api/vendor/lcobucci/jwt/phpunit.xml.dist

@@ -1,16 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
-    backupGlobals="false" 
-    backupStaticAttributes="false" 
-    bootstrap="vendor/autoload.php"
-    colors="true" 
+    colors="true"
     verbose="true"
     beStrictAboutOutputDuringTests="true"
-    beStrictAboutTestSize="true"
-    beStrictAboutTestsThatDoNotTestAnything="true"
     beStrictAboutTodoAnnotatedTests="true"
-    checkForUnintentionallyCoveredCode="true"
+    beStrictAboutChangesToGlobalState="true"
+    beStrictAboutCoversAnnotation="true"
+    beStrictAboutResourceUsageDuringSmallTests="true"
+    beStrictAboutTestsThatDoNotTestAnything="true"
     forceCoversAnnotation="true">
 	<testsuites>
 		<testsuite name="Unit Test Suite">
@@ -20,14 +18,10 @@
 			<directory>test/functional</directory>
 		</testsuite>
 	</testsuites>
-    
+
     <filter>
         <whitelist processUncoveredFilesFromWhitelist="true">
             <directory suffix=".php">src</directory>
         </whitelist>
-        
-        <blacklist>
-            <directory suffix=".php">vendor</directory>
-        </blacklist>
     </filter>
 </phpunit>

+ 237 - 42
api/vendor/lcobucci/jwt/src/Builder.php

@@ -7,10 +7,10 @@
 
 namespace Lcobucci\JWT;
 
-use BadMethodCallException;
 use Lcobucci\JWT\Claim\Factory as ClaimFactory;
 use Lcobucci\JWT\Parsing\Encoder;
 use Lcobucci\JWT\Signer\Key;
+use function implode;
 
 /**
  * This class makes easier the token creation process
@@ -25,21 +25,14 @@ class Builder
      *
      * @var array
      */
-    private $headers;
+    private $headers = ['typ'=> 'JWT', 'alg' => 'none'];
 
     /**
      * The token claim set
      *
      * @var array
      */
-    private $claims;
-
-    /**
-     * The token signature
-     *
-     * @var Signature
-     */
-    private $signature;
+    private $claims = [];
 
     /**
      * The data encoder
@@ -55,6 +48,16 @@ class Builder
      */
     private $claimFactory;
 
+    /**
+     * @var Signer|null
+     */
+    private $signer;
+
+    /**
+     * @var Key|null
+     */
+    private $key;
+
     /**
      * Initializes a new builder
      *
@@ -67,14 +70,44 @@ class Builder
     ) {
         $this->encoder = $encoder ?: new Encoder();
         $this->claimFactory = $claimFactory ?: new ClaimFactory();
-        $this->headers = ['typ'=> 'JWT', 'alg' => 'none'];
-        $this->claims = [];
+    }
+
+    /**
+     * Configures the audience
+     *
+     * @deprecated This method has been wrongly added and doesn't exist on v4
+     * @see Builder::permittedFor()
+     *
+     * @param string $audience
+     * @param bool $replicateAsHeader
+     *
+     * @return Builder
+     */
+    public function canOnlyBeUsedBy($audience, $replicateAsHeader = false)
+    {
+        return $this->setRegisteredClaim('aud', (string) $audience, $replicateAsHeader);
     }
 
     /**
      * Configures the audience
      *
      * @param string $audience
+     * @param bool $replicateAsHeader
+     *
+     * @return Builder
+     */
+    public function permittedFor($audience, $replicateAsHeader = false)
+    {
+        return $this->setRegisteredClaim('aud', (string) $audience, $replicateAsHeader);
+    }
+
+    /**
+     * Configures the audience
+     *
+     * @deprecated This method will be removed on v4
+     * @see Builder::permittedFor()
+     *
+     * @param string $audience
      * @param boolean $replicateAsHeader
      *
      * @return Builder
@@ -92,6 +125,22 @@ class Builder
      *
      * @return Builder
      */
+    public function expiresAt($expiration, $replicateAsHeader = false)
+    {
+        return $this->setRegisteredClaim('exp', (int) $expiration, $replicateAsHeader);
+    }
+
+    /**
+     * Configures the expiration time
+     *
+     * @deprecated This method will be removed on v4
+     * @see Builder::expiresAt()
+     *
+     * @param int $expiration
+     * @param boolean $replicateAsHeader
+     *
+     * @return Builder
+     */
     public function setExpiration($expiration, $replicateAsHeader = false)
     {
         return $this->setRegisteredClaim('exp', (int) $expiration, $replicateAsHeader);
@@ -105,11 +154,27 @@ class Builder
      *
      * @return Builder
      */
-    public function setId($id, $replicateAsHeader = false)
+    public function identifiedBy($id, $replicateAsHeader = false)
     {
         return $this->setRegisteredClaim('jti', (string) $id, $replicateAsHeader);
     }
 
+    /**
+     * Configures the token id
+     *
+     * @deprecated This method will be removed on v4
+     * @see Builder::identifiedBy()
+     *
+     * @param string $id
+     * @param boolean $replicateAsHeader
+     *
+     * @return Builder
+     */
+    public function setId($id, $replicateAsHeader = false)
+    {
+        return $this->identifiedBy($id, $replicateAsHeader);
+    }
+
     /**
      * Configures the time that the token was issued
      *
@@ -118,11 +183,27 @@ class Builder
      *
      * @return Builder
      */
-    public function setIssuedAt($issuedAt, $replicateAsHeader = false)
+    public function issuedAt($issuedAt, $replicateAsHeader = false)
     {
         return $this->setRegisteredClaim('iat', (int) $issuedAt, $replicateAsHeader);
     }
 
+    /**
+     * Configures the time that the token was issued
+     *
+     * @deprecated This method will be removed on v4
+     * @see Builder::issuedAt()
+     *
+     * @param int $issuedAt
+     * @param boolean $replicateAsHeader
+     *
+     * @return Builder
+     */
+    public function setIssuedAt($issuedAt, $replicateAsHeader = false)
+    {
+        return $this->issuedAt($issuedAt, $replicateAsHeader);
+    }
+
     /**
      * Configures the issuer
      *
@@ -131,11 +212,27 @@ class Builder
      *
      * @return Builder
      */
-    public function setIssuer($issuer, $replicateAsHeader = false)
+    public function issuedBy($issuer, $replicateAsHeader = false)
     {
         return $this->setRegisteredClaim('iss', (string) $issuer, $replicateAsHeader);
     }
 
+    /**
+     * Configures the issuer
+     *
+     * @deprecated This method will be removed on v4
+     * @see Builder::issuedBy()
+     *
+     * @param string $issuer
+     * @param boolean $replicateAsHeader
+     *
+     * @return Builder
+     */
+    public function setIssuer($issuer, $replicateAsHeader = false)
+    {
+        return $this->issuedBy($issuer, $replicateAsHeader);
+    }
+
     /**
      * Configures the time before which the token cannot be accepted
      *
@@ -144,11 +241,27 @@ class Builder
      *
      * @return Builder
      */
-    public function setNotBefore($notBefore, $replicateAsHeader = false)
+    public function canOnlyBeUsedAfter($notBefore, $replicateAsHeader = false)
     {
         return $this->setRegisteredClaim('nbf', (int) $notBefore, $replicateAsHeader);
     }
 
+    /**
+     * Configures the time before which the token cannot be accepted
+     *
+     * @deprecated This method will be removed on v4
+     * @see Builder::canOnlyBeUsedAfter()
+     *
+     * @param int $notBefore
+     * @param boolean $replicateAsHeader
+     *
+     * @return Builder
+     */
+    public function setNotBefore($notBefore, $replicateAsHeader = false)
+    {
+        return $this->canOnlyBeUsedAfter($notBefore, $replicateAsHeader);
+    }
+
     /**
      * Configures the subject
      *
@@ -157,13 +270,29 @@ class Builder
      *
      * @return Builder
      */
-    public function setSubject($subject, $replicateAsHeader = false)
+    public function relatedTo($subject, $replicateAsHeader = false)
     {
         return $this->setRegisteredClaim('sub', (string) $subject, $replicateAsHeader);
     }
 
     /**
-     * Configures a registed claim
+     * Configures the subject
+     *
+     * @deprecated This method will be removed on v4
+     * @see Builder::relatedTo()
+     *
+     * @param string $subject
+     * @param boolean $replicateAsHeader
+     *
+     * @return Builder
+     */
+    public function setSubject($subject, $replicateAsHeader = false)
+    {
+        return $this->relatedTo($subject, $replicateAsHeader);
+    }
+
+    /**
+     * Configures a registered claim
      *
      * @param string $name
      * @param mixed $value
@@ -173,7 +302,7 @@ class Builder
      */
     protected function setRegisteredClaim($name, $value, $replicate)
     {
-        $this->set($name, $value);
+        $this->withClaim($name, $value);
 
         if ($replicate) {
             $this->headers[$name] = $this->claims[$name];
@@ -189,44 +318,83 @@ class Builder
      * @param mixed $value
      *
      * @return Builder
-     *
-     * @throws BadMethodCallException When data has been already signed
      */
-    public function setHeader($name, $value)
+    public function withHeader($name, $value)
     {
-        if ($this->signature) {
-            throw new BadMethodCallException('You must unsign before make changes');
-        }
-
         $this->headers[(string) $name] = $this->claimFactory->create($name, $value);
 
         return $this;
     }
 
     /**
-     * Configures a claim item
+     * Configures a header item
+     *
+     * @deprecated This method will be removed on v4
+     * @see Builder::withHeader()
      *
      * @param string $name
      * @param mixed $value
      *
      * @return Builder
+     */
+    public function setHeader($name, $value)
+    {
+        return $this->withHeader($name, $value);
+    }
+
+    /**
+     * Configures a claim item
+     *
+     * @deprecated This method has been wrongly added and doesn't exist on v4
+     * @see Builder::withClaim()
      *
-     * @throws BadMethodCallException When data has been already signed
+     * @param string $name
+     * @param mixed $value
+     *
+     * @return Builder
      */
-    public function set($name, $value)
+    public function with($name, $value)
     {
-        if ($this->signature) {
-            throw new BadMethodCallException('You must unsign before making changes');
-        }
+        return $this->withClaim($name, $value);
+    }
 
+    /**
+     * Configures a claim item
+     *
+     * @param string $name
+     * @param mixed $value
+     *
+     * @return Builder
+     */
+    public function withClaim($name, $value)
+    {
         $this->claims[(string) $name] = $this->claimFactory->create($name, $value);
 
         return $this;
     }
 
+    /**
+     * Configures a claim item
+     *
+     * @deprecated This method will be removed on v4
+     * @see Builder::withClaim()
+     *
+     * @param string $name
+     * @param mixed $value
+     *
+     * @return Builder
+     */
+    public function set($name, $value)
+    {
+        return $this->withClaim($name, $value);
+    }
+
     /**
      * Signs the data
      *
+     * @deprecated This method will be removed on v4
+     * @see Builder::getToken()
+     *
      * @param Signer $signer
      * @param Key|string $key
      *
@@ -234,12 +402,12 @@ class Builder
      */
     public function sign(Signer $signer, $key)
     {
-        $signer->modifyHeader($this->headers);
+        if (! $key instanceof Key) {
+            $key = new Key($key);
+        }
 
-        $this->signature = $signer->sign(
-            $this->getToken()->getPayload(),
-            $key
-        );
+        $this->signer = $signer;
+        $this->key = $key;
 
         return $this;
     }
@@ -247,11 +415,15 @@ class Builder
     /**
      * Removes the signature from the builder
      *
+     * @deprecated This method will be removed on v4
+     * @see Builder::getToken()
+     *
      * @return Builder
      */
     public function unsign()
     {
-        $this->signature = null;
+        $this->signer = null;
+        $this->key = null;
 
         return $this;
     }
@@ -261,17 +433,40 @@ class Builder
      *
      * @return Token
      */
-    public function getToken()
+    public function getToken(Signer $signer = null, Key $key = null)
     {
+        $signer = $signer ?: $this->signer;
+        $key = $key ?: $this->key;
+
+        if ($signer instanceof Signer) {
+            $signer->modifyHeader($this->headers);
+        }
+
         $payload = [
             $this->encoder->base64UrlEncode($this->encoder->jsonEncode($this->headers)),
             $this->encoder->base64UrlEncode($this->encoder->jsonEncode($this->claims))
         ];
 
-        if ($this->signature !== null) {
-            $payload[] = $this->encoder->base64UrlEncode($this->signature);
+        $signature = $this->createSignature($payload, $signer, $key);
+
+        if ($signature !== null) {
+            $payload[] = $this->encoder->base64UrlEncode($signature);
+        }
+
+        return new Token($this->headers, $this->claims, $signature, $payload);
+    }
+
+    /**
+     * @param string[] $payload
+     *
+     * @return Signature|null
+     */
+    private function createSignature(array $payload, Signer $signer = null, Key $key = null)
+    {
+        if ($signer === null || $key === null) {
+            return null;
         }
 
-        return new Token($this->headers, $this->claims, $this->signature, $payload);
+        return $signer->sign(implode('.', $payload), $key);
     }
 }

+ 2 - 0
api/vendor/lcobucci/jwt/src/Claim/Basic.php

@@ -12,6 +12,8 @@ use Lcobucci\JWT\Claim;
 /**
  * The default claim
  *
+ * @deprecated This class will be removed on v4
+ *
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.0.0
  */

+ 2 - 0
api/vendor/lcobucci/jwt/src/Claim/EqualsTo.php

@@ -13,6 +13,8 @@ use Lcobucci\JWT\ValidationData;
 /**
  * Validatable claim that checks if value is strictly equals to the given data
  *
+ * @deprecated This class will be removed on v4
+ *
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.0.0
  */

+ 2 - 0
api/vendor/lcobucci/jwt/src/Claim/Factory.php

@@ -12,6 +12,8 @@ use Lcobucci\JWT\Claim;
 /**
  * Class that create claims
  *
+ * @deprecated This class will be removed on v4
+ *
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.0.0
  */

+ 2 - 0
api/vendor/lcobucci/jwt/src/Claim/GreaterOrEqualsTo.php

@@ -13,6 +13,8 @@ use Lcobucci\JWT\ValidationData;
 /**
  * Validatable claim that checks if value is greater or equals the given data
  *
+ * @deprecated This class will be removed on v4
+ *
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.0.0
  */

+ 2 - 0
api/vendor/lcobucci/jwt/src/Claim/LesserOrEqualsTo.php

@@ -13,6 +13,8 @@ use Lcobucci\JWT\ValidationData;
 /**
  * Validatable claim that checks if value is lesser or equals to the given data
  *
+ * @deprecated This class will be removed on v4
+ *
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.0.0
  */

+ 2 - 0
api/vendor/lcobucci/jwt/src/Claim/Validatable.php

@@ -12,6 +12,8 @@ use Lcobucci\JWT\ValidationData;
 /**
  * Basic interface for validatable token claims
  *
+ * @deprecated This interface will be removed on v4
+ *
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.0.0
  */

+ 8 - 1
api/vendor/lcobucci/jwt/src/Signer/BaseSigner.php

@@ -13,6 +13,8 @@ use Lcobucci\JWT\Signer;
 /**
  * Base class for signers
  *
+ * @deprecated This class will be removed on v4
+ *
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 0.1.0
  */
@@ -59,6 +61,8 @@ abstract class BaseSigner implements Signer
     /**
      * Creates a hash with the given data
      *
+     * @internal
+     *
      * @param string $payload
      * @param Key $key
      *
@@ -67,8 +71,11 @@ abstract class BaseSigner implements Signer
     abstract public function createHash($payload, Key $key);
 
     /**
-     * Creates a hash with the given data
+     * Performs the signature verification
+     *
+     * @internal
      *
+     * @param string $expected
      * @param string $payload
      * @param Key $key
      *

+ 24 - 104
api/vendor/lcobucci/jwt/src/Signer/Ecdsa.php

@@ -7,13 +7,9 @@
 
 namespace Lcobucci\JWT\Signer;
 
-use Lcobucci\JWT\Signer\Ecdsa\KeyParser;
-use Mdanter\Ecc\Crypto\Signature\Signature;
-use Mdanter\Ecc\Crypto\Signature\Signer;
-use Mdanter\Ecc\EccFactory;
-use Mdanter\Ecc\Math\MathAdapterInterface as Adapter;
-use Mdanter\Ecc\Random\RandomGeneratorFactory;
-use Mdanter\Ecc\Random\RandomNumberGeneratorInterface;
+use Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter;
+use Lcobucci\JWT\Signer\Ecdsa\SignatureConverter;
+use const OPENSSL_KEYTYPE_EC;
 
 /**
  * Base class for ECDSA signers
@@ -21,129 +17,53 @@ use Mdanter\Ecc\Random\RandomNumberGeneratorInterface;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.1.0
  */
-abstract class Ecdsa extends BaseSigner
+abstract class Ecdsa extends OpenSSL
 {
     /**
-     * @var Adapter
+     * @var SignatureConverter
      */
-    private $adapter;
+    private $converter;
 
-    /**
-     * @var Signer
-     */
-    private $signer;
-
-    /**
-     * @var KeyParser
-     */
-    private $parser;
-
-    /**
-     * @param Adapter $adapter
-     * @param EcdsaSigner $signer
-     * @param KeyParser $parser
-     */
-    public function __construct(Adapter $adapter = null, Signer $signer = null, KeyParser $parser = null)
+    public function __construct(SignatureConverter $converter = null)
     {
-        $this->adapter = $adapter ?: EccFactory::getAdapter();
-        $this->signer = $signer ?: EccFactory::getSigner($this->adapter);
-        $this->parser = $parser ?: new KeyParser($this->adapter);
+        $this->converter = $converter ?: new MultibyteStringConverter();
     }
 
     /**
      * {@inheritdoc}
      */
-    public function createHash(
-        $payload,
-        Key $key,
-        RandomNumberGeneratorInterface $generator = null
-    ) {
-        $privateKey = $this->parser->getPrivateKey($key);
-        $generator = $generator ?: RandomGeneratorFactory::getRandomGenerator();
-
-        return $this->createSignatureHash(
-            $this->signer->sign(
-                $privateKey,
-                $this->createSigningHash($payload),
-                $generator->generate($privateKey->getPoint()->getOrder())
-            )
-        );
-    }
-
-    /**
-     * Creates a binary signature with R and S coordinates
-     *
-     * @param Signature $signature
-     *
-     * @return string
-     */
-    private function createSignatureHash(Signature $signature)
+    public function createHash($payload, Key $key)
     {
-        $length = $this->getSignatureLength();
-
-        return pack(
-            'H*',
-            sprintf(
-                '%s%s',
-                str_pad($this->adapter->decHex($signature->getR()), $length, '0', STR_PAD_LEFT),
-                str_pad($this->adapter->decHex($signature->getS()), $length, '0', STR_PAD_LEFT)
-            )
+        return $this->converter->fromAsn1(
+            parent::createHash($payload, $key),
+            $this->getKeyLength()
         );
     }
 
-    /**
-     * Creates a hash using the signer algorithm with given payload
-     *
-     * @param string $payload
-     *
-     * @return int|string
-     */
-    private function createSigningHash($payload)
-    {
-        return $this->adapter->hexDec(hash($this->getAlgorithm(), $payload));
-    }
-
     /**
      * {@inheritdoc}
      */
     public function doVerify($expected, $payload, Key $key)
     {
-        return $this->signer->verify(
-            $this->parser->getPublicKey($key),
-            $this->extractSignature($expected),
-            $this->createSigningHash($payload)
-        );
-    }
-
-    /**
-     * Extracts R and S values from given data
-     *
-     * @param string $value
-     *
-     * @return \Mdanter\Ecc\Crypto\Signature\Signature
-     */
-    private function extractSignature($value)
-    {
-        $length = $this->getSignatureLength();
-        $value = unpack('H*', $value)[1];
-
-        return new Signature(
-            $this->adapter->hexDec(substr($value, 0, $length)),
-            $this->adapter->hexDec(substr($value, $length))
+        return parent::doVerify(
+            $this->converter->toAsn1($expected, $this->getKeyLength()),
+            $payload,
+            $key
         );
     }
 
     /**
-     * Returns the lenght of signature parts
+     * Returns the length of each point in the signature, so that we can calculate and verify R and S points properly
      *
-     * @return int
+     * @internal
      */
-    abstract public function getSignatureLength();
+    abstract public function getKeyLength();
 
     /**
-     * Returns the name of algorithm to be used to create the signing hash
-     *
-     * @return string
+     * {@inheritdoc}
      */
-    abstract public function getAlgorithm();
+    final public function getKeyType()
+    {
+        return OPENSSL_KEYTYPE_EC;
+    }
 }

+ 0 - 102
api/vendor/lcobucci/jwt/src/Signer/Ecdsa/KeyParser.php

@@ -1,102 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Signer\Ecdsa;
-
-use InvalidArgumentException;
-use Lcobucci\JWT\Signer\Key;
-use Mdanter\Ecc\Math\MathAdapterInterface;
-use Mdanter\Ecc\Serializer\PrivateKey\DerPrivateKeySerializer;
-use Mdanter\Ecc\Serializer\PrivateKey\PemPrivateKeySerializer;
-use Mdanter\Ecc\Serializer\PrivateKey\PrivateKeySerializerInterface;
-use Mdanter\Ecc\Serializer\PublicKey\DerPublicKeySerializer;
-use Mdanter\Ecc\Serializer\PublicKey\PemPublicKeySerializer;
-use Mdanter\Ecc\Serializer\PublicKey\PublicKeySerializerInterface;
-
-/**
- * Base class for ECDSA signers
- *
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 3.0.4
- */
-class KeyParser
-{
-    /**
-     * @var PrivateKeySerializerInterface
-     */
-    private $privateKeySerializer;
-
-    /**
-     * @var PublicKeySerializerInterface
-     */
-    private $publicKeySerializer;
-
-    /**
-     * @param MathAdapterInterface $adapter
-     * @param PrivateKeySerializerInterface $privateKeySerializer
-     * @param PublicKeySerializerInterface $publicKeySerializer
-     */
-    public function __construct(
-        MathAdapterInterface $adapter,
-        PrivateKeySerializerInterface $privateKeySerializer = null,
-        PublicKeySerializerInterface $publicKeySerializer = null
-    ) {
-        $this->privateKeySerializer = $privateKeySerializer ?: new PemPrivateKeySerializer(new DerPrivateKeySerializer($adapter));
-        $this->publicKeySerializer = $publicKeySerializer ?: new PemPublicKeySerializer(new DerPublicKeySerializer($adapter));
-    }
-
-    /**
-     * Parses a public key from the given PEM content
-     *
-     * @param Key $key
-     *
-     * @return \Mdanter\Ecc\Crypto\Key\PublicKeyInterface
-     */
-    public function getPublicKey(Key $key)
-    {
-        return $this->publicKeySerializer->parse($this->getKeyContent($key, 'PUBLIC KEY'));
-    }
-
-    /**
-     * Parses a private key from the given PEM content
-     *
-     * @param Key $key
-     *
-     * @return \Mdanter\Ecc\Crypto\Key\PrivateKeyInterface
-     */
-    public function getPrivateKey(Key $key)
-    {
-        return $this->privateKeySerializer->parse($this->getKeyContent($key, 'EC PRIVATE KEY'));
-    }
-
-    /**
-     * Extracts the base 64 value from the PEM certificate
-     *
-     * @param Key $key
-     * @param string $header
-     *
-     * @return string
-     *
-     * @throws InvalidArgumentException When given key is not a ECDSA key
-     */
-    private function getKeyContent(Key $key, $header)
-    {
-        $match = null;
-
-        preg_match(
-            '/[\-]{5}BEGIN ' . $header . '[\-]{5}(.*)[\-]{5}END ' . $header . '[\-]{5}/',
-            str_replace([PHP_EOL, "\n", "\r"], '', $key->getContent()),
-            $match
-        );
-
-        if (isset($match[1])) {
-            return $match[1];
-        }
-
-        throw new InvalidArgumentException('This is not a valid ECDSA key.');
-    }
-}

+ 134 - 0
api/vendor/lcobucci/jwt/src/Signer/Ecdsa/MultibyteStringConverter.php

@@ -0,0 +1,134 @@
+<?php
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2018 Spomky-Labs
+ *
+ * This software may be modified and distributed under the terms
+ * of the MIT license.  See the LICENSE file for details.
+ *
+ * @link https://github.com/web-token/jwt-framework/blob/v1.2/src/Component/Core/Util/ECSignature.php
+ */
+namespace Lcobucci\JWT\Signer\Ecdsa;
+
+use InvalidArgumentException;
+use function bin2hex;
+use function dechex;
+use function hex2bin;
+use function hexdec;
+use function mb_strlen;
+use function mb_substr;
+use function str_pad;
+use const STR_PAD_LEFT;
+
+/**
+ * ECDSA signature converter using ext-mbstring
+ *
+ * @internal
+ */
+final class MultibyteStringConverter implements SignatureConverter
+{
+    const ASN1_SEQUENCE          = '30';
+    const ASN1_INTEGER           = '02';
+    const ASN1_MAX_SINGLE_BYTE   = 128;
+    const ASN1_LENGTH_2BYTES     = '81';
+    const ASN1_BIG_INTEGER_LIMIT = '7f';
+    const ASN1_NEGATIVE_INTEGER  = '00';
+    const BYTE_SIZE              = 2;
+
+    public function toAsn1($signature, $length)
+    {
+        $signature = bin2hex($signature);
+
+        if (self::octetLength($signature) !== $length) {
+            throw new InvalidArgumentException('Invalid signature length.');
+        }
+
+        $pointR = self::preparePositiveInteger(mb_substr($signature, 0, $length, '8bit'));
+        $pointS = self::preparePositiveInteger(mb_substr($signature, $length, null, '8bit'));
+
+        $lengthR = self::octetLength($pointR);
+        $lengthS = self::octetLength($pointS);
+
+        $totalLength  = $lengthR + $lengthS + self::BYTE_SIZE + self::BYTE_SIZE;
+        $lengthPrefix = $totalLength > self::ASN1_MAX_SINGLE_BYTE ? self::ASN1_LENGTH_2BYTES : '';
+
+        $asn1 = hex2bin(
+            self::ASN1_SEQUENCE
+            . $lengthPrefix . dechex($totalLength)
+            . self::ASN1_INTEGER . dechex($lengthR) . $pointR
+            . self::ASN1_INTEGER . dechex($lengthS) . $pointS
+        );
+
+        return $asn1;
+    }
+
+    private static function octetLength($data)
+    {
+        return (int) (mb_strlen($data, '8bit') / self::BYTE_SIZE);
+    }
+
+    private static function preparePositiveInteger($data)
+    {
+        if (mb_substr($data, 0, self::BYTE_SIZE, '8bit') > self::ASN1_BIG_INTEGER_LIMIT) {
+            return self::ASN1_NEGATIVE_INTEGER . $data;
+        }
+
+        while (mb_substr($data, 0, self::BYTE_SIZE, '8bit') === self::ASN1_NEGATIVE_INTEGER
+            && mb_substr($data, 2, self::BYTE_SIZE, '8bit') <= self::ASN1_BIG_INTEGER_LIMIT) {
+            $data = mb_substr($data, 2, null, '8bit');
+        }
+
+        return $data;
+    }
+
+    public function fromAsn1($signature, $length)
+    {
+        $message  = bin2hex($signature);
+        $position = 0;
+
+        if (self::readAsn1Content($message, $position, self::BYTE_SIZE) !== self::ASN1_SEQUENCE) {
+            throw new InvalidArgumentException('Invalid data. Should start with a sequence.');
+        }
+
+        if (self::readAsn1Content($message, $position, self::BYTE_SIZE) === self::ASN1_LENGTH_2BYTES) {
+            $position += self::BYTE_SIZE;
+        }
+
+        $pointR = self::retrievePositiveInteger(self::readAsn1Integer($message, $position));
+        $pointS = self::retrievePositiveInteger(self::readAsn1Integer($message, $position));
+
+        $points = hex2bin(str_pad($pointR, $length, '0', STR_PAD_LEFT) . str_pad($pointS, $length, '0', STR_PAD_LEFT));
+
+        return $points;
+    }
+
+    private static function readAsn1Content($message, &$position, $length)
+    {
+        $content   = mb_substr($message, $position, $length, '8bit');
+        $position += $length;
+
+        return $content;
+    }
+
+    private static function readAsn1Integer($message, &$position)
+    {
+        if (self::readAsn1Content($message, $position, self::BYTE_SIZE) !== self::ASN1_INTEGER) {
+            throw new InvalidArgumentException('Invalid data. Should contain an integer.');
+        }
+
+        $length = (int) hexdec(self::readAsn1Content($message, $position, self::BYTE_SIZE));
+
+        return self::readAsn1Content($message, $position, $length * self::BYTE_SIZE);
+    }
+
+    private static function retrievePositiveInteger($data)
+    {
+        while (mb_substr($data, 0, self::BYTE_SIZE, '8bit') === self::ASN1_NEGATIVE_INTEGER
+            && mb_substr($data, 2, self::BYTE_SIZE, '8bit') > self::ASN1_BIG_INTEGER_LIMIT) {
+            $data = mb_substr($data, 2, null, '8bit');
+        }
+
+        return $data;
+    }
+}

+ 1 - 1
api/vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha256.php

@@ -36,7 +36,7 @@ class Sha256 extends Ecdsa
     /**
      * {@inheritdoc}
      */
-    public function getSignatureLength()
+    public function getKeyLength()
     {
         return 64;
     }

+ 1 - 1
api/vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha384.php

@@ -36,7 +36,7 @@ class Sha384 extends Ecdsa
     /**
      * {@inheritdoc}
      */
-    public function getSignatureLength()
+    public function getKeyLength()
     {
         return 96;
     }

+ 1 - 1
api/vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha512.php

@@ -36,7 +36,7 @@ class Sha512 extends Ecdsa
     /**
      * {@inheritdoc}
      */
-    public function getSignatureLength()
+    public function getKeyLength()
     {
         return 132;
     }

+ 38 - 0
api/vendor/lcobucci/jwt/src/Signer/Ecdsa/SignatureConverter.php

@@ -0,0 +1,38 @@
+<?php
+namespace Lcobucci\JWT\Signer\Ecdsa;
+
+/**
+ * Manipulates the result of a ECDSA signature (points R and S) according to the
+ * JWA specs.
+ *
+ * OpenSSL creates a signature using the ASN.1 format and, according the JWA specs,
+ * the signature for JWTs must be the concatenated values of points R and S (in
+ * big-endian octet order).
+ *
+ * @internal
+ *
+ * @see https://tools.ietf.org/html/rfc7518#page-9
+ * @see https://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One
+ */
+interface SignatureConverter
+{
+    /**
+     * Converts the signature generated by OpenSSL into what JWA defines
+     *
+     * @param string $signature
+     * @param int $length
+     *
+     * @return string
+     */
+    public function fromAsn1($signature, $length);
+
+    /**
+     * Converts the JWA signature into something OpenSSL understands
+     *
+     * @param string $points
+     * @param int $length
+     *
+     * @return string
+     */
+    public function toAsn1($points, $length);
+}

+ 4 - 0
api/vendor/lcobucci/jwt/src/Signer/Hmac.php

@@ -40,6 +40,8 @@ abstract class Hmac extends BaseSigner
     /**
      * PHP < 5.6 timing attack safe hash comparison
      *
+     * @internal
+     *
      * @param string $expected
      * @param string $generated
      *
@@ -65,6 +67,8 @@ abstract class Hmac extends BaseSigner
     /**
      * Returns the algorithm name
      *
+     * @internal
+     *
      * @return string
      */
     abstract public function getAlgorithm();

+ 13 - 6
api/vendor/lcobucci/jwt/src/Signer/Key.php

@@ -7,7 +7,9 @@
 
 namespace Lcobucci\JWT\Signer;
 
+use Exception;
 use InvalidArgumentException;
+use SplFileObject;
 
 /**
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
@@ -54,17 +56,22 @@ final class Key
      *
      * @return string
      *
-     * @throws \InvalidArgumentException
+     * @throws InvalidArgumentException
      */
     private function readFile($content)
     {
-        $file = substr($content, 7);
+        try {
+            $file    = new SplFileObject(substr($content, 7));
+            $content = '';
 
-        if (!is_readable($file)) {
-            throw new \InvalidArgumentException('You must inform a valid key file');
-        }
+            while (! $file->eof()) {
+                $content .= $file->fgets();
+            }
 
-        return file_get_contents($file);
+            return $content;
+        } catch (Exception $exception) {
+            throw new InvalidArgumentException('You must provide a valid key file', 0, $exception);
+        }
     }
 
     /**

+ 115 - 0
api/vendor/lcobucci/jwt/src/Signer/OpenSSL.php

@@ -0,0 +1,115 @@
+<?php
+namespace Lcobucci\JWT\Signer;
+
+use InvalidArgumentException;
+use Lcobucci\JWT\Signer;
+use function assert;
+use function is_array;
+use function is_resource;
+use function openssl_error_string;
+use function openssl_free_key;
+use function openssl_pkey_get_details;
+use function openssl_pkey_get_private;
+use function openssl_pkey_get_public;
+use function openssl_sign;
+use function openssl_verify;
+
+abstract class OpenSSL extends BaseSigner
+{
+    public function createHash($payload, Key $key)
+    {
+        $privateKey = $this->getPrivateKey($key->getContent(), $key->getPassphrase());
+
+        try {
+            $signature = '';
+
+            if (! openssl_sign($payload, $signature, $privateKey, $this->getAlgorithm())) {
+                throw new InvalidArgumentException(
+                    'There was an error while creating the signature: ' . openssl_error_string()
+                );
+            }
+
+            return $signature;
+        } finally {
+            openssl_free_key($privateKey);
+        }
+    }
+
+    /**
+     * @param string $pem
+     * @param string $passphrase
+     *
+     * @return resource
+     */
+    private function getPrivateKey($pem, $passphrase)
+    {
+        $privateKey = openssl_pkey_get_private($pem, $passphrase);
+        $this->validateKey($privateKey);
+
+        return $privateKey;
+    }
+
+    /**
+     * @param $expected
+     * @param $payload
+     * @param $pem
+     * @return bool
+     */
+    public function doVerify($expected, $payload, Key $key)
+    {
+        $publicKey = $this->getPublicKey($key->getContent());
+        $result    = openssl_verify($payload, $expected, $publicKey, $this->getAlgorithm());
+        openssl_free_key($publicKey);
+
+        return $result === 1;
+    }
+
+    /**
+     * @param string $pem
+     *
+     * @return resource
+     */
+    private function getPublicKey($pem)
+    {
+        $publicKey = openssl_pkey_get_public($pem);
+        $this->validateKey($publicKey);
+
+        return $publicKey;
+    }
+
+    /**
+     * Raises an exception when the key type is not the expected type
+     *
+     * @param resource|bool $key
+     *
+     * @throws InvalidArgumentException
+     */
+    private function validateKey($key)
+    {
+        if (! is_resource($key)) {
+            throw new InvalidArgumentException(
+                'It was not possible to parse your key, reason: ' . openssl_error_string()
+            );
+        }
+
+        $details = openssl_pkey_get_details($key);
+
+        if (! isset($details['key']) || $details['type'] !== $this->getKeyType()) {
+            throw new InvalidArgumentException('This key is not compatible with this signer');
+        }
+    }
+
+    /**
+     * Returns the type of key to be used to create/verify the signature (using OpenSSL constants)
+     *
+     * @internal
+     */
+    abstract public function getKeyType();
+
+    /**
+     * Returns which algorithm to be used to create/verify the signature (using OpenSSL constants)
+     *
+     * @internal
+     */
+    abstract public function getAlgorithm();
+}

+ 4 - 58
api/vendor/lcobucci/jwt/src/Signer/Rsa.php

@@ -7,7 +7,7 @@
 
 namespace Lcobucci\JWT\Signer;
 
-use InvalidArgumentException;
+use const OPENSSL_KEYTYPE_RSA;
 
 /**
  * Base class for RSASSA-PKCS1 signers
@@ -15,64 +15,10 @@ use InvalidArgumentException;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.1.0
  */
-abstract class Rsa extends BaseSigner
+abstract class Rsa extends OpenSSL
 {
-    /**
-     * {@inheritdoc}
-     */
-    public function createHash($payload, Key $key)
+    final public function getKeyType()
     {
-        $key = openssl_get_privatekey($key->getContent(), $key->getPassphrase());
-        $this->validateKey($key);
-
-        $signature = '';
-
-        if (!openssl_sign($payload, $signature, $key, $this->getAlgorithm())) {
-            throw new InvalidArgumentException(
-                'There was an error while creating the signature: ' . openssl_error_string()
-            );
-        }
-
-        return $signature;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function doVerify($expected, $payload, Key $key)
-    {
-        $key = openssl_get_publickey($key->getContent());
-        $this->validateKey($key);
-
-        return openssl_verify($payload, $expected, $key, $this->getAlgorithm()) === 1;
+        return OPENSSL_KEYTYPE_RSA;
     }
-
-    /**
-     * Validates if the given key is a valid RSA public/private key
-     *
-     * @param resource $key
-     *
-     * @throws InvalidArgumentException
-     */
-    private function validateKey($key)
-    {
-        if ($key === false) {
-            throw new InvalidArgumentException(
-                'It was not possible to parse your key, reason: ' . openssl_error_string()
-            );
-        }
-
-        $details = openssl_pkey_get_details($key);
-
-        if (!isset($details['key']) || $details['type'] !== OPENSSL_KEYTYPE_RSA) {
-            throw new InvalidArgumentException('This key is not compatible with RSA signatures');
-        }
-    }
-
-    /**
-     * Returns the algorithm name
-     *
-     * @return string
-     */
-    abstract public function getAlgorithm();
 }

+ 18 - 9
api/vendor/lcobucci/jwt/src/ValidationData.php

@@ -22,24 +22,31 @@ class ValidationData
      */
     private $items;
 
+    /**
+     * The leeway (in seconds) to use when validating time claims
+     * @var int
+     */
+    private $leeway;
+
     /**
      * Initializes the object
      *
      * @param int $currentTime
+     * @param int $leeway
      */
-    public function __construct($currentTime = null)
+    public function __construct($currentTime = null, $leeway = 0)
     {
-        $currentTime = $currentTime ?: time();
+        $currentTime  = $currentTime ?: time();
+        $this->leeway = (int) $leeway;
 
         $this->items = [
             'jti' => null,
             'iss' => null,
             'aud' => null,
-            'sub' => null,
-            'iat' => $currentTime,
-            'nbf' => $currentTime,
-            'exp' => $currentTime
+            'sub' => null
         ];
+
+        $this->setCurrentTime($currentTime);
     }
 
     /**
@@ -89,9 +96,11 @@ class ValidationData
      */
     public function setCurrentTime($currentTime)
     {
-        $this->items['iat'] = (int) $currentTime;
-        $this->items['nbf'] = (int) $currentTime;
-        $this->items['exp'] = (int) $currentTime;
+        $currentTime  = (int) $currentTime;
+
+        $this->items['iat'] = $currentTime + $this->leeway;
+        $this->items['nbf'] = $currentTime + $this->leeway;
+        $this->items['exp'] = $currentTime - $this->leeway;
     }
 
     /**

+ 22 - 14
api/vendor/lcobucci/jwt/test/functional/EcdsaTokenTest.php

@@ -21,7 +21,7 @@ use Lcobucci\JWT\Keys;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.1.0
  */
-class EcdsaTokenTest extends \PHPUnit_Framework_TestCase
+class EcdsaTokenTest extends \PHPUnit\Framework\TestCase
 {
     use Keys;
 
@@ -52,8 +52,9 @@ class EcdsaTokenTest extends \PHPUnit_Framework_TestCase
      * @covers Lcobucci\JWT\Signer\Key
      * @covers Lcobucci\JWT\Signer\BaseSigner
      * @covers Lcobucci\JWT\Signer\Ecdsa
-     * @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
      * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
      */
     public function builderShouldRaiseExceptionWhenKeyIsInvalid()
     {
@@ -63,7 +64,7 @@ class EcdsaTokenTest extends \PHPUnit_Framework_TestCase
                        ->setAudience('http://client.abc.com')
                        ->setIssuer('http://api.abc.com')
                        ->set('user', $user)
-                       ->sign($this->signer, new Key('testing'));
+                       ->getToken($this->signer, new Key('testing'));
     }
 
     /**
@@ -80,8 +81,9 @@ class EcdsaTokenTest extends \PHPUnit_Framework_TestCase
      * @covers Lcobucci\JWT\Signer\Key
      * @covers Lcobucci\JWT\Signer\BaseSigner
      * @covers Lcobucci\JWT\Signer\Ecdsa
-     * @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
      * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
      */
     public function builderShouldRaiseExceptionWhenKeyIsNotEcdsaCompatible()
     {
@@ -91,7 +93,7 @@ class EcdsaTokenTest extends \PHPUnit_Framework_TestCase
                        ->setAudience('http://client.abc.com')
                        ->setIssuer('http://api.abc.com')
                        ->set('user', $user)
-                       ->sign($this->signer, static::$rsaKeys['private']);
+                       ->getToken($this->signer, static::$rsaKeys['private']);
     }
 
     /**
@@ -106,8 +108,9 @@ class EcdsaTokenTest extends \PHPUnit_Framework_TestCase
      * @covers Lcobucci\JWT\Signer\Key
      * @covers Lcobucci\JWT\Signer\BaseSigner
      * @covers Lcobucci\JWT\Signer\Ecdsa
-     * @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
      * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
      */
     public function builderCanGenerateAToken()
     {
@@ -144,7 +147,6 @@ class EcdsaTokenTest extends \PHPUnit_Framework_TestCase
      * @covers Lcobucci\JWT\Parsing\Encoder
      * @covers Lcobucci\JWT\Parsing\Decoder
      * @covers Lcobucci\JWT\Signer\Ecdsa
-     * @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser
      */
     public function parserCanReadAToken(Token $generated)
     {
@@ -169,8 +171,9 @@ class EcdsaTokenTest extends \PHPUnit_Framework_TestCase
      * @covers Lcobucci\JWT\Signer\Key
      * @covers Lcobucci\JWT\Signer\BaseSigner
      * @covers Lcobucci\JWT\Signer\Ecdsa
-     * @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
      * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
      */
     public function verifyShouldReturnFalseWhenKeyIsNotRight(Token $token)
     {
@@ -192,9 +195,10 @@ class EcdsaTokenTest extends \PHPUnit_Framework_TestCase
      * @covers Lcobucci\JWT\Signer\Key
      * @covers Lcobucci\JWT\Signer\BaseSigner
      * @covers Lcobucci\JWT\Signer\Ecdsa
-     * @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
      * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
      * @covers Lcobucci\JWT\Signer\Ecdsa\Sha512
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
      */
     public function verifyShouldReturnFalseWhenAlgorithmIsDifferent(Token $token)
     {
@@ -204,7 +208,7 @@ class EcdsaTokenTest extends \PHPUnit_Framework_TestCase
     /**
      * @test
      *
-     * @expectedException \RuntimeException
+     * @expectedException \InvalidArgumentException
      *
      * @depends builderCanGenerateAToken
      *
@@ -218,8 +222,9 @@ class EcdsaTokenTest extends \PHPUnit_Framework_TestCase
      * @covers Lcobucci\JWT\Signer\Key
      * @covers Lcobucci\JWT\Signer\BaseSigner
      * @covers Lcobucci\JWT\Signer\Ecdsa
-     * @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
      * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
      */
     public function verifyShouldRaiseExceptionWhenKeyIsNotEcdsaCompatible(Token $token)
     {
@@ -241,8 +246,9 @@ class EcdsaTokenTest extends \PHPUnit_Framework_TestCase
      * @covers Lcobucci\JWT\Signer\Key
      * @covers Lcobucci\JWT\Signer\BaseSigner
      * @covers Lcobucci\JWT\Signer\Ecdsa
-     * @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
      * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
      */
     public function verifyShouldReturnTrueWhenKeyIsRight(Token $token)
     {
@@ -261,8 +267,9 @@ class EcdsaTokenTest extends \PHPUnit_Framework_TestCase
      * @covers Lcobucci\JWT\Signer\Key
      * @covers Lcobucci\JWT\Signer\BaseSigner
      * @covers Lcobucci\JWT\Signer\Ecdsa
-     * @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
      * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
      */
     public function everythingShouldWorkWithAKeyWithParams()
     {
@@ -289,8 +296,9 @@ class EcdsaTokenTest extends \PHPUnit_Framework_TestCase
      * @covers Lcobucci\JWT\Signer\Key
      * @covers Lcobucci\JWT\Signer\BaseSigner
      * @covers Lcobucci\JWT\Signer\Ecdsa
-     * @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
      * @covers Lcobucci\JWT\Signer\Ecdsa\Sha512
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
      * @covers Lcobucci\JWT\Signer\Keychain
      * @covers Lcobucci\JWT\Claim\Factory
      * @covers Lcobucci\JWT\Claim\Basic

+ 1 - 1
api/vendor/lcobucci/jwt/test/functional/HmacTokenTest.php

@@ -18,7 +18,7 @@ use Lcobucci\JWT\Signer\Hmac\Sha512;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.1.0
  */
-class HmacTokenTest extends \PHPUnit_Framework_TestCase
+class HmacTokenTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var Sha256

+ 154 - 0
api/vendor/lcobucci/jwt/test/functional/RFC6978VectorTest.php

@@ -0,0 +1,154 @@
+<?php
+namespace Lcobucci\JWT\FunctionalTests;
+
+use Lcobucci\JWT\Signer\Ecdsa;
+use Lcobucci\JWT\Signer\Ecdsa\Sha256;
+use Lcobucci\JWT\Signer\Ecdsa\Sha384;
+use Lcobucci\JWT\Signer\Ecdsa\Sha512;
+use Lcobucci\JWT\Signer\Key;
+use PHPUnit\Framework\TestCase;
+use const PHP_EOL;
+use function assert;
+use function hex2bin;
+use function is_string;
+
+final class RFC6978VectorTest extends TestCase
+{
+    /**
+     * @see https://tools.ietf.org/html/rfc6979#appendix-A.2.5
+     * @see https://tools.ietf.org/html/rfc6979#appendix-A.2.6
+     * @see https://tools.ietf.org/html/rfc6979#appendix-A.2.7
+     *
+     * @test
+     * @dataProvider dataRFC6979
+     *
+     * @covers \Lcobucci\JWT\Signer\Key
+     * @covers \Lcobucci\JWT\Signer\Ecdsa
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\Sha384
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\Sha512
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\BaseSigner
+     */
+    public function theVectorsFromRFC6978CanBeVerified(
+        Ecdsa $signer,
+        Key $key,
+        $payload,
+        $expectedR,
+        $expectedS
+    ) {
+        $signature = hex2bin($expectedR . $expectedS);
+        assert(is_string($signature));
+
+        static::assertTrue($signer->verify($signature, $payload, $key));
+    }
+
+    /**
+     * @return mixed[]
+     */
+    public function dataRFC6979()
+    {
+        return $this->sha256Data() + $this->sha384Data() + $this->sha512Data();
+    }
+
+    /**
+     * @return mixed[]
+     */
+    public function sha256Data()
+    {
+        $signer = new Sha256();
+        $key    = new Key(
+            '-----BEGIN PUBLIC KEY-----' . PHP_EOL
+            . 'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYP7UuiVanTHJYet0xjVtaMBJuJI7' . PHP_EOL
+            . 'Yfps5mliLmDyn7Z5A/4QCLi8maQa6elWKLxk8vGyDC1+n1F3o8KU1EYimQ==' . PHP_EOL
+            . '-----END PUBLIC KEY-----'
+        );
+
+        return [
+            'SHA-256 (sample)' => [
+                $signer,
+                $key,
+                'sample',
+                'EFD48B2AACB6A8FD1140DD9CD45E81D69D2C877B56AAF991C34D0EA84EAF3716',
+                'F7CB1C942D657C41D436C7A1B6E29F65F3E900DBB9AFF4064DC4AB2F843ACDA8',
+            ],
+            'SHA-256 (test)' => [
+                $signer,
+                $key,
+                'test',
+                'F1ABB023518351CD71D881567B1EA663ED3EFCF6C5132B354F28D3B0B7D38367',
+                '019F4113742A2B14BD25926B49C649155F267E60D3814B4C0CC84250E46F0083',
+            ]
+        ];
+    }
+
+    /**
+     * @return mixed[]
+     */
+    public function sha384Data()
+    {
+        $signer = new Sha384();
+        $key    = new Key(
+            '-----BEGIN PUBLIC KEY-----' . PHP_EOL
+            . 'MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE7DpOQVtOGaRWhhgCn0J/pdqai8SukuAu' . PHP_EOL
+            . 'BqrlKGswDGTe+PDqkFWGYGSiVFFUgLwTgBXZty19VyROqO+awMYhiWcIpZNn+d+5' . PHP_EOL
+            . '9UyoSz8cnbEoiyMcOuDU/nNE/SUzJkcg' . PHP_EOL
+            . '-----END PUBLIC KEY-----'
+        );
+
+        return [
+            'SHA-384 (sample)' => [
+                $signer,
+                $key,
+                'sample',
+                '94EDBB92A5ECB8AAD4736E56C691916B3F88140666CE9FA73D64C4EA95AD133C81A648152E44ACF96E36DD1E80FABE46',
+                '99EF4AEB15F178CEA1FE40DB2603138F130E740A19624526203B6351D0A3A94FA329C145786E679E7B82C71A38628AC8',
+            ],
+            'SHA-384 (test)' => [
+                $signer,
+                $key,
+                'test',
+                '8203B63D3C853E8D77227FB377BCF7B7B772E97892A80F36AB775D509D7A5FEB0542A7F0812998DA8F1DD3CA3CF023DB',
+                'DDD0760448D42D8A43AF45AF836FCE4DE8BE06B485E9B61B827C2F13173923E06A739F040649A667BF3B828246BAA5A5',
+            ]
+        ];
+    }
+
+    /**
+     * @return mixed[]
+     */
+    public function sha512Data()
+    {
+        $signer = new Sha512();
+        $key    = new Key(
+            '-----BEGIN PUBLIC KEY-----' . PHP_EOL
+            . 'MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQBiUVQ0HhZMuAOqiO2lPIT+MMSH4bc' . PHP_EOL
+            . 'l6BOWnFn205bzTcRI9RuRdtrXVNwp/IPtjMVXTj/oW0r12HcrEdLmi9QI6QASTEB' . PHP_EOL
+            . 'yWLNTS/d94IoXmRYQTnC+RtH+H/4I1TWYw90aiig2yV0G1s0qCgAiyKswj+ST6r7' . PHP_EOL
+            . '1NM/gepmlW3+qiv9/PU=' . PHP_EOL
+            . '-----END PUBLIC KEY-----'
+        );
+
+        return [
+            'SHA-512 (sample)' => [
+                $signer,
+                $key,
+                'sample',
+                '00C328FAFCBD79DD77850370C46325D987CB525569FB63C5D3BC53950E6D4C5F174E25A1EE9017B5D450606ADD152B534931D7D4E8'
+                . '455CC91F9B15BF05EC36E377FA',
+                '00617CCE7CF5064806C467F678D3B4080D6F1CC50AF26CA209417308281B68AF282623EAA63E5B5C0723D8B8C37FF0777B1A20F8CC'
+                . 'B1DCCC43997F1EE0E44DA4A67A',
+            ],
+            'SHA-512 (test)' => [
+                $signer,
+                $key,
+                'test',
+                '013E99020ABF5CEE7525D16B69B229652AB6BDF2AFFCAEF38773B4B7D08725F10CDB93482FDCC54EDCEE91ECA4166B2A7C6265EF0C'
+                . 'E2BD7051B7CEF945BABD47EE6D',
+                '01FBD0013C674AA79CB39849527916CE301C66EA7CE8B80682786AD60F98F7E78A19CA69EFF5C57400E3B3A0AD66CE0978214D13BA'
+                . 'F4E9AC60752F7B155E2DE4DCE3',
+            ],
+        ];
+    }
+}

+ 28 - 20
api/vendor/lcobucci/jwt/test/functional/RsaTokenTest.php

@@ -20,7 +20,7 @@ use Lcobucci\JWT\Signer\Rsa\Sha512;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.1.0
  */
-class RsaTokenTest extends \PHPUnit_Framework_TestCase
+class RsaTokenTest extends \PHPUnit\Framework\TestCase
 {
     use Keys;
 
@@ -50,8 +50,9 @@ class RsaTokenTest extends \PHPUnit_Framework_TestCase
      * @covers Lcobucci\JWT\Parsing\Encoder
      * @covers Lcobucci\JWT\Signer\Key
      * @covers Lcobucci\JWT\Signer\BaseSigner
-     * @covers Lcobucci\JWT\Signer\Rsa
-     * @covers Lcobucci\JWT\Signer\Rsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\Rsa
+     * @covers \Lcobucci\JWT\Signer\Rsa\Sha256
      */
     public function builderShouldRaiseExceptionWhenKeyIsInvalid()
     {
@@ -61,7 +62,7 @@ class RsaTokenTest extends \PHPUnit_Framework_TestCase
                        ->setAudience('http://client.abc.com')
                        ->setIssuer('http://api.abc.com')
                        ->set('user', $user)
-                       ->sign($this->signer, new Key('testing'));
+                       ->getToken($this->signer, new Key('testing'));
     }
 
     /**
@@ -77,8 +78,9 @@ class RsaTokenTest extends \PHPUnit_Framework_TestCase
      * @covers Lcobucci\JWT\Parsing\Encoder
      * @covers Lcobucci\JWT\Signer\Key
      * @covers Lcobucci\JWT\Signer\BaseSigner
-     * @covers Lcobucci\JWT\Signer\Rsa
-     * @covers Lcobucci\JWT\Signer\Rsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\Rsa
+     * @covers \Lcobucci\JWT\Signer\Rsa\Sha256
      */
     public function builderShouldRaiseExceptionWhenKeyIsNotRsaCompatible()
     {
@@ -88,7 +90,7 @@ class RsaTokenTest extends \PHPUnit_Framework_TestCase
                        ->setAudience('http://client.abc.com')
                        ->setIssuer('http://api.abc.com')
                        ->set('user', $user)
-                       ->sign($this->signer, static::$ecdsaKeys['private']);
+                       ->getToken($this->signer, static::$ecdsaKeys['private']);
     }
 
     /**
@@ -102,8 +104,9 @@ class RsaTokenTest extends \PHPUnit_Framework_TestCase
      * @covers Lcobucci\JWT\Parsing\Encoder
      * @covers Lcobucci\JWT\Signer\Key
      * @covers Lcobucci\JWT\Signer\BaseSigner
-     * @covers Lcobucci\JWT\Signer\Rsa
-     * @covers Lcobucci\JWT\Signer\Rsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\Rsa
+     * @covers \Lcobucci\JWT\Signer\Rsa\Sha256
      */
     public function builderCanGenerateAToken()
     {
@@ -162,8 +165,9 @@ class RsaTokenTest extends \PHPUnit_Framework_TestCase
      * @covers Lcobucci\JWT\Claim\Basic
      * @covers Lcobucci\JWT\Signer\Key
      * @covers Lcobucci\JWT\Signer\BaseSigner
-     * @covers Lcobucci\JWT\Signer\Rsa
-     * @covers Lcobucci\JWT\Signer\Rsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\Rsa
+     * @covers \Lcobucci\JWT\Signer\Rsa\Sha256
      */
     public function verifyShouldReturnFalseWhenKeyIsNotRight(Token $token)
     {
@@ -184,9 +188,10 @@ class RsaTokenTest extends \PHPUnit_Framework_TestCase
      * @covers Lcobucci\JWT\Claim\Basic
      * @covers Lcobucci\JWT\Signer\Key
      * @covers Lcobucci\JWT\Signer\BaseSigner
-     * @covers Lcobucci\JWT\Signer\Rsa
-     * @covers Lcobucci\JWT\Signer\Rsa\Sha256
-     * @covers Lcobucci\JWT\Signer\Rsa\Sha512
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\Rsa
+     * @covers \Lcobucci\JWT\Signer\Rsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\Rsa\Sha512
      */
     public function verifyShouldReturnFalseWhenAlgorithmIsDifferent(Token $token)
     {
@@ -209,8 +214,9 @@ class RsaTokenTest extends \PHPUnit_Framework_TestCase
      * @covers Lcobucci\JWT\Claim\Basic
      * @covers Lcobucci\JWT\Signer\Key
      * @covers Lcobucci\JWT\Signer\BaseSigner
-     * @covers Lcobucci\JWT\Signer\Rsa
-     * @covers Lcobucci\JWT\Signer\Rsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\Rsa
+     * @covers \Lcobucci\JWT\Signer\Rsa\Sha256
      */
     public function verifyShouldRaiseExceptionWhenKeyIsNotRsaCompatible(Token $token)
     {
@@ -231,8 +237,9 @@ class RsaTokenTest extends \PHPUnit_Framework_TestCase
      * @covers Lcobucci\JWT\Claim\Basic
      * @covers Lcobucci\JWT\Signer\Key
      * @covers Lcobucci\JWT\Signer\BaseSigner
-     * @covers Lcobucci\JWT\Signer\Rsa
-     * @covers Lcobucci\JWT\Signer\Rsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\Rsa
+     * @covers \Lcobucci\JWT\Signer\Rsa\Sha256
      */
     public function verifyShouldReturnTrueWhenKeyIsRight(Token $token)
     {
@@ -248,8 +255,9 @@ class RsaTokenTest extends \PHPUnit_Framework_TestCase
      * @covers Lcobucci\JWT\Signature
      * @covers Lcobucci\JWT\Signer\Key
      * @covers Lcobucci\JWT\Signer\BaseSigner
-     * @covers Lcobucci\JWT\Signer\Rsa
-     * @covers Lcobucci\JWT\Signer\Rsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\Rsa
+     * @covers \Lcobucci\JWT\Signer\Rsa\Sha256
      * @covers Lcobucci\JWT\Claim\Factory
      * @covers Lcobucci\JWT\Claim\Basic
      * @covers Lcobucci\JWT\Parsing\Encoder

+ 25 - 1
api/vendor/lcobucci/jwt/test/functional/UnsignedTokenTest.php

@@ -16,7 +16,7 @@ use Lcobucci\JWT\ValidationData;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.1.0
  */
-class UnsignedTokenTest extends \PHPUnit_Framework_TestCase
+class UnsignedTokenTest extends \PHPUnit\Framework\TestCase
 {
     const CURRENT_TIME = 100000;
 
@@ -118,6 +118,30 @@ class UnsignedTokenTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($generated->validate($data));
     }
 
+    /**
+     * @test
+     *
+     * @depends builderCanGenerateAToken
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Parser
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\ValidationData
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Claim\EqualsTo
+     * @covers Lcobucci\JWT\Claim\GreaterOrEqualsTo
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Parsing\Decoder
+     */
+    public function tokenValidationShouldReturnTrueWhenExpectedDataMatchBecauseOfLeeway(Token $generated)
+    {
+        $notExpiredDueToLeeway = new ValidationData(self::CURRENT_TIME + 3020, 50);
+        $notExpiredDueToLeeway->setAudience('http://client.abc.com');
+        $notExpiredDueToLeeway->setIssuer('http://api.abc.com');
+        $this->assertTrue($generated->validate($notExpiredDueToLeeway));
+    }
+
     public function invalidValidationData()
     {
         $expired = new ValidationData(self::CURRENT_TIME + 3020);

+ 117 - 183
api/vendor/lcobucci/jwt/test/unit/BuilderTest.php

@@ -9,12 +9,13 @@ namespace Lcobucci\JWT;
 
 use Lcobucci\JWT\Claim\Factory as ClaimFactory;
 use Lcobucci\JWT\Parsing\Encoder;
+use Lcobucci\JWT\Signer\Key;
 
 /**
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 0.1.0
  */
-class BuilderTest extends \PHPUnit_Framework_TestCase
+class BuilderTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var Encoder|\PHPUnit_Framework_MockObject_MockObject
@@ -36,9 +37,9 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      */
     protected function setUp()
     {
-        $this->encoder = $this->getMock(Encoder::class);
-        $this->claimFactory = $this->getMock(ClaimFactory::class, [], [], '', false);
-        $this->defaultClaim = $this->getMock(Claim::class);
+        $this->encoder = $this->createMock(Encoder::class);
+        $this->claimFactory = $this->createMock(ClaimFactory::class);
+        $this->defaultClaim = $this->createMock(Claim::class);
 
         $this->claimFactory->expects($this->any())
                            ->method('create')
@@ -64,7 +65,6 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
 
         $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
         $this->assertAttributeEquals([], 'claims', $builder);
-        $this->assertAttributeEquals(null, 'signature', $builder);
         $this->assertAttributeSame($this->encoder, 'encoder', $builder);
         $this->assertAttributeSame($this->claimFactory, 'claimFactory', $builder);
     }
@@ -73,15 +73,15 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setAudience
+     * @covers Lcobucci\JWT\Builder::permittedFor
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setAudienceMustChangeTheAudClaim()
+    public function permittedForMustChangeTheAudClaim()
     {
         $builder = $this->createBuilder();
-        $builder->setAudience('test');
+        $builder->permittedFor('test');
 
         $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
         $this->assertAttributeEquals(['aud' => $this->defaultClaim], 'claims', $builder);
@@ -91,15 +91,15 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setAudience
+     * @covers Lcobucci\JWT\Builder::permittedFor
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setAudienceCanReplicateItemOnHeader()
+    public function permittedForCanReplicateItemOnHeader()
     {
         $builder = $this->createBuilder();
-        $builder->setAudience('test', true);
+        $builder->permittedFor('test', true);
 
         $this->assertAttributeEquals(['aud' => $this->defaultClaim], 'claims', $builder);
 
@@ -114,31 +114,31 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setAudience
+     * @covers Lcobucci\JWT\Builder::permittedFor
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setAudienceMustKeepAFluentInterface()
+    public function permittedForMustKeepAFluentInterface()
     {
         $builder = $this->createBuilder();
 
-        $this->assertSame($builder, $builder->setAudience('test'));
+        $this->assertSame($builder, $builder->permittedFor('test'));
     }
 
     /**
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setExpiration
+     * @covers Lcobucci\JWT\Builder::expiresAt
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setExpirationMustChangeTheExpClaim()
+    public function expiresAtMustChangeTheExpClaim()
     {
         $builder = $this->createBuilder();
-        $builder->setExpiration('2');
+        $builder->expiresAt('2');
 
         $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
         $this->assertAttributeEquals(['exp' => $this->defaultClaim], 'claims', $builder);
@@ -148,15 +148,15 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setExpiration
+     * @covers Lcobucci\JWT\Builder::expiresAt
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setExpirationCanReplicateItemOnHeader()
+    public function expiresAtCanReplicateItemOnHeader()
     {
         $builder = $this->createBuilder();
-        $builder->setExpiration('2', true);
+        $builder->expiresAt('2', true);
 
         $this->assertAttributeEquals(['exp' => $this->defaultClaim], 'claims', $builder);
 
@@ -171,31 +171,31 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setExpiration
+     * @covers Lcobucci\JWT\Builder::expiresAt
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setExpirationMustKeepAFluentInterface()
+    public function expiresAtMustKeepAFluentInterface()
     {
         $builder = $this->createBuilder();
 
-        $this->assertSame($builder, $builder->setExpiration('2'));
+        $this->assertSame($builder, $builder->expiresAt('2'));
     }
 
     /**
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setId
+     * @covers Lcobucci\JWT\Builder::identifiedBy
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setIdMustChangeTheJtiClaim()
+    public function identifiedByMustChangeTheJtiClaim()
     {
         $builder = $this->createBuilder();
-        $builder->setId('2');
+        $builder->identifiedBy('2');
 
         $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
         $this->assertAttributeEquals(['jti' => $this->defaultClaim], 'claims', $builder);
@@ -205,15 +205,15 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setId
+     * @covers Lcobucci\JWT\Builder::identifiedBy
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setIdCanReplicateItemOnHeader()
+    public function identifiedByCanReplicateItemOnHeader()
     {
         $builder = $this->createBuilder();
-        $builder->setId('2', true);
+        $builder->identifiedBy('2', true);
 
         $this->assertAttributeEquals(['jti' => $this->defaultClaim], 'claims', $builder);
 
@@ -228,31 +228,31 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setId
+     * @covers Lcobucci\JWT\Builder::identifiedBy
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setIdMustKeepAFluentInterface()
+    public function identifiedByMustKeepAFluentInterface()
     {
         $builder = $this->createBuilder();
 
-        $this->assertSame($builder, $builder->setId('2'));
+        $this->assertSame($builder, $builder->identifiedBy('2'));
     }
 
     /**
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setIssuedAt
+     * @covers Lcobucci\JWT\Builder::issuedAt
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setIssuedAtMustChangeTheIatClaim()
+    public function issuedAtMustChangeTheIatClaim()
     {
         $builder = $this->createBuilder();
-        $builder->setIssuedAt('2');
+        $builder->issuedAt('2');
 
         $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
         $this->assertAttributeEquals(['iat' => $this->defaultClaim], 'claims', $builder);
@@ -262,15 +262,15 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setIssuedAt
+     * @covers Lcobucci\JWT\Builder::issuedAt
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setIssuedAtCanReplicateItemOnHeader()
+    public function issuedAtCanReplicateItemOnHeader()
     {
         $builder = $this->createBuilder();
-        $builder->setIssuedAt('2', true);
+        $builder->issuedAt('2', true);
 
         $this->assertAttributeEquals(['iat' => $this->defaultClaim], 'claims', $builder);
 
@@ -285,31 +285,31 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setIssuedAt
+     * @covers Lcobucci\JWT\Builder::issuedAt
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setIssuedAtMustKeepAFluentInterface()
+    public function issuedAtMustKeepAFluentInterface()
     {
         $builder = $this->createBuilder();
 
-        $this->assertSame($builder, $builder->setIssuedAt('2'));
+        $this->assertSame($builder, $builder->issuedAt('2'));
     }
 
     /**
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setIssuer
+     * @covers Lcobucci\JWT\Builder::issuedBy
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setIssuerMustChangeTheIssClaim()
+    public function issuedByMustChangeTheIssClaim()
     {
         $builder = $this->createBuilder();
-        $builder->setIssuer('2');
+        $builder->issuedBy('2');
 
         $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
         $this->assertAttributeEquals(['iss' => $this->defaultClaim], 'claims', $builder);
@@ -319,15 +319,15 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setIssuer
+     * @covers Lcobucci\JWT\Builder::issuedBy
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setIssuerCanReplicateItemOnHeader()
+    public function issuedByCanReplicateItemOnHeader()
     {
         $builder = $this->createBuilder();
-        $builder->setIssuer('2', true);
+        $builder->issuedBy('2', true);
 
         $this->assertAttributeEquals(['iss' => $this->defaultClaim], 'claims', $builder);
 
@@ -342,31 +342,31 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setIssuer
+     * @covers Lcobucci\JWT\Builder::issuedBy
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setIssuerMustKeepAFluentInterface()
+    public function issuedByMustKeepAFluentInterface()
     {
         $builder = $this->createBuilder();
 
-        $this->assertSame($builder, $builder->setIssuer('2'));
+        $this->assertSame($builder, $builder->issuedBy('2'));
     }
 
     /**
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setNotBefore
+     * @covers Lcobucci\JWT\Builder::canOnlyBeUsedAfter
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setNotBeforeMustChangeTheNbfClaim()
+    public function canOnlyBeUsedAfterMustChangeTheNbfClaim()
     {
         $builder = $this->createBuilder();
-        $builder->setNotBefore('2');
+        $builder->canOnlyBeUsedAfter('2');
 
         $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
         $this->assertAttributeEquals(['nbf' => $this->defaultClaim], 'claims', $builder);
@@ -376,15 +376,15 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setNotBefore
+     * @covers Lcobucci\JWT\Builder::canOnlyBeUsedAfter
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setNotBeforeCanReplicateItemOnHeader()
+    public function canOnlyBeUsedAfterCanReplicateItemOnHeader()
     {
         $builder = $this->createBuilder();
-        $builder->setNotBefore('2', true);
+        $builder->canOnlyBeUsedAfter('2', true);
 
         $this->assertAttributeEquals(['nbf' => $this->defaultClaim], 'claims', $builder);
 
@@ -399,31 +399,31 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setNotBefore
+     * @covers Lcobucci\JWT\Builder::canOnlyBeUsedAfter
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setNotBeforeMustKeepAFluentInterface()
+    public function canOnlyBeUsedAfterMustKeepAFluentInterface()
     {
         $builder = $this->createBuilder();
 
-        $this->assertSame($builder, $builder->setNotBefore('2'));
+        $this->assertSame($builder, $builder->canOnlyBeUsedAfter('2'));
     }
 
     /**
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setSubject
+     * @covers Lcobucci\JWT\Builder::relatedTo
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setSubjectMustChangeTheSubClaim()
+    public function relatedToMustChangeTheSubClaim()
     {
         $builder = $this->createBuilder();
-        $builder->setSubject('2');
+        $builder->relatedTo('2');
 
         $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
         $this->assertAttributeEquals(['sub' => $this->defaultClaim], 'claims', $builder);
@@ -433,15 +433,15 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setSubject
+     * @covers Lcobucci\JWT\Builder::relatedTo
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setSubjectCanReplicateItemOnHeader()
+    public function relatedToCanReplicateItemOnHeader()
     {
         $builder = $this->createBuilder();
-        $builder->setSubject('2', true);
+        $builder->relatedTo('2', true);
 
         $this->assertAttributeEquals(['sub' => $this->defaultClaim], 'claims', $builder);
 
@@ -456,16 +456,16 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      *
-     * @covers Lcobucci\JWT\Builder::setSubject
+     * @covers Lcobucci\JWT\Builder::relatedTo
      * @covers Lcobucci\JWT\Builder::setRegisteredClaim
      */
-    public function setSubjectMustKeepAFluentInterface()
+    public function relatedToMustKeepAFluentInterface()
     {
         $builder = $this->createBuilder();
 
-        $this->assertSame($builder, $builder->setSubject('2'));
+        $this->assertSame($builder, $builder->relatedTo('2'));
     }
 
     /**
@@ -473,12 +473,12 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      *
      * @uses Lcobucci\JWT\Builder::__construct
      *
-     * @covers Lcobucci\JWT\Builder::set
+     * @covers Lcobucci\JWT\Builder::withClaim
      */
-    public function setMustConfigureTheGivenClaim()
+    public function withClaimMustConfigureTheGivenClaim()
     {
         $builder = $this->createBuilder();
-        $builder->set('userId', 2);
+        $builder->withClaim('userId', 2);
 
         $this->assertAttributeEquals(['userId' => $this->defaultClaim], 'claims', $builder);
     }
@@ -488,13 +488,13 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      *
      * @uses Lcobucci\JWT\Builder::__construct
      *
-     * @covers Lcobucci\JWT\Builder::set
+     * @covers Lcobucci\JWT\Builder::withClaim
      */
-    public function setMustKeepAFluentInterface()
+    public function withClaimMustKeepAFluentInterface()
     {
         $builder = $this->createBuilder();
 
-        $this->assertSame($builder, $builder->set('userId', 2));
+        $this->assertSame($builder, $builder->withClaim('userId', 2));
     }
 
     /**
@@ -502,12 +502,12 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      *
      * @uses Lcobucci\JWT\Builder::__construct
      *
-     * @covers Lcobucci\JWT\Builder::setHeader
+     * @covers Lcobucci\JWT\Builder::withHeader
      */
-    public function setHeaderMustConfigureTheGivenClaim()
+    public function withHeaderMustConfigureTheGivenClaim()
     {
         $builder = $this->createBuilder();
-        $builder->setHeader('userId', 2);
+        $builder->withHeader('userId', 2);
 
         $this->assertAttributeEquals(
             ['alg' => 'none', 'typ' => 'JWT', 'userId' => $this->defaultClaim],
@@ -521,13 +521,13 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      *
      * @uses Lcobucci\JWT\Builder::__construct
      *
-     * @covers Lcobucci\JWT\Builder::setHeader
+     * @covers Lcobucci\JWT\Builder::withHeader
      */
-    public function setHeaderMustKeepAFluentInterface()
+    public function withHeaderMustKeepAFluentInterface()
     {
         $builder = $this->createBuilder();
 
-        $this->assertSame($builder, $builder->setHeader('userId', 2));
+        $this->assertSame($builder, $builder->withHeader('userId', 2));
     }
 
     /**
@@ -539,19 +539,15 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      *
      * @covers Lcobucci\JWT\Builder::sign
      */
-    public function signMustChangeTheSignature()
+    public function signMustConfigureSignerAndKey()
     {
-        $signer = $this->getMock(Signer::class);
-        $signature = $this->getMock(Signature::class, [], [], '', false);
-
-        $signer->expects($this->any())
-               ->method('sign')
-               ->willReturn($signature);
+        $signer = $this->createMock(Signer::class);
 
         $builder = $this->createBuilder();
         $builder->sign($signer, 'test');
 
-        $this->assertAttributeSame($signature, 'signature', $builder);
+        $this->assertAttributeSame($signer, 'signer', $builder);
+        $this->assertAttributeEquals(new Key('test'), 'key', $builder);
     }
 
     /**
@@ -565,13 +561,7 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      */
     public function signMustKeepAFluentInterface()
     {
-        $signer = $this->getMock(Signer::class);
-        $signature = $this->getMock(Signature::class, [], [], '', false);
-
-        $signer->expects($this->any())
-               ->method('sign')
-               ->willReturn($signature);
-
+        $signer = $this->createMock(Signer::class);
         $builder = $this->createBuilder();
 
         $this->assertSame($builder, $builder->sign($signer, 'test'));
@@ -586,11 +576,12 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      *
      * @covers Lcobucci\JWT\Builder::unsign
      */
-    public function unsignMustRemoveTheSignature(Builder $builder)
+    public function unsignMustRemoveTheSignerAndKey(Builder $builder)
     {
         $builder->unsign();
 
-        $this->assertAttributeSame(null, 'signature', $builder);
+        $this->assertAttributeSame(null, 'signer', $builder);
+        $this->assertAttributeSame(null, 'key', $builder);
     }
 
     /**
@@ -609,66 +600,17 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::sign
-     * @uses Lcobucci\JWT\Builder::getToken
-     * @uses Lcobucci\JWT\Token
-     *
-     * @covers Lcobucci\JWT\Builder::set
-     *
-     * @expectedException BadMethodCallException
-     */
-    public function setMustRaiseExceptionWhenTokenHasBeenSigned()
-    {
-        $signer = $this->getMock(Signer::class);
-        $signature = $this->getMock(Signature::class, [], [], '', false);
-
-        $signer->expects($this->any())
-               ->method('sign')
-               ->willReturn($signature);
-
-        $builder = $this->createBuilder();
-        $builder->sign($signer, 'test');
-        $builder->set('test', 123);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::sign
-     * @uses Lcobucci\JWT\Builder::getToken
-     * @uses Lcobucci\JWT\Token
-     *
-     * @covers Lcobucci\JWT\Builder::setHeader
-     *
-     * @expectedException BadMethodCallException
-     */
-    public function setHeaderMustRaiseExceptionWhenTokenHasBeenSigned()
-    {
-        $signer = $this->getMock(Signer::class);
-        $signature = $this->getMock(Signature::class, [], [], '', false);
-
-        $signer->expects($this->any())
-               ->method('sign')
-               ->willReturn($signature);
-
-        $builder = $this->createBuilder();
-        $builder->sign($signer, 'test');
-        $builder->setHeader('test', 123);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::set
+     * @uses Lcobucci\JWT\Builder::withClaim
      * @uses Lcobucci\JWT\Token
      *
      * @covers Lcobucci\JWT\Builder::getToken
      */
     public function getTokenMustReturnANewTokenWithCurrentConfiguration()
     {
-        $signature = $this->getMock(Signature::class, [], [], '', false);
+        $signer = $this->createMock(Signer::class);
+        $signature = $this->createMock(Signature::class);
+
+        $signer->method('sign')->willReturn($signature);
 
         $this->encoder->expects($this->exactly(2))
                       ->method('jsonEncode')
@@ -680,20 +622,12 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
                       ->withConsecutive(['1'], ['2'], [$signature])
                       ->willReturnOnConsecutiveCalls('1', '2', '3');
 
-        $builder = $this->createBuilder()->set('test', 123);
-
-        $builderSign = new \ReflectionProperty($builder, 'signature');
-        $builderSign->setAccessible(true);
-        $builderSign->setValue($builder, $signature);
-
-        $token = $builder->getToken();
-
-        $tokenSign = new \ReflectionProperty($token, 'signature');
-        $tokenSign->setAccessible(true);
+        $builder = $this->createBuilder()->withClaim('test', 123);
+        $token = $builder->getToken($signer, new Key('testing'));
 
         $this->assertAttributeEquals(['1', '2', '3'], 'payload', $token);
         $this->assertAttributeEquals($token->getHeaders(), 'headers', $builder);
         $this->assertAttributeEquals($token->getClaims(), 'claims', $builder);
-        $this->assertAttributeSame($tokenSign->getValue($token), 'signature', $builder);
+        $this->assertAttributeSame($signature, 'signature', $token);
     }
 }

+ 1 - 1
api/vendor/lcobucci/jwt/test/unit/Claim/BasicTest.php

@@ -11,7 +11,7 @@ namespace Lcobucci\JWT\Claim;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.0.0
  */
-class BasicTest extends \PHPUnit_Framework_TestCase
+class BasicTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @test

+ 4 - 1
api/vendor/lcobucci/jwt/test/unit/Claim/EqualsToTest.php

@@ -13,7 +13,7 @@ use Lcobucci\JWT\ValidationData;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.0.0
  */
-class EqualsToTest extends \PHPUnit_Framework_TestCase
+class EqualsToTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @test
@@ -22,6 +22,7 @@ class EqualsToTest extends \PHPUnit_Framework_TestCase
      * @uses Lcobucci\JWT\Claim\Basic::getName
      * @uses Lcobucci\JWT\ValidationData::__construct
      * @uses Lcobucci\JWT\ValidationData::has
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\Claim\EqualsTo::validate
      */
@@ -42,6 +43,7 @@ class EqualsToTest extends \PHPUnit_Framework_TestCase
      * @uses Lcobucci\JWT\ValidationData::setIssuer
      * @uses Lcobucci\JWT\ValidationData::has
      * @uses Lcobucci\JWT\ValidationData::get
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\Claim\EqualsTo::validate
      */
@@ -65,6 +67,7 @@ class EqualsToTest extends \PHPUnit_Framework_TestCase
      * @uses Lcobucci\JWT\ValidationData::setIssuer
      * @uses Lcobucci\JWT\ValidationData::has
      * @uses Lcobucci\JWT\ValidationData::get
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\Claim\EqualsTo::validate
      */

+ 1 - 1
api/vendor/lcobucci/jwt/test/unit/Claim/FactoryTest.php

@@ -11,7 +11,7 @@ namespace Lcobucci\JWT\Claim;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.0.0
  */
-class FactoryTest extends \PHPUnit_Framework_TestCase
+class FactoryTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @test

+ 5 - 1
api/vendor/lcobucci/jwt/test/unit/Claim/GreaterOrEqualsToTest.php

@@ -13,7 +13,7 @@ use Lcobucci\JWT\ValidationData;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.0.0
  */
-class GreaterOrEqualsToTest extends \PHPUnit_Framework_TestCase
+class GreaterOrEqualsToTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @test
@@ -22,6 +22,7 @@ class GreaterOrEqualsToTest extends \PHPUnit_Framework_TestCase
      * @uses Lcobucci\JWT\Claim\Basic::getName
      * @uses Lcobucci\JWT\ValidationData::__construct
      * @uses Lcobucci\JWT\ValidationData::has
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\Claim\GreaterOrEqualsTo::validate
      */
@@ -42,6 +43,7 @@ class GreaterOrEqualsToTest extends \PHPUnit_Framework_TestCase
      * @uses Lcobucci\JWT\ValidationData::setIssuer
      * @uses Lcobucci\JWT\ValidationData::has
      * @uses Lcobucci\JWT\ValidationData::get
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\Claim\GreaterOrEqualsTo::validate
      */
@@ -65,6 +67,7 @@ class GreaterOrEqualsToTest extends \PHPUnit_Framework_TestCase
      * @uses Lcobucci\JWT\ValidationData::setIssuer
      * @uses Lcobucci\JWT\ValidationData::has
      * @uses Lcobucci\JWT\ValidationData::get
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\Claim\GreaterOrEqualsTo::validate
      */
@@ -88,6 +91,7 @@ class GreaterOrEqualsToTest extends \PHPUnit_Framework_TestCase
      * @uses Lcobucci\JWT\ValidationData::setIssuer
      * @uses Lcobucci\JWT\ValidationData::has
      * @uses Lcobucci\JWT\ValidationData::get
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\Claim\GreaterOrEqualsTo::validate
      */

+ 5 - 1
api/vendor/lcobucci/jwt/test/unit/Claim/LesserOrEqualsToTest.php

@@ -13,7 +13,7 @@ use Lcobucci\JWT\ValidationData;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.0.0
  */
-class LesserOrEqualsToTest extends \PHPUnit_Framework_TestCase
+class LesserOrEqualsToTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @test
@@ -22,6 +22,7 @@ class LesserOrEqualsToTest extends \PHPUnit_Framework_TestCase
      * @uses Lcobucci\JWT\Claim\Basic::getName
      * @uses Lcobucci\JWT\ValidationData::__construct
      * @uses Lcobucci\JWT\ValidationData::has
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\Claim\LesserOrEqualsTo::validate
      */
@@ -42,6 +43,7 @@ class LesserOrEqualsToTest extends \PHPUnit_Framework_TestCase
      * @uses Lcobucci\JWT\ValidationData::setIssuer
      * @uses Lcobucci\JWT\ValidationData::has
      * @uses Lcobucci\JWT\ValidationData::get
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\Claim\LesserOrEqualsTo::validate
      */
@@ -65,6 +67,7 @@ class LesserOrEqualsToTest extends \PHPUnit_Framework_TestCase
      * @uses Lcobucci\JWT\ValidationData::setIssuer
      * @uses Lcobucci\JWT\ValidationData::has
      * @uses Lcobucci\JWT\ValidationData::get
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\Claim\LesserOrEqualsTo::validate
      */
@@ -88,6 +91,7 @@ class LesserOrEqualsToTest extends \PHPUnit_Framework_TestCase
      * @uses Lcobucci\JWT\ValidationData::setIssuer
      * @uses Lcobucci\JWT\ValidationData::has
      * @uses Lcobucci\JWT\ValidationData::get
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\Claim\LesserOrEqualsTo::validate
      */

+ 4 - 4
api/vendor/lcobucci/jwt/test/unit/ParserTest.php

@@ -15,7 +15,7 @@ use RuntimeException;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 0.1.0
  */
-class ParserTest extends \PHPUnit_Framework_TestCase
+class ParserTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var Decoder|\PHPUnit_Framework_MockObject_MockObject
@@ -37,9 +37,9 @@ class ParserTest extends \PHPUnit_Framework_TestCase
      */
     protected function setUp()
     {
-        $this->decoder = $this->getMock(Decoder::class);
-        $this->claimFactory = $this->getMock(ClaimFactory::class, [], [], '', false);
-        $this->defaultClaim = $this->getMock(Claim::class);
+        $this->decoder = $this->createMock(Decoder::class);
+        $this->claimFactory = $this->createMock(ClaimFactory::class, [], [], '', false);
+        $this->defaultClaim = $this->createMock(Claim::class);
 
         $this->claimFactory->expects($this->any())
                            ->method('create')

+ 1 - 1
api/vendor/lcobucci/jwt/test/unit/Parsing/DecoderTest.php

@@ -11,7 +11,7 @@ namespace Lcobucci\JWT\Parsing;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 0.1.0
  */
-class DecoderTest extends \PHPUnit_Framework_TestCase
+class DecoderTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @test

+ 1 - 1
api/vendor/lcobucci/jwt/test/unit/Parsing/EncoderTest.php

@@ -11,7 +11,7 @@ namespace Lcobucci\JWT\Parsing;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 0.1.0
  */
-class EncoderTest extends \PHPUnit_Framework_TestCase
+class EncoderTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @test

+ 2 - 2
api/vendor/lcobucci/jwt/test/unit/SignatureTest.php

@@ -11,7 +11,7 @@ namespace Lcobucci\JWT;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 0.1.0
  */
-class SignatureTest extends \PHPUnit_Framework_TestCase
+class SignatureTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var Signer|\PHPUnit_Framework_MockObject_MockObject
@@ -23,7 +23,7 @@ class SignatureTest extends \PHPUnit_Framework_TestCase
      */
     protected function setUp()
     {
-        $this->signer = $this->getMock(Signer::class);
+        $this->signer = $this->createMock(Signer::class);
     }
 
     /**

+ 1 - 1
api/vendor/lcobucci/jwt/test/unit/Signer/BaseSignerTest.php

@@ -13,7 +13,7 @@ use Lcobucci\JWT\Signature;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 0.1.0
  */
-class BaseSignerTest extends \PHPUnit_Framework_TestCase
+class BaseSignerTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var BaseSigner|\PHPUnit_Framework_MockObject_MockObject

+ 0 - 178
api/vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/KeyParserTest.php

@@ -1,178 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Signer\Ecdsa;
-
-use Mdanter\Ecc\Crypto\Key\PrivateKeyInterface;
-use Mdanter\Ecc\Crypto\Key\PublicKeyInterface;
-use Mdanter\Ecc\Math\MathAdapterInterface;
-use Mdanter\Ecc\Serializer\PrivateKey\PrivateKeySerializerInterface;
-use Mdanter\Ecc\Serializer\PublicKey\PublicKeySerializerInterface;
-use Lcobucci\JWT\Signer\Key;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 3.0.4
- */
-class KeyParserTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var MathAdapterInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $adapter;
-
-    /**
-     * @var PrivateKeySerializerInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $privateKeySerializer;
-
-    /**
-     * @var PublicKeySerializerInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $publicKeySerializer;
-
-    /**
-     * @before
-     */
-    public function createDependencies()
-    {
-        $this->adapter = $this->getMock(MathAdapterInterface::class);
-        $this->privateKeySerializer = $this->getMock(PrivateKeySerializerInterface::class);
-        $this->publicKeySerializer = $this->getMock(PublicKeySerializerInterface::class);
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser::__construct
-     */
-    public function constructShouldConfigureDependencies()
-    {
-        $parser = new KeyParser($this->adapter, $this->privateKeySerializer, $this->publicKeySerializer);
-
-        $this->assertAttributeSame($this->privateKeySerializer, 'privateKeySerializer', $parser);
-        $this->assertAttributeSame($this->publicKeySerializer, 'publicKeySerializer', $parser);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signer\Ecdsa\KeyParser::__construct
-     * @uses Lcobucci\JWT\Signer\Key
-     *
-     * @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser::getPrivateKey
-     * @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser::getKeyContent
-     */
-    public function getPrivateKeyShouldAskSerializerToParseTheKey()
-    {
-        $privateKey = $this->getMock(PrivateKeyInterface::class);
-
-        $keyContent = 'MHcCAQEEIBGpMoZJ64MMSzuo5JbmXpf9V4qSWdLIl/8RmJLcfn/qoAoGC'
-                      . 'CqGSM49AwEHoUQDQgAE7it/EKmcv9bfpcV1fBreLMRXxWpnd0wxa2iF'
-                      . 'ruiI2tsEdGFTLTsyU+GeRqC7zN0aTnTQajarUylKJ3UWr/r1kg==';
-
-        $this->privateKeySerializer->expects($this->once())
-                                   ->method('parse')
-                                   ->with($keyContent)
-                                   ->willReturn($privateKey);
-
-        $parser = new KeyParser($this->adapter, $this->privateKeySerializer, $this->publicKeySerializer);
-        $this->assertSame($privateKey, $parser->getPrivateKey($this->getPrivateKey()));
-    }
-
-    /**
-     * @test
-     *
-     * @expectedException \InvalidArgumentException
-     *
-     * @uses Lcobucci\JWT\Signer\Ecdsa\KeyParser::__construct
-     * @uses Lcobucci\JWT\Signer\Key
-     *
-     * @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser::getPrivateKey
-     * @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser::getKeyContent
-     */
-    public function getPrivateKeyShouldRaiseExceptionWhenAWrongKeyWasGiven()
-    {
-        $this->privateKeySerializer->expects($this->never())
-                                   ->method('parse');
-
-        $parser = new KeyParser($this->adapter, $this->privateKeySerializer, $this->publicKeySerializer);
-        $parser->getPrivateKey($this->getPublicKey());
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signer\Ecdsa\KeyParser::__construct
-     * @uses Lcobucci\JWT\Signer\Key
-     *
-     * @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser::getPublicKey
-     * @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser::getKeyContent
-     */
-    public function getPublicKeyShouldAskSerializerToParseTheKey()
-    {
-        $publicKey = $this->getMock(PublicKeyInterface::class);
-
-        $keyContent = 'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE7it/EKmcv9bfpcV1fBreLMRXxWpn'
-                      . 'd0wxa2iFruiI2tsEdGFTLTsyU+GeRqC7zN0aTnTQajarUylKJ3UWr/r1kg==';
-
-        $this->publicKeySerializer->expects($this->once())
-                                  ->method('parse')
-                                  ->with($keyContent)
-                                  ->willReturn($publicKey);
-
-        $parser = new KeyParser($this->adapter, $this->privateKeySerializer, $this->publicKeySerializer);
-        $this->assertSame($publicKey, $parser->getPublicKey($this->getPublicKey()));
-    }
-
-    /**
-     * @test
-     *
-     * @expectedException \InvalidArgumentException
-     *
-     * @uses Lcobucci\JWT\Signer\Ecdsa\KeyParser::__construct
-     * @uses Lcobucci\JWT\Signer\Key
-     *
-     * @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser::getPublicKey
-     * @covers Lcobucci\JWT\Signer\Ecdsa\KeyParser::getKeyContent
-     */
-    public function getPublicKeyShouldRaiseExceptionWhenAWrongKeyWasGiven()
-    {
-        $this->publicKeySerializer->expects($this->never())
-                                  ->method('parse');
-
-        $parser = new KeyParser($this->adapter, $this->privateKeySerializer, $this->publicKeySerializer);
-        $parser->getPublicKey($this->getPrivateKey());
-    }
-
-    /**
-     * @return Key
-     */
-    private function getPrivateKey()
-    {
-        return new Key(
-            "-----BEGIN EC PRIVATE KEY-----\n"
-            . "MHcCAQEEIBGpMoZJ64MMSzuo5JbmXpf9V4qSWdLIl/8RmJLcfn/qoAoGCCqGSM49\n"
-            . "AwEHoUQDQgAE7it/EKmcv9bfpcV1fBreLMRXxWpnd0wxa2iFruiI2tsEdGFTLTsy\n"
-            . "U+GeRqC7zN0aTnTQajarUylKJ3UWr/r1kg==\n"
-            . "-----END EC PRIVATE KEY-----"
-        );
-    }
-
-    /**
-     * @return Key
-     */
-    private function getPublicKey()
-    {
-        return new Key(
-            "-----BEGIN PUBLIC KEY-----\n"
-            . "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE7it/EKmcv9bfpcV1fBreLMRXxWpn\n"
-            . "d0wxa2iFruiI2tsEdGFTLTsyU+GeRqC7zN0aTnTQajarUylKJ3UWr/r1kg==\n"
-            . "-----END PUBLIC KEY-----"
-        );
-    }
-}

+ 127 - 0
api/vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/MultibyteStringConverterTest.php

@@ -0,0 +1,127 @@
+<?php
+namespace Lcobucci\JWT\Signer\Ecdsa;
+
+use InvalidArgumentException;
+use PHPUnit\Framework\TestCase;
+use function bin2hex;
+use function hex2bin;
+use function strlen;
+
+/**
+ * @coversDefaultClass \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
+ */
+final class MultibyteStringConverterTest extends TestCase
+{
+    /**
+     * @test
+     * @dataProvider pointsConversionData
+     *
+     * @covers ::toAsn1
+     * @covers ::octetLength
+     * @covers ::preparePositiveInteger
+     */
+    public function toAsn1ShouldReturnThePointsInAnAsn1SequenceFormat(
+        $r,
+        $s,
+        $asn1
+    ) {
+        $converter = new MultibyteStringConverter();
+        $message   = hex2bin($r . $s);
+
+        self::assertSame($asn1, bin2hex($converter->toAsn1($message, strlen($r))));
+    }
+
+    /**
+     * @test
+     *
+     * @covers ::toAsn1
+     * @covers ::octetLength
+     */
+    public function toAsn1ShouldRaiseExceptionWhenPointsDoNotHaveCorrectLength()
+    {
+        $converter = new MultibyteStringConverter();
+
+        self::expectException(InvalidArgumentException::class);
+        $converter->toAsn1('a very wrong string', 64);
+    }
+
+    /**
+     * @test
+     * @dataProvider pointsConversionData
+     *
+     * @covers ::fromAsn1
+     * @covers ::readAsn1Content
+     * @covers ::readAsn1Integer
+     * @covers ::retrievePositiveInteger
+     */
+    public function fromAsn1ShouldReturnTheConcatenatedPoints($r, $s, $asn1)
+    {
+        $converter = new MultibyteStringConverter();
+        $message   = hex2bin($asn1);
+
+        self::assertSame($r . $s, bin2hex($converter->fromAsn1($message, strlen($r))));
+    }
+
+    /**
+     * @return string[][]
+     */
+    public function pointsConversionData()
+    {
+        return [
+            [
+                'efd48b2aacb6a8fd1140dd9cd45e81d69d2c877b56aaf991c34d0ea84eaf3716',
+                'f7cb1c942d657c41d436c7a1b6e29f65f3e900dbb9aff4064dc4ab2f843acda8',
+                '3046022100efd48b2aacb6a8fd1140dd9cd45e81d69d2c877b56aaf991c34d0ea84eaf3716022100f7cb1c942d657c41d436c7'
+                . 'a1b6e29f65f3e900dbb9aff4064dc4ab2f843acda8',
+            ],
+            [
+                '94edbb92a5ecb8aad4736e56c691916b3f88140666ce9fa73d64c4ea95ad133c81a648152e44acf96e36dd1e80fabe46',
+                '99ef4aeb15f178cea1fe40db2603138f130e740a19624526203b6351d0a3a94fa329c145786e679e7b82c71a38628ac8',
+                '306602310094edbb92a5ecb8aad4736e56c691916b3f88140666ce9fa73d64c4ea95ad133c81a648152e44acf96e36dd1e80fa'
+                . 'be4602310099ef4aeb15f178cea1fe40db2603138f130e740a19624526203b6351d0a3a94fa329c145786e679e7b82c71a38'
+                . '628ac8',
+            ],
+            [
+                '00c328fafcbd79dd77850370c46325d987cb525569fb63c5d3bc53950e6d4c5f174e25a1ee9017b5d450606add152b534931d7'
+                . 'd4e8455cc91f9b15bf05ec36e377fa',
+                '00617cce7cf5064806c467f678d3b4080d6f1cc50af26ca209417308281b68af282623eaa63e5b5c0723d8b8c37ff0777b1a20'
+                . 'f8ccb1dccc43997f1ee0e44da4a67a',
+                '308187024200c328fafcbd79dd77850370c46325d987cb525569fb63c5d3bc53950e6d4c5f174e25a1ee9017b5d450606add15'
+                . '2b534931d7d4e8455cc91f9b15bf05ec36e377fa0241617cce7cf5064806c467f678d3b4080d6f1cc50af26ca20941730828'
+                . '1b68af282623eaa63e5b5c0723d8b8c37ff0777b1a20f8ccb1dccc43997f1ee0e44da4a67a',
+            ],
+        ];
+    }
+
+    /**
+     * @test
+     * @dataProvider invalidAsn1Structures
+     *
+     * @covers ::fromAsn1
+     * @covers ::readAsn1Content
+     * @covers ::readAsn1Integer
+     * @covers ::retrievePositiveInteger
+     */
+    public function fromAsn1ShouldRaiseExceptionOnInvalidMessage($message)
+    {
+        $converter = new MultibyteStringConverter();
+        $message   = hex2bin($message);
+
+        $this->expectException(InvalidArgumentException::class);
+        $converter->fromAsn1($message, 64);
+    }
+
+    /**
+     * @return string[][]
+     */
+    public function invalidAsn1Structures()
+    {
+        return [
+            'Not a sequence'           => [''],
+            'Sequence without length'  => ['30'],
+            'Only one string element'  => ['3006030204f0'],
+            'Only one integer element' => ['3004020101'],
+            'Integer+string elements'  => ['300a020101030204f0'],
+        ];
+    }
+}

+ 7 - 7
api/vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/Sha256Test.php

@@ -11,13 +11,13 @@ namespace Lcobucci\JWT\Signer\Ecdsa;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.1.0
  */
-class Sha256Test extends \PHPUnit_Framework_TestCase
+class Sha256Test extends \PHPUnit\Framework\TestCase
 {
     /**
      * @test
      *
      * @uses Lcobucci\JWT\Signer\Ecdsa
-     * @uses Lcobucci\JWT\Signer\Ecdsa\KeyParser
+     * @uses Lcobucci\JWT\Signer\OpenSSL
      *
      * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256::getAlgorithmId
      */
@@ -32,7 +32,7 @@ class Sha256Test extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Signer\Ecdsa
-     * @uses Lcobucci\JWT\Signer\Ecdsa\KeyParser
+     * @uses Lcobucci\JWT\Signer\OpenSSL
      *
      * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256::getAlgorithm
      */
@@ -47,14 +47,14 @@ class Sha256Test extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Signer\Ecdsa
-     * @uses Lcobucci\JWT\Signer\Ecdsa\KeyParser
+     * @uses Lcobucci\JWT\Signer\OpenSSL
      *
-     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256::getSignatureLength
+     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256::getKeyLength
      */
-    public function getSignatureLengthMustBeCorrect()
+    public function getKeyLengthMustBeCorrect()
     {
         $signer = new Sha256();
 
-        $this->assertEquals(64, $signer->getSignatureLength());
+        $this->assertEquals(64, $signer->getKeyLength());
     }
 }

+ 7 - 7
api/vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/Sha384Test.php

@@ -11,13 +11,13 @@ namespace Lcobucci\JWT\Signer\Ecdsa;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.1.0
  */
-class Sha384Test extends \PHPUnit_Framework_TestCase
+class Sha384Test extends \PHPUnit\Framework\TestCase
 {
     /**
      * @test
      *
      * @uses Lcobucci\JWT\Signer\Ecdsa
-     * @uses Lcobucci\JWT\Signer\Ecdsa\KeyParser
+     * @uses Lcobucci\JWT\Signer\OpenSSL
      *
      * @covers Lcobucci\JWT\Signer\Ecdsa\Sha384::getAlgorithmId
      */
@@ -32,7 +32,7 @@ class Sha384Test extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Signer\Ecdsa
-     * @uses Lcobucci\JWT\Signer\Ecdsa\KeyParser
+     * @uses Lcobucci\JWT\Signer\OpenSSL
      *
      * @covers Lcobucci\JWT\Signer\Ecdsa\Sha384::getAlgorithm
      */
@@ -47,14 +47,14 @@ class Sha384Test extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Signer\Ecdsa
-     * @uses Lcobucci\JWT\Signer\Ecdsa\KeyParser
+     * @uses Lcobucci\JWT\Signer\OpenSSL
      *
-     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha384::getSignatureLength
+     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha384::getKeyLength
      */
-    public function getSignatureLengthMustBeCorrect()
+    public function getKeyLengthMustBeCorrect()
     {
         $signer = new Sha384();
 
-        $this->assertEquals(96, $signer->getSignatureLength());
+        $this->assertEquals(96, $signer->getKeyLength());
     }
 }

+ 7 - 7
api/vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/Sha512Test.php

@@ -11,13 +11,13 @@ namespace Lcobucci\JWT\Signer\Ecdsa;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.1.0
  */
-class Sha512Test extends \PHPUnit_Framework_TestCase
+class Sha512Test extends \PHPUnit\Framework\TestCase
 {
     /**
      * @test
      *
      * @uses Lcobucci\JWT\Signer\Ecdsa
-     * @uses Lcobucci\JWT\Signer\Ecdsa\KeyParser
+     * @uses Lcobucci\JWT\Signer\OpenSSL
      *
      * @covers Lcobucci\JWT\Signer\Ecdsa\Sha512::getAlgorithmId
      */
@@ -32,7 +32,7 @@ class Sha512Test extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Signer\Ecdsa
-     * @uses Lcobucci\JWT\Signer\Ecdsa\KeyParser
+     * @uses Lcobucci\JWT\Signer\OpenSSL
      *
      * @covers Lcobucci\JWT\Signer\Ecdsa\Sha512::getAlgorithm
      */
@@ -47,14 +47,14 @@ class Sha512Test extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\Signer\Ecdsa
-     * @uses Lcobucci\JWT\Signer\Ecdsa\KeyParser
+     * @uses Lcobucci\JWT\Signer\OpenSSL
      *
-     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha512::getSignatureLength
+     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha512::getKeyLength
      */
-    public function getSignatureLengthMustBeCorrect()
+    public function getKeyLengthMustBeCorrect()
     {
         $signer = new Sha512();
 
-        $this->assertEquals(132, $signer->getSignatureLength());
+        $this->assertEquals(132, $signer->getKeyLength());
     }
 }

+ 65 - 121
api/vendor/lcobucci/jwt/test/unit/Signer/EcdsaTest.php

@@ -7,167 +7,111 @@
 
 namespace Lcobucci\JWT\Signer;
 
-use Lcobucci\JWT\Signer\Ecdsa\KeyParser;
-use Mdanter\Ecc\Crypto\Signature\Signature;
-use Mdanter\Ecc\Crypto\Signature\Signer;
-use Mdanter\Ecc\Crypto\Key\PrivateKeyInterface;
-use Mdanter\Ecc\Crypto\Key\PublicKeyInterface;
-use Mdanter\Ecc\Math\MathAdapterInterface as Adapter;
-use Mdanter\Ecc\Primitives\PointInterface;
-use Mdanter\Ecc\Random\RandomNumberGeneratorInterface;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 2.1.0
- */
-class EcdsaTest extends \PHPUnit_Framework_TestCase
+use Lcobucci\JWT\Keys;
+use Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter;
+use const OPENSSL_ALGO_SHA256;
+use function openssl_pkey_get_private;
+use function openssl_pkey_get_public;
+use function openssl_sign;
+use function openssl_verify;
+
+class EcdsaTest extends \PHPUnit\Framework\TestCase
 {
-    /**
-     * @var Adapter|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $adapter;
+    use Keys;
 
     /**
-     * @var Signer|\PHPUnit_Framework_MockObject_MockObject
+     * @var MultibyteStringConverter
      */
-    private $signer;
-
-    /**
-     * @var RandomNumberGeneratorInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $randomGenerator;
-
-    /**
-     * @var KeyParser|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $parser;
+    private $pointsManipulator;
 
     /**
      * @before
      */
     public function createDependencies()
     {
-        $this->adapter = $this->getMock(Adapter::class);
-        $this->signer = $this->getMock(Signer::class, [], [$this->adapter]);
-        $this->randomGenerator = $this->getMock(RandomNumberGeneratorInterface::class);
-        $this->parser = $this->getMock(KeyParser::class, [], [], '', false);
+        $this->pointsManipulator = new MultibyteStringConverter();
     }
 
-    /**
-     * @return Ecdsa
-     */
     private function getSigner()
     {
-        $signer = $this->getMockForAbstractClass(
-            Ecdsa::class,
-            [$this->adapter, $this->signer, $this->parser]
-        );
-
-        $signer->method('getSignatureLength')
-               ->willReturn(64);
+        $signer = $this->getMockForAbstractClass(Ecdsa::class, [$this->pointsManipulator]);
 
         $signer->method('getAlgorithm')
-               ->willReturn('sha256');
+            ->willReturn(OPENSSL_ALGO_SHA256);
 
         $signer->method('getAlgorithmId')
-               ->willReturn('ES256');
+            ->willReturn('ES256');
 
-        return $signer;
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Signer\Ecdsa::__construct
-     */
-    public function constructShouldConfigureDependencies()
-    {
-        $signer = $this->getSigner();
+        $signer->method('getKeyLength')
+            ->willReturn(64);
 
-        $this->assertAttributeSame($this->adapter, 'adapter', $signer);
-        $this->assertAttributeSame($this->signer, 'signer', $signer);
-        $this->assertAttributeSame($this->parser, 'parser', $signer);
+        return $signer;
     }
 
     /**
      * @test
      *
-     * @uses Lcobucci\JWT\Signer\Ecdsa::__construct
-     * @uses Lcobucci\JWT\Signer\Key
+     * @covers \Lcobucci\JWT\Signer\Ecdsa::createHash
+     * @covers \Lcobucci\JWT\Signer\Ecdsa::getKeyType
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\BaseSigner
      *
-     * @covers Lcobucci\JWT\Signer\Ecdsa::createHash
-     * @covers Lcobucci\JWT\Signer\Ecdsa::createSigningHash
-     * @covers Lcobucci\JWT\Signer\Ecdsa::createSignatureHash
+     * @uses \Lcobucci\JWT\Signer\Ecdsa::__construct
+     * @uses \Lcobucci\JWT\Signer\Key
+     * @uses \Lcobucci\JWT\Signature
      */
-    public function createHashShouldReturnAHashUsingPrivateKey()
+    public function createHashShouldReturnTheAHashBasedOnTheOpenSslSignature()
     {
-        $signer = $this->getSigner();
-        $key = new Key('testing');
-        $privateKey = $this->getMock(PrivateKeyInterface::class);
-        $point = $this->getMock(PointInterface::class);
-
-        $privateKey->method('getPoint')
-                   ->willReturn($point);
-
-        $point->method('getOrder')
-              ->willReturn('1');
-
-        $this->parser->expects($this->once())
-                     ->method('getPrivateKey')
-                     ->with($key)
-                     ->willReturn($privateKey);
-
-        $this->randomGenerator->expects($this->once())
-                              ->method('generate')
-                              ->with('1')
-                              ->willReturn('123');
-
-        $this->adapter->expects($this->once())
-                      ->method('hexDec')
-                      ->willReturn('123');
-
-        $this->adapter->expects($this->exactly(2))
-                      ->method('decHex')
-                      ->willReturn('123');
-
-        $this->signer->expects($this->once())
-                     ->method('sign')
-                     ->with($privateKey, $this->isType('string'), $this->isType('string'))
-                     ->willReturn(new Signature('1234', '456'));
-
-        $this->assertInternalType('string', $signer->createHash('testing', $key, $this->randomGenerator));
+        $payload = 'testing';
+
+        $signer    = $this->getSigner();
+        $signature = $signer->sign($payload, self::$ecdsaKeys['private']);
+
+        $publicKey = openssl_pkey_get_public(self::$ecdsaKeys['public1']->getContent());
+
+        self::assertInternalType('resource', $publicKey);
+        self::assertSame(
+            1,
+            openssl_verify(
+                $payload,
+                $this->pointsManipulator->toAsn1($signature, $signer->getKeyLength()),
+                $publicKey,
+                OPENSSL_ALGO_SHA256
+            )
+        );
     }
 
     /**
      * @test
      *
-     * @uses Lcobucci\JWT\Signer\Ecdsa::__construct
-     * @uses Lcobucci\JWT\Signer\Key
+     * @covers \Lcobucci\JWT\Signer\Ecdsa::doVerify
+     * @covers \Lcobucci\JWT\Signer\Ecdsa::getKeyType
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\BaseSigner
      *
-     * @covers Lcobucci\JWT\Signer\Ecdsa::doVerify
-     * @covers Lcobucci\JWT\Signer\Ecdsa::createSigningHash
-     * @covers Lcobucci\JWT\Signer\Ecdsa::extractSignature
+     * @uses \Lcobucci\JWT\Signer\Ecdsa::__construct
+     * @uses \Lcobucci\JWT\Signer\Key
      */
     public function doVerifyShouldDelegateToEcdsaSignerUsingPublicKey()
     {
-        $signer = $this->getSigner();
-        $key = new Key('testing');
-        $publicKey = $this->getMock(PublicKeyInterface::class);
+        $payload    = 'testing';
+        $privateKey = openssl_pkey_get_private(self::$ecdsaKeys['private']->getContent());
 
-        $this->parser->expects($this->once())
-                     ->method('getPublicKey')
-                     ->with($key)
-                     ->willReturn($publicKey);
+        self::assertInternalType('resource', $privateKey);
 
-        $this->adapter->expects($this->exactly(3))
-                      ->method('hexDec')
-                      ->willReturn('123');
+        $signature = '';
+        openssl_sign($payload, $signature, $privateKey, OPENSSL_ALGO_SHA256);
 
-        $this->signer->expects($this->once())
-                     ->method('verify')
-                     ->with($publicKey, $this->isInstanceOf(Signature::class), $this->isType('string'))
-                     ->willReturn(true);
+        $signer = $this->getSigner();
 
-        $this->assertTrue($signer->doVerify('testing', 'testing2', $key));
+        self::assertTrue(
+            $signer->verify(
+                $this->pointsManipulator->fromAsn1($signature, $signer->getKeyLength()),
+                $payload,
+                self::$ecdsaKeys['public1']
+            )
+        );
     }
 }

+ 1 - 1
api/vendor/lcobucci/jwt/test/unit/Signer/Hmac/Sha256Test.php

@@ -11,7 +11,7 @@ namespace Lcobucci\JWT\Signer\Hmac;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 0.1.0
  */
-class Sha256Test extends \PHPUnit_Framework_TestCase
+class Sha256Test extends \PHPUnit\Framework\TestCase
 {
     /**
      * @test

+ 1 - 1
api/vendor/lcobucci/jwt/test/unit/Signer/Hmac/Sha384Test.php

@@ -11,7 +11,7 @@ namespace Lcobucci\JWT\Signer\Hmac;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 0.1.0
  */
-class Sha384Test extends \PHPUnit_Framework_TestCase
+class Sha384Test extends \PHPUnit\Framework\TestCase
 {
     /**
      * @test

+ 1 - 1
api/vendor/lcobucci/jwt/test/unit/Signer/Hmac/Sha512Test.php

@@ -11,7 +11,7 @@ namespace Lcobucci\JWT\Signer\Hmac;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 0.1.0
  */
-class Sha512Test extends \PHPUnit_Framework_TestCase
+class Sha512Test extends \PHPUnit\Framework\TestCase
 {
     /**
      * @test

+ 1 - 1
api/vendor/lcobucci/jwt/test/unit/Signer/HmacTest.php

@@ -11,7 +11,7 @@ namespace Lcobucci\JWT\Signer;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 0.1.0
  */
-class HmacTest extends \PHPUnit_Framework_TestCase
+class HmacTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var Hmac|\PHPUnit_Framework_MockObject_MockObject

+ 19 - 2
api/vendor/lcobucci/jwt/test/unit/Signer/KeyTest.php

@@ -13,7 +13,7 @@ use org\bovigo\vfs\vfsStream;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 3.0.4
  */
-class KeyTest extends \PHPUnit_Framework_TestCase
+class KeyTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @before
@@ -23,7 +23,10 @@ class KeyTest extends \PHPUnit_Framework_TestCase
         vfsStream::setup(
             'root',
             null,
-            ['test.pem' => 'testing']
+            [
+                'test.pem' => 'testing',
+                'emptyFolder' => []
+            ]
         );
     }
 
@@ -70,6 +73,20 @@ class KeyTest extends \PHPUnit_Framework_TestCase
         new Key('file://' . vfsStream::url('root/test2.pem'));
     }
 
+    /**
+     * @test
+     *
+     * @expectedException \InvalidArgumentException
+     *
+     * @covers Lcobucci\JWT\Signer\Key::__construct
+     * @covers Lcobucci\JWT\Signer\Key::setContent
+     * @covers Lcobucci\JWT\Signer\Key::readFile
+     */
+    public function constructShouldRaiseExceptionWhenFileGetContentsFailed()
+    {
+        new Key('file://' . vfsStream::url('root/emptyFolder'));
+    }
+
     /**
      * @test
      *

+ 1 - 1
api/vendor/lcobucci/jwt/test/unit/Signer/KeychainTest.php

@@ -11,7 +11,7 @@ namespace Lcobucci\JWT\Signer;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.1.0
  */
-class KeychainTest extends \PHPUnit_Framework_TestCase
+class KeychainTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @test

+ 1 - 1
api/vendor/lcobucci/jwt/test/unit/Signer/Rsa/Sha256Test.php

@@ -11,7 +11,7 @@ namespace Lcobucci\JWT\Signer\Rsa;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.1.0
  */
-class Sha256Test extends \PHPUnit_Framework_TestCase
+class Sha256Test extends \PHPUnit\Framework\TestCase
 {
     /**
      * @test

+ 1 - 1
api/vendor/lcobucci/jwt/test/unit/Signer/Rsa/Sha384Test.php

@@ -11,7 +11,7 @@ namespace Lcobucci\JWT\Signer\Rsa;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.1.0
  */
-class Sha384Test extends \PHPUnit_Framework_TestCase
+class Sha384Test extends \PHPUnit\Framework\TestCase
 {
     /**
      * @test

+ 1 - 1
api/vendor/lcobucci/jwt/test/unit/Signer/Rsa/Sha512Test.php

@@ -11,7 +11,7 @@ namespace Lcobucci\JWT\Signer\Rsa;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.1.0
  */
-class Sha512Test extends \PHPUnit_Framework_TestCase
+class Sha512Test extends \PHPUnit\Framework\TestCase
 {
     /**
      * @test

+ 188 - 0
api/vendor/lcobucci/jwt/test/unit/Signer/RsaTest.php

@@ -0,0 +1,188 @@
+<?php
+namespace Lcobucci\JWT\Signer;
+
+use InvalidArgumentException;
+use Lcobucci\JWT\Keys;
+use PHPUnit\Framework\TestCase;
+use const OPENSSL_ALGO_SHA256;
+use function openssl_pkey_get_private;
+use function openssl_pkey_get_public;
+use function openssl_sign;
+use function openssl_verify;
+
+final class RsaTest extends TestCase
+{
+    use Keys;
+
+    /**
+     * @test
+     *
+     * @covers \Lcobucci\JWT\Signer\Rsa::createHash
+     * @covers \Lcobucci\JWT\Signer\Rsa::validateKey
+     * @covers \Lcobucci\JWT\Signer\Rsa::getKeyType
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\BaseSigner
+     *
+     * @uses \Lcobucci\JWT\Signer\Key
+     * @uses \Lcobucci\JWT\Signature
+     */
+    public function createHashShouldReturnAValidOpensslSignature()
+    {
+        $payload = 'testing';
+
+        $signer    = $this->getSigner();
+        $signature = $signer->sign($payload, self::$rsaKeys['private']);
+
+        $publicKey = openssl_pkey_get_public(self::$rsaKeys['public']->getContent());
+        self::assertInternalType('resource', $publicKey);
+        self::assertSame(1, openssl_verify($payload, $signature, $publicKey, OPENSSL_ALGO_SHA256));
+    }
+
+    /**
+     * @test
+     *
+     * @covers \Lcobucci\JWT\Signer\Rsa::createHash
+     * @covers \Lcobucci\JWT\Signer\Rsa::validateKey
+     * @covers \Lcobucci\JWT\Signer\Rsa::getKeyType
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\BaseSigner
+     *
+     * @uses \Lcobucci\JWT\Signer\Key
+     */
+    public function createHashShouldRaiseAnExceptionWhenKeyIsInvalid()
+    {
+        $key = <<<KEY
+-----BEGIN RSA PRIVATE KEY-----
+MGECAQACEQC4MRKSVsq5XnRBrJoX6+rnAgMBAAECECO8SZkgw6Yg66A6SUly/3kC
+CQDtPXZtCQWJuwIJAMbBu17GDOrFAggopfhNlFcjkwIIVjb7G+U0/TECCEERyvxP
+TWdN
+-----END RSA PRIVATE KEY-----
+KEY;
+
+        $signer = $this->getSigner();
+
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionMessage('There was an error while creating the signature');
+
+        $signer->sign('testing', new Key($key));
+    }
+
+    /**
+     * @test
+     *
+     * @covers \Lcobucci\JWT\Signer\Rsa::createHash
+     * @covers \Lcobucci\JWT\Signer\Rsa::validateKey
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\BaseSigner
+     *
+     * @uses \Lcobucci\JWT\Signer\Key
+     */
+    public function createHashShouldRaiseAnExceptionWhenKeyIsNotParseable()
+    {
+        $signer = $this->getSigner();
+
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionMessage('It was not possible to parse your key');
+
+        $signer->sign('testing', new Key('blablabla'));
+    }
+
+    /**
+     * @test
+     *
+     * @covers \Lcobucci\JWT\Signer\Rsa::createHash
+     * @covers \Lcobucci\JWT\Signer\Rsa::validateKey
+     * @covers \Lcobucci\JWT\Signer\Rsa::getKeyType
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\BaseSigner
+     *
+     * @uses \Lcobucci\JWT\Signer\Key
+     */
+    public function createHashShouldRaiseAnExceptionWhenKeyTypeIsNotRsa()
+    {
+        $signer = $this->getSigner();
+
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionMessage('This key is not compatible with this signer');
+
+        $signer->sign('testing', self::$ecdsaKeys['private']);
+    }
+
+    /**
+     * @test
+     *
+     * @covers \Lcobucci\JWT\Signer\Rsa::doVerify
+     * @covers \Lcobucci\JWT\Signer\Rsa::validateKey
+     * @covers \Lcobucci\JWT\Signer\Rsa::getKeyType
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\BaseSigner
+     *
+     * @uses \Lcobucci\JWT\Signer\Key
+     */
+    public function doVerifyShouldReturnTrueWhenSignatureIsValid()
+    {
+        $payload    = 'testing';
+        $privateKey = openssl_pkey_get_private(self::$rsaKeys['private']->getContent());
+        self::assertInternalType('resource', $privateKey);
+
+        $signature = '';
+        openssl_sign($payload, $signature, $privateKey, OPENSSL_ALGO_SHA256);
+
+        $signer = $this->getSigner();
+
+        self::assertTrue($signer->verify($signature, $payload, self::$rsaKeys['public']));
+    }
+
+    /**
+     * @test
+     *
+     * @covers \Lcobucci\JWT\Signer\Rsa::doVerify
+     * @covers \Lcobucci\JWT\Signer\Rsa::validateKey
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\BaseSigner
+     *
+     * @uses \Lcobucci\JWT\Signer\Key
+     */
+    public function doVerifyShouldRaiseAnExceptionWhenKeyIsNotParseable()
+    {
+        $signer = $this->getSigner();
+
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionMessage('It was not possible to parse your key');
+
+        $signer->verify('testing', 'testing', new Key('blablabla'));
+    }
+
+    /**
+     * @test
+     *
+     * @covers \Lcobucci\JWT\Signer\Rsa::doVerify
+     * @covers \Lcobucci\JWT\Signer\Rsa::validateKey
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\BaseSigner
+     *
+     * @uses \Lcobucci\JWT\Signer\Key
+     */
+    public function doVerifyShouldRaiseAnExceptionWhenKeyTypeIsNotRsa()
+    {
+        $signer = $this->getSigner();
+
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionMessage('It was not possible to parse your key');
+
+        $signer->verify('testing', 'testing', self::$ecdsaKeys['private']);
+    }
+
+    private function getSigner()
+    {
+        $signer = $this->getMockForAbstractClass(Rsa::class);
+
+        $signer->method('getAlgorithm')
+               ->willReturn(OPENSSL_ALGO_SHA256);
+
+        $signer->method('getAlgorithmId')
+               ->willReturn('RS256');
+
+        return $signer;
+    }
+}

+ 78 - 7
api/vendor/lcobucci/jwt/test/unit/TokenTest.php

@@ -18,7 +18,7 @@ use Lcobucci\JWT\Claim\LesserOrEqualsTo;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 0.1.0
  */
-class TokenTest extends \PHPUnit_Framework_TestCase
+class TokenTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @test
@@ -246,7 +246,7 @@ class TokenTest extends \PHPUnit_Framework_TestCase
      */
     public function verifyMustRaiseExceptionWhenTokenIsUnsigned()
     {
-        $signer = $this->getMock(Signer::class);
+        $signer = $this->createMock(Signer::class);
 
         $token = new Token();
         $token->verify($signer, 'test');
@@ -262,8 +262,8 @@ class TokenTest extends \PHPUnit_Framework_TestCase
      */
     public function verifyShouldReturnFalseWhenTokenAlgorithmIsDifferent()
     {
-        $signer = $this->getMock(Signer::class);
-        $signature = $this->getMock(Signature::class, [], [], '', false);
+        $signer = $this->createMock(Signer::class);
+        $signature = $this->createMock(Signature::class, [], [], '', false);
 
         $signer->expects($this->any())
                ->method('getAlgorithmId')
@@ -287,8 +287,8 @@ class TokenTest extends \PHPUnit_Framework_TestCase
      */
     public function verifyMustDelegateTheValidationToSignature()
     {
-        $signer = $this->getMock(Signer::class);
-        $signature = $this->getMock(Signature::class, [], [], '', false);
+        $signer = $this->createMock(Signer::class);
+        $signature = $this->createMock(Signature::class, [], [], '', false);
 
         $signer->expects($this->any())
                ->method('getAlgorithmId')
@@ -309,6 +309,7 @@ class TokenTest extends \PHPUnit_Framework_TestCase
      *
      * @uses Lcobucci\JWT\Token::__construct
      * @uses Lcobucci\JWT\ValidationData::__construct
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\Token::validate
      * @covers Lcobucci\JWT\Token::getValidatableClaims
@@ -325,6 +326,7 @@ class TokenTest extends \PHPUnit_Framework_TestCase
      *
      * @uses Lcobucci\JWT\Token::__construct
      * @uses Lcobucci\JWT\ValidationData::__construct
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      * @uses Lcobucci\JWT\Claim\Basic::__construct
      *
      * @covers Lcobucci\JWT\Token::validate
@@ -364,6 +366,40 @@ class TokenTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($token->validate($data));
     }
 
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Token::__construct
+     * @uses Lcobucci\JWT\ValidationData
+     * @uses Lcobucci\JWT\Claim\Basic
+     * @uses Lcobucci\JWT\Claim\EqualsTo
+     * @uses Lcobucci\JWT\Claim\LesserOrEqualsTo
+     * @uses Lcobucci\JWT\Claim\GreaterOrEqualsTo
+     *
+     * @covers Lcobucci\JWT\Token::validate
+     * @covers Lcobucci\JWT\Token::getValidatableClaims
+     */
+    public function validateShouldReturnFalseWhenATimeBasedClaimFails()
+    {
+        $now = time();
+
+        $token = new Token(
+            [],
+            [
+                'iss' => new EqualsTo('iss', 'test'),
+                'iat' => new LesserOrEqualsTo('iat', $now),
+                'nbf' => new LesserOrEqualsTo('nbf', $now + 20),
+                'exp' => new GreaterOrEqualsTo('exp', $now + 500),
+                'testing' => new Basic('testing', 'test')
+            ]
+        );
+
+        $data = new ValidationData($now + 10);
+        $data->setIssuer('test');
+
+        $this->assertFalse($token->validate($data));
+    }
+
     /**
      * @test
      *
@@ -380,6 +416,7 @@ class TokenTest extends \PHPUnit_Framework_TestCase
     public function validateShouldReturnTrueWhenThereAreNoFailedValidatableClaims()
     {
         $now = time();
+
         $token = new Token(
             [],
             [
@@ -396,6 +433,40 @@ class TokenTest extends \PHPUnit_Framework_TestCase
         $this->assertTrue($token->validate($data));
     }
 
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Token::__construct
+     * @uses Lcobucci\JWT\ValidationData
+     * @uses Lcobucci\JWT\Claim\Basic
+     * @uses Lcobucci\JWT\Claim\EqualsTo
+     * @uses Lcobucci\JWT\Claim\LesserOrEqualsTo
+     * @uses Lcobucci\JWT\Claim\GreaterOrEqualsTo
+     *
+     * @covers Lcobucci\JWT\Token::validate
+     * @covers Lcobucci\JWT\Token::getValidatableClaims
+     */
+    public function validateShouldReturnTrueWhenLeewayMakesAllTimeBasedClaimsTrueAndOtherClaimsAreTrue()
+    {
+        $now = time();
+
+        $token = new Token(
+            [],
+            [
+                'iss' => new EqualsTo('iss', 'test'),
+                'iat' => new LesserOrEqualsTo('iat', $now),
+                'nbf' => new LesserOrEqualsTo('nbf', $now + 20),
+                'exp' => new GreaterOrEqualsTo('exp', $now + 500),
+                'testing' => new Basic('testing', 'test')
+            ]
+        );
+
+        $data = new ValidationData($now + 10, 20);
+        $data->setIssuer('test');
+
+        $this->assertTrue($token->validate($data));
+    }
+
     /**
      * @test
      *
@@ -493,7 +564,7 @@ class TokenTest extends \PHPUnit_Framework_TestCase
      */
     public function toStringMustReturnEncodedData()
     {
-        $signature = $this->getMock(Signature::class, [], [], '', false);
+        $signature = $this->createMock(Signature::class, [], [], '', false);
 
         $token = new Token(['alg' => 'none'], [], $signature, ['test', 'test', 'test']);
 

+ 56 - 10
api/vendor/lcobucci/jwt/test/unit/ValidationDataTest.php

@@ -11,12 +11,13 @@ namespace Lcobucci\JWT;
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.0.0
  */
-class ValidationDataTest extends \PHPUnit_Framework_TestCase
+class ValidationDataTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @test
      *
      * @covers Lcobucci\JWT\ValidationData::__construct
+     * @covers Lcobucci\JWT\ValidationData::setCurrentTime
      */
     public function constructorShouldConfigureTheItems()
     {
@@ -26,12 +27,27 @@ class ValidationDataTest extends \PHPUnit_Framework_TestCase
         $this->assertAttributeSame($expected, 'items', $data);
     }
 
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\ValidationData::__construct
+     * @covers Lcobucci\JWT\ValidationData::setCurrentTime
+     */
+    public function constructorWithLeewayShouldConfigureTheItems()
+    {
+        $expected = $this->createExpectedData(null, null, null, null, 111, 111, 89);
+        $data = new ValidationData(100, 11);
+
+        $this->assertAttributeSame($expected, 'items', $data);
+    }
+
     /**
      * @test
      *
      * @dataProvider claimValues
      *
      * @uses Lcobucci\JWT\ValidationData::__construct
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\ValidationData::setId
      */
@@ -50,6 +66,7 @@ class ValidationDataTest extends \PHPUnit_Framework_TestCase
      * @dataProvider claimValues
      *
      * @uses Lcobucci\JWT\ValidationData::__construct
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\ValidationData::setIssuer
      */
@@ -68,6 +85,7 @@ class ValidationDataTest extends \PHPUnit_Framework_TestCase
      * @dataProvider claimValues
      *
      * @uses Lcobucci\JWT\ValidationData::__construct
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\ValidationData::setAudience
      */
@@ -86,6 +104,7 @@ class ValidationDataTest extends \PHPUnit_Framework_TestCase
      * @dataProvider claimValues
      *
      * @uses Lcobucci\JWT\ValidationData::__construct
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\ValidationData::setSubject
      */
@@ -102,6 +121,7 @@ class ValidationDataTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\ValidationData::__construct
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\ValidationData::setCurrentTime
      */
@@ -114,10 +134,28 @@ class ValidationDataTest extends \PHPUnit_Framework_TestCase
         $this->assertAttributeSame($expected, 'items', $data);
     }
 
+    /**
+     * @test
+     *
+     * @uses   Lcobucci\JWT\ValidationData::__construct
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
+     *
+     * @covers Lcobucci\JWT\ValidationData::setCurrentTime
+     */
+    public function setCurrentTimeShouldChangeTheTimeBasedValuesUsingLeeway()
+    {
+        $expected = $this->createExpectedData(null, null, null, null, 30, 30, 10);
+        $data = new ValidationData(15, 10);
+        $data->setCurrentTime(20);
+
+        $this->assertAttributeSame($expected, 'items', $data);
+    }
+
     /**
      * @test
      *
      * @uses Lcobucci\JWT\ValidationData::__construct
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\ValidationData::has
      */
@@ -132,6 +170,7 @@ class ValidationDataTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\ValidationData::__construct
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\ValidationData::has
      */
@@ -146,6 +185,7 @@ class ValidationDataTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\ValidationData::__construct
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\ValidationData::has
      */
@@ -160,6 +200,7 @@ class ValidationDataTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\ValidationData::__construct
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\ValidationData::get
      */
@@ -174,6 +215,7 @@ class ValidationDataTest extends \PHPUnit_Framework_TestCase
      * @test
      *
      * @uses Lcobucci\JWT\ValidationData::__construct
+     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
      *
      * @covers Lcobucci\JWT\ValidationData::get
      */
@@ -196,11 +238,13 @@ class ValidationDataTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @param string $id
-     * @param string $sub
-     * @param string $iss
-     * @param string $aud
-     * @param int $time
+     * @param string|null $id
+     * @param string|null $sub
+     * @param string|null $iss
+     * @param string|null $aud
+     * @param int $iat
+     * @param int|null $nbf
+     * @param int|null $exp
      *
      * @return array
      */
@@ -209,16 +253,18 @@ class ValidationDataTest extends \PHPUnit_Framework_TestCase
         $sub = null,
         $iss = null,
         $aud = null,
-        $time = 1
+        $iat = 1,
+        $nbf = null,
+        $exp = null
     ) {
         return [
             'jti' => $id !== null ? (string) $id : null,
             'iss' => $iss !== null ? (string) $iss : null,
             'aud' => $aud !== null ? (string) $aud : null,
             'sub' => $sub !== null ? (string) $sub : null,
-            'iat' => $time,
-            'nbf' => $time,
-            'exp' => $time
+            'iat' => $iat,
+            'nbf' => $nbf !== null ? $nbf: $iat,
+            'exp' => $exp !== null ? $exp: $iat
         ];
     }
 }

+ 46 - 0
api/vendor/phpmailer/phpmailer/COMMITMENT

@@ -0,0 +1,46 @@
+GPL Cooperation Commitment
+Version 1.0
+
+Before filing or continuing to prosecute any legal proceeding or claim
+(other than a Defensive Action) arising from termination of a Covered
+License, we commit to extend to the person or entity ('you') accused
+of violating the Covered License the following provisions regarding
+cure and reinstatement, taken from GPL version 3. As used here, the
+term 'this License' refers to the specific Covered License being
+enforced.
+
+    However, if you cease all violation of this License, then your
+    license from a particular copyright holder is reinstated (a)
+    provisionally, unless and until the copyright holder explicitly
+    and finally terminates your license, and (b) permanently, if the
+    copyright holder fails to notify you of the violation by some
+    reasonable means prior to 60 days after the cessation.
+
+    Moreover, your license from a particular copyright holder is
+    reinstated permanently if the copyright holder notifies you of the
+    violation by some reasonable means, this is the first time you
+    have received notice of violation of this License (for any work)
+    from that copyright holder, and you cure the violation prior to 30
+    days after your receipt of the notice.
+
+We intend this Commitment to be irrevocable, and binding and
+enforceable against us and assignees of or successors to our
+copyrights.
+
+Definitions
+
+'Covered License' means the GNU General Public License, version 2
+(GPLv2), the GNU Lesser General Public License, version 2.1
+(LGPLv2.1), or the GNU Library General Public License, version 2
+(LGPLv2), all as published by the Free Software Foundation.
+
+'Defensive Action' means a legal proceeding or claim that We bring
+against you in response to a prior proceeding or claim initiated by
+you or your affiliate.
+
+'We' means each contributor to this repository as of the date of
+inclusion of this file, including subsidiaries of a corporate
+contributor.
+
+This work is available under a Creative Commons Attribution-ShareAlike
+4.0 International license (https://creativecommons.org/licenses/by-sa/4.0/).

+ 51 - 0
api/vendor/phpmailer/phpmailer/composer.json

@@ -0,0 +1,51 @@
+{
+    "name": "phpmailer/phpmailer",
+    "type": "library",
+    "description": "PHPMailer is a full-featured email creation and transfer class for PHP",
+    "authors": [
+        {
+            "name": "Marcus Bointon",
+            "email": "phpmailer@synchromedia.co.uk"
+        },
+        {
+            "name": "Jim Jagielski",
+            "email": "jimjag@gmail.com"
+        },
+        {
+            "name": "Andy Prevost",
+            "email": "codeworxtech@users.sourceforge.net"
+        },
+        {
+            "name": "Brent R. Matzelle"
+        }
+    ],
+    "require": {
+        "php": ">=5.5.0",
+        "ext-ctype": "*",
+        "ext-filter": "*"
+    },
+    "require-dev": {
+        "friendsofphp/php-cs-fixer": "^2.2",
+        "phpunit/phpunit": "^4.8 || ^5.7",
+        "doctrine/annotations": "^1.2"
+    },
+    "suggest": {
+        "psr/log": "For optional PSR-3 debug logging",
+        "league/oauth2-google": "Needed for Google XOAUTH2 authentication",
+        "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
+        "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication",
+        "ext-mbstring": "Needed to send email in multibyte encoding charset",
+        "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)"
+    },
+    "autoload": {
+        "psr-4": {
+            "PHPMailer\\PHPMailer\\": "src/"
+        }
+    },
+    "autoload-dev": {
+        "psr-4": {
+            "PHPMailer\\Test\\": "test/"
+        }
+    },
+    "license": "LGPL-2.1-only"
+}

+ 25 - 0
api/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php

@@ -0,0 +1,25 @@
+<?php
+/**
+ * Afrikaans PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP-fout: kon nie geverifieer word nie.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP-fout: kon nie aan SMTP-verbind nie.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP-fout: data nie aanvaar nie.';
+$PHPMAILER_LANG['empty_message']        = 'Boodskapliggaam leeg.';
+$PHPMAILER_LANG['encoding']             = 'Onbekende kodering: ';
+$PHPMAILER_LANG['execute']              = 'Kon nie uitvoer nie: ';
+$PHPMAILER_LANG['file_access']          = 'Kon nie lêer oopmaak nie: ';
+$PHPMAILER_LANG['file_open']            = 'Lêerfout: Kon nie lêer oopmaak nie: ';
+$PHPMAILER_LANG['from_failed']          = 'Die volgende Van adres misluk: ';
+$PHPMAILER_LANG['instantiate']          = 'Kon nie posfunksie instansieer nie.';
+$PHPMAILER_LANG['invalid_address']      = 'Ongeldige adres: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer word nie ondersteun nie.';
+$PHPMAILER_LANG['provide_address']      = 'U moet ten minste een ontvanger e-pos adres verskaf.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP-fout: Die volgende ontvangers het misluk: ';
+$PHPMAILER_LANG['signing']              = 'Ondertekening Fout: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP-verbinding () misluk.';
+$PHPMAILER_LANG['smtp_error']           = 'SMTP-bediener fout: ';
+$PHPMAILER_LANG['variable_set']         = 'Kan nie veranderlike instel of herstel nie: ';
+$PHPMAILER_LANG['extension_missing']    = 'Uitbreiding ontbreek: ';

+ 26 - 0
api/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php

@@ -0,0 +1,26 @@
+<?php
+/**
+ * Hindi PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Yash Karanke <mr.karanke@gmail.com>
+ */
+ 
+$PHPMAILER_LANG['authenticate']         = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। ';
+$PHPMAILER_LANG['connect_host']         = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। ';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। ';
+$PHPMAILER_LANG['empty_message']        = 'संदेश खाली है। ';
+$PHPMAILER_LANG['encoding']             = 'अज्ञात एन्कोडिंग प्रकार। ';
+$PHPMAILER_LANG['execute']              = 'आदेश को निष्पादित करने में विफल। ';
+$PHPMAILER_LANG['file_access']          = 'फ़ाइल उपलब्ध नहीं है। ';
+$PHPMAILER_LANG['file_open']            = 'फ़ाइल त्रुटि: फाइल को खोला नहीं जा सका। ';
+$PHPMAILER_LANG['from_failed']          = 'प्रेषक का पता गलत है। ';
+$PHPMAILER_LANG['instantiate']          = 'मेल फ़ंक्शन कॉल नहीं कर सकता है।';
+$PHPMAILER_LANG['invalid_address']      = 'पता गलत है। ';
+$PHPMAILER_LANG['mailer_not_supported'] = 'मेल सर्वर के साथ काम नहीं करता है। ';
+$PHPMAILER_LANG['provide_address']      = 'आपको कम से कम एक प्राप्तकर्ता का ई-मेल पता प्रदान करना होगा।';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP त्रुटि: निम्न प्राप्तकर्ताओं को पते भेजने में विफल। ';
+$PHPMAILER_LANG['signing']              = 'साइनअप त्रुटि:। ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP का connect () फ़ंक्शन विफल हुआ। ';
+$PHPMAILER_LANG['smtp_error']           = 'SMTP सर्वर त्रुटि। ';
+$PHPMAILER_LANG['variable_set']         = 'चर को बना या संशोधित नहीं किया जा सकता। ';
+$PHPMAILER_LANG['extension_missing']    = 'एक्सटेन्षन गायब है: ';

+ 25 - 0
api/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php

@@ -0,0 +1,25 @@
+<?php
+/**
+ * Malagasy PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Hackinet <piyushjha8164@gmail.com>
+ */
+$PHPMAILER_LANG['authenticate']         = 'Hadisoana SMTP: Tsy nahomby ny fanamarinana.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP Error: Tsy afaka mampifandray amin\'ny mpampiantrano SMTP.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP diso: tsy voarakitra ny angona.';
+$PHPMAILER_LANG['empty_message']        = 'Tsy misy ny votoaty mailaka.';
+$PHPMAILER_LANG['encoding']             = 'Tsy fantatra encoding: ';
+$PHPMAILER_LANG['execute']              = 'Tsy afaka manatanteraka ity baiko manaraka ity: ';
+$PHPMAILER_LANG['file_access']          = 'Tsy nahomby ny fidirana amin\'ity rakitra ity: ';
+$PHPMAILER_LANG['file_open']            = 'Hadisoana diso: Tsy afaka nanokatra ity file manaraka ity: ';
+$PHPMAILER_LANG['from_failed']          = 'Ny adiresy iraka manaraka dia diso: ';
+$PHPMAILER_LANG['instantiate']          = 'Tsy afaka nanomboka ny hetsika mail.';
+$PHPMAILER_LANG['invalid_address']      = 'Tsy mety ny adiresy: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer tsy manohana.';
+$PHPMAILER_LANG['provide_address']      = 'Alefaso azafady iray adiresy iray farafahakeliny.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Error: Tsy mety ireo mpanaraka ireto: ';
+$PHPMAILER_LANG['signing']              = 'Error nandritra ny sonia:';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'Tsy nahomby ny fifandraisana tamin\'ny server SMTP.';
+$PHPMAILER_LANG['smtp_error']           = 'Fahadisoana tamin\'ny server SMTP: ';
+$PHPMAILER_LANG['variable_set']         = 'Tsy azo atao ny mametraka na mamerina ny variable: ';
+$PHPMAILER_LANG['extension_missing']    = 'Tsy hita ny ampahany: ';

+ 27 - 0
api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php

@@ -0,0 +1,27 @@
+<?php
+/**
+ * Serbian PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Александар Јевремовић <ajevremovic@gmail.com>
+ * @author Miloš Milanović <mmilanovic016@gmail.com>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP грешка: аутентификација није успела.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP грешка: повезивање са SMTP сервером није успело.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP грешка: подаци нису прихваћени.';
+$PHPMAILER_LANG['empty_message']        = 'Садржај поруке је празан.';
+$PHPMAILER_LANG['encoding']             = 'Непознато кодирање: ';
+$PHPMAILER_LANG['execute']              = 'Није могуће извршити наредбу: ';
+$PHPMAILER_LANG['file_access']          = 'Није могуће приступити датотеци: ';
+$PHPMAILER_LANG['file_open']            = 'Није могуће отворити датотеку: ';
+$PHPMAILER_LANG['from_failed']          = 'SMTP грешка: слање са следећих адреса није успело: ';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP грешка: слање на следеће адресе није успело: ';
+$PHPMAILER_LANG['instantiate']          = 'Није могуће покренути mail функцију.';
+$PHPMAILER_LANG['invalid_address']      = 'Порука није послата. Неисправна адреса: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' мејлер није подржан.';
+$PHPMAILER_LANG['provide_address']      = 'Дефинишите бар једну адресу примаоца.';
+$PHPMAILER_LANG['signing']              = 'Грешка приликом пријаве: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'Повезивање са SMTP сервером није успело.';
+$PHPMAILER_LANG['smtp_error']           = 'Грешка SMTP сервера: ';
+$PHPMAILER_LANG['variable_set']         = 'Није могуће задати нити ресетовати променљиву: ';
+$PHPMAILER_LANG['extension_missing']    = 'Недостаје проширење: ';

+ 27 - 0
api/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php

@@ -0,0 +1,27 @@
+<?php
+/**
+ * Tagalog PHPMailer language file: refer to English translation for definitive list
+ *
+ *   @package PHPMailer
+ *   @author Adriane Justine Tan <adrianetan12@gmail.com>
+ */
+ 
+$PHPMAILER_LANG['authenticate']         = 'SMTP Error: Hindi mapatotohanan.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP Error: Hindi makakonekta sa SMTP host.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Error: Ang datos ay hindi maaaring matatanggap.';
+$PHPMAILER_LANG['empty_message']        = 'Walang laman ang mensahe';
+$PHPMAILER_LANG['encoding']             = 'Hindi alam ang encoding: ';
+$PHPMAILER_LANG['execute']              = 'Hindi maisasagawa: ';
+$PHPMAILER_LANG['file_access']          = 'Hindi ma-access ang file: ';
+$PHPMAILER_LANG['file_open']            = 'Hindi mabuksan ang file: ';
+$PHPMAILER_LANG['from_failed']          = 'Ang sumusunod na address ay nabigo: ';
+$PHPMAILER_LANG['instantiate']          = 'Hindi maaaring magbigay ng institusyon ang mail';
+$PHPMAILER_LANG['invalid_address']      = 'Hindi wasto ang address na naibigay: ';
+$PHPMAILER_LANG['mailer_not_supported'] = 'Ang mailer ay hindi suportado';
+$PHPMAILER_LANG['provide_address']      = 'Kailangan mong magbigay ng kahit isang email address na tatanggap';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Error: Ang mga sumusunod na tatanggap ay nabigo: ';
+$PHPMAILER_LANG['signing']              = 'Hindi ma-sign';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'Ang SMTP connect() ay nabigo';
+$PHPMAILER_LANG['smtp_error']           = 'Ang server ng SMTP ay nabigo';
+$PHPMAILER_LANG['variable_set']         = 'Hindi matatakda ang mga variables: ';
+$PHPMAILER_LANG['extension_missing']    = 'Nawawala ang extension';