CauseFX 5 anni fa
parent
commit
1c96917081
100 ha cambiato i file con 4449 aggiunte e 1786 eliminazioni
  1. 2 2
      api/composer.json
  2. 8 26
      api/composer.lock
  3. 5 5
      api/vendor/composer/InstalledVersions.php
  4. 0 3
      api/vendor/composer/autoload_files.php
  5. 0 3
      api/vendor/composer/autoload_static.php
  6. 8 26
      api/vendor/composer/installed.json
  7. 5 5
      api/vendor/composer/installed.php
  8. 3 0
      api/vendor/lcobucci/jwt/.gitignore
  9. 56 0
      api/vendor/lcobucci/jwt/.scrutinizer.yml
  10. 15 0
      api/vendor/lcobucci/jwt/.travis.yml
  11. 194 0
      api/vendor/lcobucci/jwt/README.md
  12. 0 4
      api/vendor/lcobucci/jwt/compat/class-aliases.php
  13. 0 7
      api/vendor/lcobucci/jwt/compat/json-exception-polyfill.php
  14. 0 70
      api/vendor/lcobucci/jwt/compat/lcobucci-clock-polyfill.php
  15. 1 9
      api/vendor/lcobucci/jwt/composer.json
  16. 27 0
      api/vendor/lcobucci/jwt/phpunit.xml.dist
  17. 36 156
      api/vendor/lcobucci/jwt/src/Builder.php
  18. 1 1
      api/vendor/lcobucci/jwt/src/Claim.php
  19. 0 13
      api/vendor/lcobucci/jwt/src/Claim/Factory.php
  20. 0 178
      api/vendor/lcobucci/jwt/src/Configuration.php
  21. 0 26
      api/vendor/lcobucci/jwt/src/Encoding/CannotDecodeContent.php
  22. 0 20
      api/vendor/lcobucci/jwt/src/Encoding/CannotEncodeContent.php
  23. 0 13
      api/vendor/lcobucci/jwt/src/Exception.php
  24. 29 47
      api/vendor/lcobucci/jwt/src/Parser.php
  25. 4 18
      api/vendor/lcobucci/jwt/src/Parsing/Decoder.php
  26. 4 18
      api/vendor/lcobucci/jwt/src/Parsing/Encoder.php
  27. 3 31
      api/vendor/lcobucci/jwt/src/Signature.php
  28. 0 4
      api/vendor/lcobucci/jwt/src/Signer/BaseSigner.php
  29. 0 19
      api/vendor/lcobucci/jwt/src/Signer/CannotSignPayload.php
  30. 0 27
      api/vendor/lcobucci/jwt/src/Signer/Ecdsa/ConversionFailed.php
  31. 4 3
      api/vendor/lcobucci/jwt/src/Signer/Ecdsa/MultibyteStringConverter.php
  32. 30 1
      api/vendor/lcobucci/jwt/src/Signer/Hmac.php
  33. 0 25
      api/vendor/lcobucci/jwt/src/Signer/InvalidKeyProvided.php
  34. 11 36
      api/vendor/lcobucci/jwt/src/Signer/Key.php
  35. 0 39
      api/vendor/lcobucci/jwt/src/Signer/Key/FileCouldNotBeRead.php
  36. 0 52
      api/vendor/lcobucci/jwt/src/Signer/Key/InMemory.php
  37. 0 38
      api/vendor/lcobucci/jwt/src/Signer/Key/LocalFileReference.php
  38. 0 21
      api/vendor/lcobucci/jwt/src/Signer/None.php
  39. 11 4
      api/vendor/lcobucci/jwt/src/Signer/OpenSSL.php
  40. 72 218
      api/vendor/lcobucci/jwt/src/Token.php
  41. 0 56
      api/vendor/lcobucci/jwt/src/Token/DataSet.php
  42. 0 35
      api/vendor/lcobucci/jwt/src/Token/InvalidTokenStructure.php
  43. 0 8
      api/vendor/lcobucci/jwt/src/Token/Plain.php
  44. 0 24
      api/vendor/lcobucci/jwt/src/Token/RegisteredClaimGiven.php
  45. 0 76
      api/vendor/lcobucci/jwt/src/Token/RegisteredClaims.php
  46. 0 8
      api/vendor/lcobucci/jwt/src/Token/Signature.php
  47. 0 15
      api/vendor/lcobucci/jwt/src/Token/UnsupportedHeaderFound.php
  48. 0 11
      api/vendor/lcobucci/jwt/src/Validation/Constraint.php
  49. 0 28
      api/vendor/lcobucci/jwt/src/Validation/Constraint/IdentifiedBy.php
  50. 0 28
      api/vendor/lcobucci/jwt/src/Validation/Constraint/IssuedBy.php
  51. 0 15
      api/vendor/lcobucci/jwt/src/Validation/Constraint/LeewayCannotBeNegative.php
  52. 0 27
      api/vendor/lcobucci/jwt/src/Validation/Constraint/PermittedFor.php
  53. 0 27
      api/vendor/lcobucci/jwt/src/Validation/Constraint/RelatedTo.php
  54. 0 34
      api/vendor/lcobucci/jwt/src/Validation/Constraint/SignedWith.php
  55. 0 72
      api/vendor/lcobucci/jwt/src/Validation/Constraint/ValidAt.php
  56. 0 10
      api/vendor/lcobucci/jwt/src/Validation/ConstraintViolation.php
  57. 0 10
      api/vendor/lcobucci/jwt/src/Validation/NoConstraintsGiven.php
  58. 0 53
      api/vendor/lcobucci/jwt/src/Validation/RequiredConstraintsViolated.php
  59. 0 55
      api/vendor/lcobucci/jwt/src/Validation/Validator.php
  60. 0 3
      api/vendor/lcobucci/jwt/src/ValidationData.php
  61. 0 23
      api/vendor/lcobucci/jwt/src/Validator.php
  62. 328 0
      api/vendor/lcobucci/jwt/test/functional/EcdsaTokenTest.php
  63. 186 0
      api/vendor/lcobucci/jwt/test/functional/HmacTokenTest.php
  64. 53 0
      api/vendor/lcobucci/jwt/test/functional/Keys.php
  65. 154 0
      api/vendor/lcobucci/jwt/test/functional/RFC6978VectorTest.php
  66. 280 0
      api/vendor/lcobucci/jwt/test/functional/RsaTokenTest.php
  67. 161 0
      api/vendor/lcobucci/jwt/test/functional/UnsignedTokenTest.php
  68. 5 0
      api/vendor/lcobucci/jwt/test/functional/ecdsa/private.key
  69. 8 0
      api/vendor/lcobucci/jwt/test/functional/ecdsa/private2.key
  70. 4 0
      api/vendor/lcobucci/jwt/test/functional/ecdsa/public1.key
  71. 4 0
      api/vendor/lcobucci/jwt/test/functional/ecdsa/public2.key
  72. 4 0
      api/vendor/lcobucci/jwt/test/functional/ecdsa/public3.key
  73. 30 0
      api/vendor/lcobucci/jwt/test/functional/rsa/encrypted-private.key
  74. 9 0
      api/vendor/lcobucci/jwt/test/functional/rsa/encrypted-public.key
  75. 28 0
      api/vendor/lcobucci/jwt/test/functional/rsa/private.key
  76. 9 0
      api/vendor/lcobucci/jwt/test/functional/rsa/public.key
  77. 633 0
      api/vendor/lcobucci/jwt/test/unit/BuilderTest.php
  78. 84 0
      api/vendor/lcobucci/jwt/test/unit/Claim/BasicTest.php
  79. 83 0
      api/vendor/lcobucci/jwt/test/unit/Claim/EqualsToTest.php
  80. 168 0
      api/vendor/lcobucci/jwt/test/unit/Claim/FactoryTest.php
  81. 107 0
      api/vendor/lcobucci/jwt/test/unit/Claim/GreaterOrEqualsToTest.php
  82. 107 0
      api/vendor/lcobucci/jwt/test/unit/Claim/LesserOrEqualsToTest.php
  83. 244 0
      api/vendor/lcobucci/jwt/test/unit/ParserTest.php
  84. 56 0
      api/vendor/lcobucci/jwt/test/unit/Parsing/DecoderTest.php
  85. 53 0
      api/vendor/lcobucci/jwt/test/unit/Parsing/EncoderTest.php
  86. 73 0
      api/vendor/lcobucci/jwt/test/unit/SignatureTest.php
  87. 128 0
      api/vendor/lcobucci/jwt/test/unit/Signer/BaseSignerTest.php
  88. 127 0
      api/vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/MultibyteStringConverterTest.php
  89. 60 0
      api/vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/Sha256Test.php
  90. 60 0
      api/vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/Sha384Test.php
  91. 60 0
      api/vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/Sha512Test.php
  92. 117 0
      api/vendor/lcobucci/jwt/test/unit/Signer/EcdsaTest.php
  93. 39 0
      api/vendor/lcobucci/jwt/test/unit/Signer/Hmac/Sha256Test.php
  94. 39 0
      api/vendor/lcobucci/jwt/test/unit/Signer/Hmac/Sha384Test.php
  95. 39 0
      api/vendor/lcobucci/jwt/test/unit/Signer/Hmac/Sha512Test.php
  96. 134 0
      api/vendor/lcobucci/jwt/test/unit/Signer/HmacTest.php
  97. 119 0
      api/vendor/lcobucci/jwt/test/unit/Signer/KeyTest.php
  98. 49 0
      api/vendor/lcobucci/jwt/test/unit/Signer/KeychainTest.php
  99. 39 0
      api/vendor/lcobucci/jwt/test/unit/Signer/Rsa/Sha256Test.php
  100. 39 0
      api/vendor/lcobucci/jwt/test/unit/Signer/Rsa/Sha384Test.php

+ 2 - 2
api/composer.json

@@ -1,7 +1,7 @@
 {
   "require": {
     "dibi/dibi": "^3.2",
-    "lcobucci/jwt": "^3.2",
+    "lcobucci/jwt": "3.3.1",
     "composer/semver": "^1.4",
     "phpmailer/phpmailer": "^6.2",
     "rmccue/requests": "^1.7",
@@ -18,4 +18,4 @@
     "bogstag/oauth2-trakt": "^1.0",
     "paquettg/php-html-parser": "^3.1"
   }
-}
+}

+ 8 - 26
api/composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "ee20c3224ed607ae3df1433bd9253824",
+    "content-hash": "a9cfe24cec195b73c109643bc90dc450",
     "packages": [
         {
             "name": "adldap2/adldap2",
@@ -847,16 +847,16 @@
         },
         {
             "name": "lcobucci/jwt",
-            "version": "3.4.5",
+            "version": "3.3.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/lcobucci/jwt.git",
-                "reference": "511629a54465e89a31d3d7e4cf0935feab8b14c1"
+                "reference": "a11ec5f4b4d75d1fcd04e133dede4c317aac9e18"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/lcobucci/jwt/zipball/511629a54465e89a31d3d7e4cf0935feab8b14c1",
-                "reference": "511629a54465e89a31d3d7e4cf0935feab8b14c1",
+                "url": "https://api.github.com/repos/lcobucci/jwt/zipball/a11ec5f4b4d75d1fcd04e133dede4c317aac9e18",
+                "reference": "a11ec5f4b4d75d1fcd04e133dede4c317aac9e18",
                 "shasum": ""
             },
             "require": {
@@ -871,9 +871,6 @@
                 "phpunit/phpunit": "^5.7 || ^7.3",
                 "squizlabs/php_codesniffer": "~2.3"
             },
-            "suggest": {
-                "lcobucci/clock": "*"
-            },
             "type": "library",
             "extra": {
                 "branch-alias": {
@@ -883,12 +880,7 @@
             "autoload": {
                 "psr-4": {
                     "Lcobucci\\JWT\\": "src"
-                },
-                "files": [
-                    "compat/class-aliases.php",
-                    "compat/json-exception-polyfill.php",
-                    "compat/lcobucci-clock-polyfill.php"
-                ]
+                }
             },
             "notification-url": "https://packagist.org/downloads/",
             "license": [
@@ -908,19 +900,9 @@
             ],
             "support": {
                 "issues": "https://github.com/lcobucci/jwt/issues",
-                "source": "https://github.com/lcobucci/jwt/tree/3.4.5"
+                "source": "https://github.com/lcobucci/jwt/tree/3.3"
             },
-            "funding": [
-                {
-                    "url": "https://github.com/lcobucci",
-                    "type": "github"
-                },
-                {
-                    "url": "https://www.patreon.com/lcobucci",
-                    "type": "patreon"
-                }
-            ],
-            "time": "2021-02-16T09:40:01+00:00"
+            "time": "2019-05-24T18:30:49+00:00"
         },
         {
             "name": "league/oauth2-client",

+ 5 - 5
api/vendor/composer/InstalledVersions.php

@@ -29,7 +29,7 @@ private static $installed = array (
     'aliases' => 
     array (
     ),
-    'reference' => '52153456a85d5d77cca0365ed49decf8d1012206',
+    'reference' => 'd116a5555c0c9912ce0b22091539443ff3a9711a',
     'name' => '__root__',
   ),
   'versions' => 
@@ -41,7 +41,7 @@ private static $installed = array (
       'aliases' => 
       array (
       ),
-      'reference' => '52153456a85d5d77cca0365ed49decf8d1012206',
+      'reference' => 'd116a5555c0c9912ce0b22091539443ff3a9711a',
     ),
     'adldap2/adldap2' => 
     array (
@@ -178,12 +178,12 @@ private static $installed = array (
     ),
     'lcobucci/jwt' => 
     array (
-      'pretty_version' => '3.4.5',
-      'version' => '3.4.5.0',
+      'pretty_version' => '3.3.1',
+      'version' => '3.3.1.0',
       'aliases' => 
       array (
       ),
-      'reference' => '511629a54465e89a31d3d7e4cf0935feab8b14c1',
+      'reference' => 'a11ec5f4b4d75d1fcd04e133dede4c317aac9e18',
     ),
     'league/oauth2-client' => 
     array (

+ 0 - 3
api/vendor/composer/autoload_files.php

@@ -22,8 +22,5 @@ return array(
     'fe62ba7e10580d903cc46d808b5961a4' => $vendorDir . '/tightenco/collect/src/Collect/Support/helpers.php',
     'caf31cc6ec7cf2241cb6f12c226c3846' => $vendorDir . '/tightenco/collect/src/Collect/Support/alias.php',
     '0097ca414fcb37c7130ac24b05f485f8' => $vendorDir . '/dibi/dibi/src/loader.php',
-    '256c1545158fc915c75e51a931bdba60' => $vendorDir . '/lcobucci/jwt/compat/class-aliases.php',
-    '0d273777b2b0d96e49fb3d800c6b0e81' => $vendorDir . '/lcobucci/jwt/compat/json-exception-polyfill.php',
-    'd6b246ac924292702635bb2349f4a64b' => $vendorDir . '/lcobucci/jwt/compat/lcobucci-clock-polyfill.php',
     '0ccdf99b8f62f02c52cba55802e0c2e7' => $vendorDir . '/zircote/swagger-php/src/functions.php',
 );

+ 0 - 3
api/vendor/composer/autoload_static.php

@@ -23,9 +23,6 @@ class ComposerStaticInitcbdc783d76f8e7563dcce7d8af053ecb
         'fe62ba7e10580d903cc46d808b5961a4' => __DIR__ . '/..' . '/tightenco/collect/src/Collect/Support/helpers.php',
         'caf31cc6ec7cf2241cb6f12c226c3846' => __DIR__ . '/..' . '/tightenco/collect/src/Collect/Support/alias.php',
         '0097ca414fcb37c7130ac24b05f485f8' => __DIR__ . '/..' . '/dibi/dibi/src/loader.php',
-        '256c1545158fc915c75e51a931bdba60' => __DIR__ . '/..' . '/lcobucci/jwt/compat/class-aliases.php',
-        '0d273777b2b0d96e49fb3d800c6b0e81' => __DIR__ . '/..' . '/lcobucci/jwt/compat/json-exception-polyfill.php',
-        'd6b246ac924292702635bb2349f4a64b' => __DIR__ . '/..' . '/lcobucci/jwt/compat/lcobucci-clock-polyfill.php',
         '0ccdf99b8f62f02c52cba55802e0c2e7' => __DIR__ . '/..' . '/zircote/swagger-php/src/functions.php',
     );
 

+ 8 - 26
api/vendor/composer/installed.json

@@ -879,17 +879,17 @@
         },
         {
             "name": "lcobucci/jwt",
-            "version": "3.4.5",
-            "version_normalized": "3.4.5.0",
+            "version": "3.3.1",
+            "version_normalized": "3.3.1.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/lcobucci/jwt.git",
-                "reference": "511629a54465e89a31d3d7e4cf0935feab8b14c1"
+                "reference": "a11ec5f4b4d75d1fcd04e133dede4c317aac9e18"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/lcobucci/jwt/zipball/511629a54465e89a31d3d7e4cf0935feab8b14c1",
-                "reference": "511629a54465e89a31d3d7e4cf0935feab8b14c1",
+                "url": "https://api.github.com/repos/lcobucci/jwt/zipball/a11ec5f4b4d75d1fcd04e133dede4c317aac9e18",
+                "reference": "a11ec5f4b4d75d1fcd04e133dede4c317aac9e18",
                 "shasum": ""
             },
             "require": {
@@ -904,10 +904,7 @@
                 "phpunit/phpunit": "^5.7 || ^7.3",
                 "squizlabs/php_codesniffer": "~2.3"
             },
-            "suggest": {
-                "lcobucci/clock": "*"
-            },
-            "time": "2021-02-16T09:40:01+00:00",
+            "time": "2019-05-24T18:30:49+00:00",
             "type": "library",
             "extra": {
                 "branch-alias": {
@@ -918,12 +915,7 @@
             "autoload": {
                 "psr-4": {
                     "Lcobucci\\JWT\\": "src"
-                },
-                "files": [
-                    "compat/class-aliases.php",
-                    "compat/json-exception-polyfill.php",
-                    "compat/lcobucci-clock-polyfill.php"
-                ]
+                }
             },
             "notification-url": "https://packagist.org/downloads/",
             "license": [
@@ -943,18 +935,8 @@
             ],
             "support": {
                 "issues": "https://github.com/lcobucci/jwt/issues",
-                "source": "https://github.com/lcobucci/jwt/tree/3.4.5"
+                "source": "https://github.com/lcobucci/jwt/tree/3.3"
             },
-            "funding": [
-                {
-                    "url": "https://github.com/lcobucci",
-                    "type": "github"
-                },
-                {
-                    "url": "https://www.patreon.com/lcobucci",
-                    "type": "patreon"
-                }
-            ],
             "install-path": "../lcobucci/jwt"
         },
         {

+ 5 - 5
api/vendor/composer/installed.php

@@ -6,7 +6,7 @@
     'aliases' => 
     array (
     ),
-    'reference' => '52153456a85d5d77cca0365ed49decf8d1012206',
+    'reference' => 'd116a5555c0c9912ce0b22091539443ff3a9711a',
     'name' => '__root__',
   ),
   'versions' => 
@@ -18,7 +18,7 @@
       'aliases' => 
       array (
       ),
-      'reference' => '52153456a85d5d77cca0365ed49decf8d1012206',
+      'reference' => 'd116a5555c0c9912ce0b22091539443ff3a9711a',
     ),
     'adldap2/adldap2' => 
     array (
@@ -155,12 +155,12 @@
     ),
     'lcobucci/jwt' => 
     array (
-      'pretty_version' => '3.4.5',
-      'version' => '3.4.5.0',
+      'pretty_version' => '3.3.1',
+      'version' => '3.3.1.0',
       'aliases' => 
       array (
       ),
-      'reference' => '511629a54465e89a31d3d7e4cf0935feab8b14c1',
+      'reference' => 'a11ec5f4b4d75d1fcd04e133dede4c317aac9e18',
     ),
     'league/oauth2-client' => 
     array (

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

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

+ 56 - 0
api/vendor/lcobucci/jwt/.scrutinizer.yml

@@ -0,0 +1,56 @@
+build:
+    environment:
+        mysql: false
+        postgresql: false
+        redis: false
+        rabbitmq: false
+        php:
+            version: 5.6
+tools:
+    php_sim: true
+    php_pdepend: true
+    php_analyzer: true
+    php_changetracking: true
+    php_code_sniffer:
+        config:
+            standard: "PSR2"
+    php_mess_detector: true
+checks:
+    php:
+        code_rating: true
+        duplication: true
+        argument_type_checks: true
+        assignment_of_null_return: true
+        avoid_conflicting_incrementers: true
+        avoid_useless_overridden_methods: true
+        catch_class_exists: true
+        closure_use_modifiable: true
+        closure_use_not_conflicting: true
+        deprecated_code_usage: true
+        method_calls_on_non_object: true
+        missing_arguments: true
+        no_duplicate_arguments: true
+        no_non_implemented_abstract_methods: true
+        no_property_on_interface: true
+        parameter_non_unique: true
+        precedence_in_conditions: true
+        precedence_mistakes: true
+        require_php_tag_first: true
+        security_vulnerabilities: true
+        sql_injection_vulnerabilities: true
+        too_many_arguments: true
+        unreachable_code: true
+        unused_methods: true
+        unused_parameters: true
+        unused_properties: true
+        unused_variables: true
+        use_statement_alias_conflict: true
+        useless_calls: true
+        variable_existence: true
+        verify_access_scope_valid: true
+        verify_argument_usable_as_reference: true
+        verify_property_names: true
+
+filter:
+    excluded_paths:
+        - test/*

+ 15 - 0
api/vendor/lcobucci/jwt/.travis.yml

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

+ 194 - 0
api/vendor/lcobucci/jwt/README.md

@@ -0,0 +1,194 @@
+# JWT
+[![Gitter](https://img.shields.io/badge/GITTER-JOIN%20CHAT%20%E2%86%92-brightgreen.svg?style=flat-square)](https://gitter.im/lcobucci/jwt?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Total Downloads](https://img.shields.io/packagist/dt/lcobucci/jwt.svg?style=flat-square)](https://packagist.org/packages/lcobucci/jwt) [![Latest Stable Version](https://img.shields.io/packagist/v/lcobucci/jwt.svg?style=flat-square)](https://packagist.org/packages/lcobucci/jwt)
+
+![Branch master](https://img.shields.io/badge/branch-master-brightgreen.svg?style=flat-square)
+[![Build Status](https://img.shields.io/travis/lcobucci/jwt/master.svg?style=flat-square)](http://travis-ci.org/#!/lcobucci/jwt)
+[![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.6+).
+The implementation is based on the [RFC 7519](https://tools.ietf.org/html/rfc7519).
+
+## Installation
+
+Package is available on [Packagist](http://packagist.org/packages/lcobucci/jwt),
+you can install it using [Composer](http://getcomposer.org).
+
+```shell
+composer require lcobucci/jwt
+```
+
+### Dependencies
+
+- PHP 5.6+
+- OpenSSL Extension
+
+## Basic usage
+
+### Creating
+
+Just use the builder to create a new JWT/JWS tokens:
+
+```php
+use Lcobucci\JWT\Builder;
+
+$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
+
+
+$token->getHeaders(); // Retrieves the token headers
+$token->getClaims(); // Retrieves the token claims
+
+echo $token->getHeader('jti'); // will print "4f1g23a12aa"
+echo $token->getClaim('iss'); // will print "http://example.com"
+echo $token->getClaim('uid'); // will print "1"
+echo $token; // The string representation of the object is a JWT string (pretty easy, right?)
+```
+
+### Parsing from strings
+
+Use the parser to create a new token from a JWT string (using the previous token as example):
+
+```php
+use Lcobucci\JWT\Parser;
+
+$token = (new Parser())->parse((string) $token); // Parses from a string
+$token->getHeaders(); // Retrieves the token header
+$token->getClaims(); // Retrieves the token claims
+
+echo $token->getHeader('jti'); // will print "4f1g23a12aa"
+echo $token->getClaim('iss'); // will print "http://example.com"
+echo $token->getClaim('uid'); // will print "1"
+```
+
+### Validating
+
+We can easily validate if the token is valid (using the previous token and time as example):
+
+```php
+use Lcobucci\JWT\ValidationData;
+
+$data = new ValidationData(); // It will use the current time to validate (iat, nbf and exp)
+$data->setIssuer('http://example.com');
+$data->setAudience('http://example.org');
+$data->setId('4f1g23a12aa');
+
+var_dump($token->validate($data)); // false, because token cannot be used before now() + 60
+
+$data->setCurrentTime($time + 61); // changing the validation time to future
+
+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
+
+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())->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
+var_dump($token->verify($signer, 'testing')); // true, because the key is the same
+```
+
+### RSA and ECDSA
+
+RSA and ECDSA signatures are based on public and private keys so you have to generate using the private key and verify using the public key:
+
+```php
+use Lcobucci\JWT\Builder;
+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();
+
+$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, $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!**

+ 0 - 4
api/vendor/lcobucci/jwt/compat/class-aliases.php

@@ -1,4 +0,0 @@
-<?php
-
-class_exists(\Lcobucci\JWT\Token\Plain::class, false) || class_alias(\Lcobucci\JWT\Token::class, \Lcobucci\JWT\Token\Plain::class);
-class_exists(\Lcobucci\JWT\Token\Signature::class, false) || class_alias(\Lcobucci\JWT\Signature::class, \Lcobucci\JWT\Token\Signature::class);

+ 0 - 7
api/vendor/lcobucci/jwt/compat/json-exception-polyfill.php

@@ -1,7 +0,0 @@
-<?php
-
-if (PHP_VERSION_ID < 70300 && ! class_exists('JsonException')) {
-    class JsonException extends Exception
-    {
-    }
-}

+ 0 - 70
api/vendor/lcobucci/jwt/compat/lcobucci-clock-polyfill.php

@@ -1,70 +0,0 @@
-<?php
-
-namespace Lcobucci\Clock;
-
-use DateTimeImmutable;
-use DateTimeZone;
-use function interface_exists;
-
-if (! interface_exists(Clock::class)) {
-    interface Clock
-    {
-        /** @return DateTimeImmutable */
-        public function now();
-    }
-
-    final class FrozenClock implements Clock
-    {
-        /** @var DateTimeImmutable */
-        private $now;
-
-        public function __construct(DateTimeImmutable $now)
-        {
-            $this->now = $now;
-        }
-
-        /** @return self */
-        public static function fromUTC()
-        {
-            return new self(new DateTimeImmutable('now', new DateTimeZone('UTC')));
-        }
-
-        public function setTo(DateTimeImmutable $now)
-        {
-            $this->now = $now;
-        }
-
-        public function now()
-        {
-            return $this->now;
-        }
-    }
-
-    final class SystemClock implements Clock
-    {
-        /** @var DateTimeZone */
-        private $timezone;
-
-        public function __construct(DateTimeZone $timezone)
-        {
-            $this->timezone = $timezone;
-        }
-
-        /** @return self */
-        public static function fromUTC()
-        {
-            return new self(new DateTimeZone('UTC'));
-        }
-
-        /** @return self */
-        public static function fromSystemTimezone()
-        {
-            return new self(new DateTimeZone(date_default_timezone_get()));
-        }
-
-        public function now()
-        {
-            return new DateTimeImmutable('now', $this->timezone);
-        }
-    }
-}

+ 1 - 9
api/vendor/lcobucci/jwt/composer.json

@@ -31,12 +31,7 @@
     "autoload": {
         "psr-4": {
             "Lcobucci\\JWT\\": "src"
-        },
-        "files": [
-            "compat/class-aliases.php",
-            "compat/json-exception-polyfill.php",
-            "compat/lcobucci-clock-polyfill.php"
-        ]
+        }
     },
     "autoload-dev": {
         "psr-4": {
@@ -46,9 +41,6 @@
             ]
         }
     },
-    "suggest": {
-        "lcobucci/clock": "*"
-    },
     "extra": {
         "branch-alias": {
             "dev-master": "3.1-dev"

+ 27 - 0
api/vendor/lcobucci/jwt/phpunit.xml.dist

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
+    colors="true"
+    verbose="true"
+    beStrictAboutOutputDuringTests="true"
+    beStrictAboutTodoAnnotatedTests="true"
+    beStrictAboutChangesToGlobalState="true"
+    beStrictAboutCoversAnnotation="true"
+    beStrictAboutResourceUsageDuringSmallTests="true"
+    beStrictAboutTestsThatDoNotTestAnything="true"
+    forceCoversAnnotation="true">
+	<testsuites>
+		<testsuite name="Unit Test Suite">
+			<directory>test/unit</directory>
+		</testsuite>
+		<testsuite name="Integration Test Suite">
+			<directory>test/functional</directory>
+		</testsuite>
+	</testsuites>
+
+    <filter>
+        <whitelist processUncoveredFilesFromWhitelist="true">
+            <directory suffix=".php">src</directory>
+        </whitelist>
+    </filter>
+</phpunit>

+ 36 - 156
api/vendor/lcobucci/jwt/src/Builder.php

@@ -7,26 +7,10 @@
 
 namespace Lcobucci\JWT;
 
-use DateTimeImmutable;
 use Lcobucci\JWT\Claim\Factory as ClaimFactory;
 use Lcobucci\JWT\Parsing\Encoder;
 use Lcobucci\JWT\Signer\Key;
-use Lcobucci\JWT\Token\DataSet;
-use Lcobucci\JWT\Token\RegisteredClaimGiven;
-use Lcobucci\JWT\Token\RegisteredClaims;
-
-use function array_diff;
-use function array_filter;
-use function array_key_exists;
-use function array_merge;
-use function array_shift;
-use function count;
-use function current;
-use function in_array;
-use function is_array;
-use function is_bool;
-use function trigger_error;
-use const E_USER_DEPRECATED;
+use function implode;
 
 /**
  * This class makes easier the token creation process
@@ -101,32 +85,20 @@ class Builder
      */
     public function canOnlyBeUsedBy($audience, $replicateAsHeader = false)
     {
-        return $this->permittedFor($audience, $replicateAsHeader);
+        return $this->setRegisteredClaim('aud', (string) $audience, $replicateAsHeader);
     }
 
     /**
      * Configures the audience
      *
-     * @param list<string|bool> $audiences A list of audiences and, optionally, the instruction to replicate as header
+     * @param string $audience
+     * @param bool $replicateAsHeader
      *
      * @return Builder
      */
-    public function permittedFor(...$audiences)
+    public function permittedFor($audience, $replicateAsHeader = false)
     {
-        $claim = RegisteredClaims::AUDIENCE;
-
-        $replicateAsHeader = false;
-
-        if ($audiences !== [] && is_bool($audiences[count($audiences) - 1])) {
-            $replicateAsHeader = array_pop($audiences);
-        }
-
-        $audiences = array_filter($audiences, 'is_string');
-
-        $configured = array_key_exists($claim, $this->claims) ? $this->claims[$claim] : [];
-        $toAppend   = array_diff($audiences, $configured);
-
-        return $this->setRegisteredClaim($claim, array_merge($configured, $toAppend), $replicateAsHeader);
+        return $this->setRegisteredClaim('aud', (string) $audience, $replicateAsHeader);
     }
 
     /**
@@ -142,36 +114,20 @@ class Builder
      */
     public function setAudience($audience, $replicateAsHeader = false)
     {
-        return $this->permittedFor($audience, $replicateAsHeader);
+        return $this->setRegisteredClaim('aud', (string) $audience, $replicateAsHeader);
     }
 
     /**
      * Configures the expiration time
      *
-     * @param int|DateTimeImmutable $expiration
+     * @param int $expiration
      * @param boolean $replicateAsHeader
      *
      * @return Builder
      */
     public function expiresAt($expiration, $replicateAsHeader = false)
     {
-        return $this->setRegisteredClaim('exp', $this->convertToDate($expiration), $replicateAsHeader);
-    }
-
-    /**
-     * @param int|DateTimeImmutable $value
-     *
-     * @return DateTimeImmutable
-     */
-    private function convertToDate($value)
-    {
-        if (! $value instanceof DateTimeImmutable) {
-            trigger_error('Using integers for registered date claims is deprecated, please use DateTimeImmutable objects instead.', E_USER_DEPRECATED);
-
-            return new DateTimeImmutable('@' . $value);
-        }
-
-        return $value;
+        return $this->setRegisteredClaim('exp', (int) $expiration, $replicateAsHeader);
     }
 
     /**
@@ -180,14 +136,14 @@ class Builder
      * @deprecated This method will be removed on v4
      * @see Builder::expiresAt()
      *
-     * @param int|DateTimeImmutable $expiration
+     * @param int $expiration
      * @param boolean $replicateAsHeader
      *
      * @return Builder
      */
     public function setExpiration($expiration, $replicateAsHeader = false)
     {
-        return $this->expiresAt($expiration, $replicateAsHeader);
+        return $this->setRegisteredClaim('exp', (int) $expiration, $replicateAsHeader);
     }
 
     /**
@@ -222,14 +178,14 @@ class Builder
     /**
      * Configures the time that the token was issued
      *
-     * @param int|DateTimeImmutable $issuedAt
+     * @param int $issuedAt
      * @param boolean $replicateAsHeader
      *
      * @return Builder
      */
     public function issuedAt($issuedAt, $replicateAsHeader = false)
     {
-        return $this->setRegisteredClaim('iat', $this->convertToDate($issuedAt), $replicateAsHeader);
+        return $this->setRegisteredClaim('iat', (int) $issuedAt, $replicateAsHeader);
     }
 
     /**
@@ -238,7 +194,7 @@ class Builder
      * @deprecated This method will be removed on v4
      * @see Builder::issuedAt()
      *
-     * @param int|DateTimeImmutable $issuedAt
+     * @param int $issuedAt
      * @param boolean $replicateAsHeader
      *
      * @return Builder
@@ -280,14 +236,14 @@ class Builder
     /**
      * Configures the time before which the token cannot be accepted
      *
-     * @param int|DateTimeImmutable $notBefore
+     * @param int $notBefore
      * @param boolean $replicateAsHeader
      *
      * @return Builder
      */
     public function canOnlyBeUsedAfter($notBefore, $replicateAsHeader = false)
     {
-        return $this->setRegisteredClaim('nbf', $this->convertToDate($notBefore), $replicateAsHeader);
+        return $this->setRegisteredClaim('nbf', (int) $notBefore, $replicateAsHeader);
     }
 
     /**
@@ -296,7 +252,7 @@ class Builder
      * @deprecated This method will be removed on v4
      * @see Builder::canOnlyBeUsedAfter()
      *
-     * @param int|DateTimeImmutable $notBefore
+     * @param int $notBefore
      * @param boolean $replicateAsHeader
      *
      * @return Builder
@@ -346,12 +302,10 @@ class Builder
      */
     protected function setRegisteredClaim($name, $value, $replicate)
     {
-        $this->configureClaim($name, $value);
+        $this->withClaim($name, $value);
 
         if ($replicate) {
-            trigger_error('Replicating claims as headers is deprecated and will removed from v4.0. Please manually set the header if you need it replicated.', E_USER_DEPRECATED);
-
-            $this->headers[$name] = $value;
+            $this->headers[$name] = $this->claims[$name];
         }
 
         return $this;
@@ -367,7 +321,7 @@ class Builder
      */
     public function withHeader($name, $value)
     {
-        $this->headers[(string) $name] = $value;
+        $this->headers[(string) $name] = $this->claimFactory->create($name, $value);
 
         return $this;
     }
@@ -404,19 +358,6 @@ class Builder
         return $this->withClaim($name, $value);
     }
 
-    /**
-     * @param string $name
-     * @param mixed $value
-     *
-     * @return Builder
-     */
-    private function configureClaim($name, $value)
-    {
-        $this->claims[(string) $name] = $value;
-
-        return $this;
-    }
-
     /**
      * Configures a claim item
      *
@@ -424,36 +365,12 @@ class Builder
      * @param mixed $value
      *
      * @return Builder
-     *
-     * @throws RegisteredClaimGiven
      */
     public function withClaim($name, $value)
     {
-        if (in_array($name, RegisteredClaims::ALL, true)) {
-            trigger_error('The use of the method "withClaim" is deprecated for registered claims. Please use dedicated method instead.', E_USER_DEPRECATED);
-        }
+        $this->claims[(string) $name] = $this->claimFactory->create($name, $value);
 
-        return $this->forwardCallToCorrectClaimMethod($name, $value);
-    }
-
-    private function forwardCallToCorrectClaimMethod($name, $value)
-    {
-        switch ($name) {
-            case RegisteredClaims::ID:
-                return $this->identifiedBy($value);
-            case RegisteredClaims::EXPIRATION_TIME:
-                return $this->expiresAt($value);
-            case RegisteredClaims::NOT_BEFORE:
-                return $this->canOnlyBeUsedAfter($value);
-            case RegisteredClaims::ISSUED_AT:
-                return $this->issuedAt($value);
-            case RegisteredClaims::ISSUER:
-                return $this->issuedBy($value);
-            case RegisteredClaims::AUDIENCE:
-                return $this->permittedFor($value);
-            default:
-                return $this->configureClaim($name, $value);
-        }
+        return $this;
     }
 
     /**
@@ -469,7 +386,7 @@ class Builder
      */
     public function set($name, $value)
     {
-        return $this->forwardCallToCorrectClaimMethod($name, $value);
+        return $this->withClaim($name, $value);
     }
 
     /**
@@ -486,8 +403,6 @@ class Builder
     public function sign(Signer $signer, $key)
     {
         if (! $key instanceof Key) {
-            trigger_error('Implicit conversion of keys from strings is deprecated. Please use InMemory or LocalFileReference classes.', E_USER_DEPRECATED);
-
             $key = new Key($key);
         }
 
@@ -520,10 +435,6 @@ class Builder
      */
     public function getToken(Signer $signer = null, Key $key = null)
     {
-        if ($signer === null || $key === null) {
-            trigger_error('Not specifying the signer and key to Builder#getToken() is deprecated. Please move the arguments from Builder#sign() to Builder#getToken().', E_USER_DEPRECATED);
-        }
-
         $signer = $signer ?: $this->signer;
         $key = $key ?: $this->key;
 
@@ -531,62 +442,31 @@ class Builder
             $signer->modifyHeader($this->headers);
         }
 
-        $headers = new DataSet(
-            $this->headers,
-            $this->encoder->base64UrlEncode($this->encoder->jsonEncode($this->convertItems($this->headers)))
-        );
-
-        $claims = new DataSet(
-            $this->claims,
-            $this->encoder->base64UrlEncode($this->encoder->jsonEncode($this->convertItems($this->claims)))
-        );
-
-        return new Token(
-            $headers,
-            $claims,
-            $this->createSignature($headers->toString() . '.' . $claims->toString(), $signer, $key),
-            ['', ''],
-            $this->claimFactory
-        );
-    }
-
-    /**
-     * @param array<string, mixed> $items
-     *
-     * @return array<string, mixed>
-     */
-    private function convertItems(array $items)
-    {
-        foreach (RegisteredClaims::DATE_CLAIMS as $name) {
-            if (! array_key_exists($name, $items) || ! $items[$name] instanceof DateTimeImmutable) {
-                continue;
-            }
-
-            $items[$name] = $items[$name]->getTimestamp();
-        }
+        $payload = [
+            $this->encoder->base64UrlEncode($this->encoder->jsonEncode($this->headers)),
+            $this->encoder->base64UrlEncode($this->encoder->jsonEncode($this->claims))
+        ];
 
-        $audience = RegisteredClaims::AUDIENCE;
+        $signature = $this->createSignature($payload, $signer, $key);
 
-        if (array_key_exists($audience, $items) && is_array($items[$audience]) && count($items[$audience]) === 1) {
-            $items[$audience] = current($items[$audience]);
+        if ($signature !== null) {
+            $payload[] = $this->encoder->base64UrlEncode($signature);
         }
 
-        return $items;
+        return new Token($this->headers, $this->claims, $signature, $payload);
     }
 
     /**
-     * @param string $payload
+     * @param string[] $payload
      *
-     * @return Signature
+     * @return Signature|null
      */
-    private function createSignature($payload, Signer $signer = null, Key $key = null)
+    private function createSignature(array $payload, Signer $signer = null, Key $key = null)
     {
         if ($signer === null || $key === null) {
-            return Signature::fromEmptyData();
+            return null;
         }
 
-        $hash = $signer->sign($payload, $key)->hash();
-
-        return new Signature($hash, $this->encoder->base64UrlEncode($hash));
+        return $signer->sign(implode('.', $payload), $key);
     }
 }

+ 1 - 1
api/vendor/lcobucci/jwt/src/Claim.php

@@ -27,7 +27,7 @@ interface Claim extends JsonSerializable
     /**
      * Returns the claim value
      *
-     * @return mixed
+     * @return string
      */
     public function getValue();
 

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

@@ -7,12 +7,7 @@
 
 namespace Lcobucci\JWT\Claim;
 
-use DateTimeImmutable;
 use Lcobucci\JWT\Claim;
-use Lcobucci\JWT\Token\RegisteredClaims;
-use function current;
-use function in_array;
-use function is_array;
 
 /**
  * Class that create claims
@@ -62,14 +57,6 @@ class Factory
      */
     public function create($name, $value)
     {
-        if ($value instanceof DateTimeImmutable && in_array($name, RegisteredClaims::DATE_CLAIMS, true)) {
-            $value = $value->getTimestamp();
-        }
-
-        if ($name === RegisteredClaims::AUDIENCE && is_array($value)) {
-            $value = current($value);
-        }
-
         if (!empty($this->callbacks[$name])) {
             return call_user_func($this->callbacks[$name], $name, $value);
         }

+ 0 - 178
api/vendor/lcobucci/jwt/src/Configuration.php

@@ -1,178 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT;
-
-use Closure;
-use Lcobucci\JWT\Parsing\Decoder;
-use Lcobucci\JWT\Parsing\Encoder;
-use Lcobucci\JWT\Signer\Key;
-use Lcobucci\JWT\Signer\Key\InMemory;
-use Lcobucci\JWT\Signer\None;
-use Lcobucci\JWT\Validation\Constraint;
-
-/**
- * Configuration container for the JWT Builder and Parser
- *
- * Serves like a small DI container to simplify the creation and usage
- * of the objects.
- */
-final class Configuration
-{
-    /** @var Parser */
-    private $parser;
-
-    /** @var Signer */
-    private $signer;
-
-    /** @var Key */
-    private $signingKey;
-
-    /** @var Key */
-    private $verificationKey;
-
-    /** @var Validator */
-    private $validator;
-
-    /** @var Closure(): Builder */
-    private $builderFactory;
-
-    /** @var Constraint[] */
-    private $validationConstraints = [];
-
-    private function __construct(
-        Signer $signer,
-        Key $signingKey,
-        Key $verificationKey,
-        Encoder $encoder = null,
-        Decoder $decoder = null
-    ) {
-        $this->signer          = $signer;
-        $this->signingKey      = $signingKey;
-        $this->verificationKey = $verificationKey;
-        $this->parser          = new Parser($decoder ?: new Decoder());
-        $this->validator       = new Validation\Validator();
-
-        $this->builderFactory = static function () use ($encoder) {
-            return new Builder($encoder ?: new Encoder());
-        };
-    }
-
-    /** @return self */
-    public static function forAsymmetricSigner(
-        Signer $signer,
-        Key $signingKey,
-        Key $verificationKey,
-        Encoder $encoder = null,
-        Decoder $decoder = null
-    ) {
-        return new self(
-            $signer,
-            $signingKey,
-            $verificationKey,
-            $encoder,
-            $decoder
-        );
-    }
-
-    /** @return self */
-    public static function forSymmetricSigner(
-        Signer $signer,
-        Key $key,
-        Encoder $encoder = null,
-        Decoder $decoder = null
-    ) {
-        return new self(
-            $signer,
-            $key,
-            $key,
-            $encoder,
-            $decoder
-        );
-    }
-
-    /** @return self */
-    public static function forUnsecuredSigner(
-        Encoder $encoder = null,
-        Decoder $decoder = null
-    ) {
-        $key = InMemory::plainText('');
-
-        return new self(
-            new None(),
-            $key,
-            $key,
-            $encoder,
-            $decoder
-        );
-    }
-
-    /** @param callable(): Builder $builderFactory */
-    public function setBuilderFactory(callable $builderFactory)
-    {
-        if (! $builderFactory instanceof Closure) {
-            $builderFactory = static function() use ($builderFactory) {
-                return $builderFactory();
-            };
-        }
-        $this->builderFactory = $builderFactory;
-    }
-
-    /** @return Builder */
-    public function builder()
-    {
-        $factory = $this->builderFactory;
-
-        return $factory();
-    }
-
-    /** @return Parser */
-    public function parser()
-    {
-        return $this->parser;
-    }
-
-    public function setParser(Parser $parser)
-    {
-        $this->parser = $parser;
-    }
-
-    /** @return Signer */
-    public function signer()
-    {
-        return $this->signer;
-    }
-
-    /** @return Key */
-    public function signingKey()
-    {
-        return $this->signingKey;
-    }
-
-    /** @return Key */
-    public function verificationKey()
-    {
-        return $this->verificationKey;
-    }
-
-    /** @return Validator */
-    public function validator()
-    {
-        return $this->validator;
-    }
-
-    public function setValidator(Validator $validator)
-    {
-        $this->validator = $validator;
-    }
-
-    /** @return Constraint[] */
-    public function validationConstraints()
-    {
-        return $this->validationConstraints;
-    }
-
-    public function setValidationConstraints(Constraint ...$validationConstraints)
-    {
-        $this->validationConstraints = $validationConstraints;
-    }
-}

+ 0 - 26
api/vendor/lcobucci/jwt/src/Encoding/CannotDecodeContent.php

@@ -1,26 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Encoding;
-
-use JsonException;
-use Lcobucci\JWT\Exception;
-use RuntimeException;
-
-final class CannotDecodeContent extends RuntimeException implements Exception
-{
-    /**
-     * @param JsonException $previous
-     *
-     * @return self
-     */
-    public static function jsonIssues(JsonException $previous)
-    {
-        return new self('Error while decoding from JSON', 0, $previous);
-    }
-
-    /** @return self */
-    public static function invalidBase64String()
-    {
-        return new self('Error while decoding from Base64Url, invalid base64 characters detected');
-    }
-}

+ 0 - 20
api/vendor/lcobucci/jwt/src/Encoding/CannotEncodeContent.php

@@ -1,20 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Encoding;
-
-use JsonException;
-use Lcobucci\JWT\Exception;
-use RuntimeException;
-
-final class CannotEncodeContent extends RuntimeException implements Exception
-{
-    /**
-     * @param JsonException $previous
-     *
-     * @return self
-     */
-    public static function jsonIssues(JsonException $previous)
-    {
-        return new self('Error while encoding to JSON', 0, $previous);
-    }
-}

+ 0 - 13
api/vendor/lcobucci/jwt/src/Exception.php

@@ -1,13 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT;
-
-if (PHP_MAJOR_VERSION === 5) {
-    interface Exception
-    {
-    }
-} else {
-    interface Exception extends \Throwable
-    {
-    }
-}

+ 29 - 47
api/vendor/lcobucci/jwt/src/Parser.php

@@ -7,16 +7,9 @@
 
 namespace Lcobucci\JWT;
 
-use DateTimeImmutable;
 use InvalidArgumentException;
+use Lcobucci\JWT\Claim\Factory as ClaimFactory;
 use Lcobucci\JWT\Parsing\Decoder;
-use Lcobucci\JWT\Token\DataSet;
-use Lcobucci\JWT\Token\InvalidTokenStructure;
-use Lcobucci\JWT\Token\RegisteredClaims;
-use Lcobucci\JWT\Token\UnsupportedHeaderFound;
-use RuntimeException;
-use function array_key_exists;
-use function is_array;
 
 /**
  * This class parses the JWT strings and convert them into tokens
@@ -33,14 +26,25 @@ class Parser
      */
     private $decoder;
 
+    /**
+     * The claims factory
+     *
+     * @var ClaimFactory
+     */
+    private $claimFactory;
+
     /**
      * Initializes the object
      *
      * @param Decoder $decoder
+     * @param ClaimFactory $claimFactory
      */
-    public function __construct(Decoder $decoder = null)
-    {
+    public function __construct(
+        Decoder $decoder = null,
+        ClaimFactory $claimFactory = null
+    ) {
         $this->decoder = $decoder ?: new Decoder();
+        $this->claimFactory = $claimFactory ?: new ClaimFactory();
     }
 
     /**
@@ -49,9 +53,6 @@ class Parser
      * @param string $jwt
      *
      * @return Token
-     *
-     * @throws InvalidArgumentException  When JWT is not a string or is invalid.
-     * @throws RuntimeException          When something goes wrong while decoding
      */
     public function parse($jwt)
     {
@@ -66,12 +67,11 @@ class Parser
             }
         }
 
-        return new Token(
-            new DataSet($header, $data[0]),
-            new DataSet($claims, $data[1]),
-            $signature,
-            ['', '']
-        );
+        if ($signature === null) {
+            unset($data[2]);
+        }
+
+        return new Token($header, $claims, $signature, $data);
     }
 
     /**
@@ -86,13 +86,13 @@ class Parser
     protected function splitJwt($jwt)
     {
         if (!is_string($jwt)) {
-            throw InvalidTokenStructure::missingOrNotEnoughSeparators();
+            throw new InvalidArgumentException('The JWT string must have two dots');
         }
 
         $data = explode('.', $jwt);
 
         if (count($data) != 3) {
-            throw InvalidTokenStructure::missingOrNotEnoughSeparators();
+            throw new InvalidArgumentException('The JWT string must have two dots');
         }
 
         return $data;
@@ -105,17 +105,17 @@ class Parser
      *
      * @return array
      *
-     * @throws UnsupportedHeaderFound When an invalid header is informed
+     * @throws InvalidArgumentException When an invalid header is informed
      */
     protected function parseHeader($data)
     {
         $header = (array) $this->decoder->jsonDecode($this->decoder->base64UrlDecode($data));
 
         if (isset($header['enc'])) {
-            throw UnsupportedHeaderFound::encryption();
+            throw new InvalidArgumentException('Encryption is not supported yet');
         }
 
-        return $this->convertItems($header);
+        return $header;
     }
 
     /**
@@ -129,29 +129,11 @@ class Parser
     {
         $claims = (array) $this->decoder->jsonDecode($this->decoder->base64UrlDecode($data));
 
-        return $this->convertItems($claims);
-    }
-
-    /**
-     * @param array<string, mixed> $items
-     *
-     * @return array<string, mixed>
-     */
-    private function convertItems(array $items)
-    {
-        foreach (RegisteredClaims::DATE_CLAIMS as $name) {
-            if (! array_key_exists($name, $items)) {
-                continue;
-            }
-
-            $items[$name] = new DateTimeImmutable('@' . ((int) $items[$name]));
-        }
-
-        if (array_key_exists(RegisteredClaims::AUDIENCE, $items) && ! is_array($items[RegisteredClaims::AUDIENCE])) {
-            $items[RegisteredClaims::AUDIENCE] = [$items[RegisteredClaims::AUDIENCE]];
+        foreach ($claims as $name => &$value) {
+            $value = $this->claimFactory->create($name, $value);
         }
 
-        return $items;
+        return $claims;
     }
 
     /**
@@ -165,11 +147,11 @@ class Parser
     protected function parseSignature(array $header, $data)
     {
         if ($data == '' || !isset($header['alg']) || $header['alg'] == 'none') {
-            return Signature::fromEmptyData();
+            return null;
         }
 
         $hash = $this->decoder->base64UrlDecode($data);
 
-        return new Signature($hash, $data);
+        return new Signature($hash);
     }
 }

+ 4 - 18
api/vendor/lcobucci/jwt/src/Parsing/Decoder.php

@@ -7,14 +7,8 @@
 
 namespace Lcobucci\JWT\Parsing;
 
-use JsonException;
-use Lcobucci\JWT\Encoding\CannotDecodeContent;
 use RuntimeException;
 
-use function json_decode;
-use function json_last_error;
-use function json_last_error_msg;
-
 /**
  * Class that decodes data according with the specs of RFC-4648
  *
@@ -36,21 +30,13 @@ class Decoder
      */
     public function jsonDecode($json)
     {
-        if (PHP_VERSION_ID < 70300) {
-            $data = json_decode($json);
-
-            if (json_last_error() != JSON_ERROR_NONE) {
-                throw CannotDecodeContent::jsonIssues(new JsonException(json_last_error_msg()));
-            }
+        $data = json_decode($json);
 
-            return $data;
+        if (json_last_error() != JSON_ERROR_NONE) {
+            throw new RuntimeException('Error while decoding to JSON: ' . json_last_error_msg());
         }
 
-        try {
-            return json_decode($json, false, 512, JSON_THROW_ON_ERROR);
-        } catch (JsonException $exception) {
-            throw CannotDecodeContent::jsonIssues($exception);
-        }
+        return $data;
     }
 
     /**

+ 4 - 18
api/vendor/lcobucci/jwt/src/Parsing/Encoder.php

@@ -7,14 +7,8 @@
 
 namespace Lcobucci\JWT\Parsing;
 
-use JsonException;
-use Lcobucci\JWT\Encoding\CannotEncodeContent;
 use RuntimeException;
 
-use function json_encode;
-use function json_last_error;
-use function json_last_error_msg;
-
 /**
  * Class that encodes data according with the specs of RFC-4648
  *
@@ -35,21 +29,13 @@ class Encoder
      */
     public function jsonEncode($data)
     {
-        if (PHP_VERSION_ID < 70300) {
-            $json = json_encode($data);
-
-            if (json_last_error() != JSON_ERROR_NONE) {
-                throw CannotEncodeContent::jsonIssues(new JsonException(json_last_error_msg()));
-            }
+        $json = json_encode($data);
 
-            return $json;
+        if (json_last_error() != JSON_ERROR_NONE) {
+            throw new RuntimeException('Error while encoding to JSON: ' . json_last_error_msg());
         }
 
-        try {
-            return json_encode($data, JSON_THROW_ON_ERROR);
-        } catch (JsonException $exception) {
-            throw CannotEncodeContent::jsonIssues($exception);
-        }
+        return $json;
     }
 
     /**

+ 3 - 31
api/vendor/lcobucci/jwt/src/Signature.php

@@ -7,8 +7,6 @@
 
 namespace Lcobucci\JWT;
 
-use Lcobucci\JWT\Signer\Key;
-
 /**
  * This class represents a token signature
  *
@@ -24,25 +22,14 @@ class Signature
      */
     protected $hash;
 
-    /** @var string */
-    private $encoded;
-
     /**
      * Initializes the object
      *
      * @param string $hash
-     * @param string $encoded
      */
-    public function __construct($hash, $encoded = '')
+    public function __construct($hash)
     {
-        $this->hash    = $hash;
-        $this->encoded = $encoded;
-    }
-
-    /** @return self */
-    public static function fromEmptyData()
-    {
-        return new self('', '');
+        $this->hash = $hash;
     }
 
     /**
@@ -51,7 +38,7 @@ class Signature
      *
      * @param Signer $signer
      * @param string $payload
-     * @param Key|string $key
+     * @param string $key
      *
      * @return boolean
      */
@@ -63,25 +50,10 @@ class Signature
     /**
      * Returns the current hash as a string representation of the signature
      *
-     * @deprecated This method has been removed from the public API in v4
-     * @see Signature::hash()
-     *
      * @return string
      */
     public function __toString()
     {
         return $this->hash;
     }
-
-    /** @return string */
-    public function hash()
-    {
-        return $this->hash;
-    }
-
-    /** @return string */
-    public function toString()
-    {
-        return $this->encoded;
-    }
 }

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

@@ -9,8 +9,6 @@ namespace Lcobucci\JWT\Signer;
 
 use Lcobucci\JWT\Signature;
 use Lcobucci\JWT\Signer;
-use function trigger_error;
-use const E_USER_DEPRECATED;
 
 /**
  * Base class for signers
@@ -54,8 +52,6 @@ abstract class BaseSigner implements Signer
     private function getKey($key)
     {
         if (is_string($key)) {
-            trigger_error('Implicit conversion of keys from strings is deprecated. Please use InMemory or LocalFileReference classes.', E_USER_DEPRECATED);
-
             $key = new Key($key);
         }
 

+ 0 - 19
api/vendor/lcobucci/jwt/src/Signer/CannotSignPayload.php

@@ -1,19 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Signer;
-
-use InvalidArgumentException;
-use Lcobucci\JWT\Exception;
-
-final class CannotSignPayload extends InvalidArgumentException implements Exception
-{
-    /**
-     * @pararm string $error
-     *
-     * @return self
-     */
-    public static function errorHappened($error)
-    {
-        return new self('There was an error while creating the signature: ' . $error);
-    }
-}

+ 0 - 27
api/vendor/lcobucci/jwt/src/Signer/Ecdsa/ConversionFailed.php

@@ -1,27 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Signer\Ecdsa;
-
-use InvalidArgumentException;
-use Lcobucci\JWT\Exception;
-
-final class ConversionFailed extends InvalidArgumentException implements Exception
-{
-    /** @return self */
-    public static function invalidLength()
-    {
-        return new self('Invalid signature length.');
-    }
-
-    /** @return self */
-    public static function incorrectStartSequence()
-    {
-        return new self('Invalid data. Should start with a sequence.');
-    }
-
-    /** @return self */
-    public static function integerExpected()
-    {
-        return new self('Invalid data. Should contain an integer.');
-    }
-}

+ 4 - 3
api/vendor/lcobucci/jwt/src/Signer/Ecdsa/MultibyteStringConverter.php

@@ -11,6 +11,7 @@
  */
 namespace Lcobucci\JWT\Signer\Ecdsa;
 
+use InvalidArgumentException;
 use function bin2hex;
 use function dechex;
 use function hex2bin;
@@ -40,7 +41,7 @@ final class MultibyteStringConverter implements SignatureConverter
         $signature = bin2hex($signature);
 
         if (self::octetLength($signature) !== $length) {
-            throw ConversionFailed::invalidLength();
+            throw new InvalidArgumentException('Invalid signature length.');
         }
 
         $pointR = self::preparePositiveInteger(mb_substr($signature, 0, $length, '8bit'));
@@ -87,7 +88,7 @@ final class MultibyteStringConverter implements SignatureConverter
         $position = 0;
 
         if (self::readAsn1Content($message, $position, self::BYTE_SIZE) !== self::ASN1_SEQUENCE) {
-            throw ConversionFailed::incorrectStartSequence();
+            throw new InvalidArgumentException('Invalid data. Should start with a sequence.');
         }
 
         if (self::readAsn1Content($message, $position, self::BYTE_SIZE) === self::ASN1_LENGTH_2BYTES) {
@@ -113,7 +114,7 @@ final class MultibyteStringConverter implements SignatureConverter
     private static function readAsn1Integer($message, &$position)
     {
         if (self::readAsn1Content($message, $position, self::BYTE_SIZE) !== self::ASN1_INTEGER) {
-            throw ConversionFailed::integerExpected();
+            throw new InvalidArgumentException('Invalid data. Should contain an integer.');
         }
 
         $length = (int) hexdec(self::readAsn1Content($message, $position, self::BYTE_SIZE));

+ 30 - 1
api/vendor/lcobucci/jwt/src/Signer/Hmac.php

@@ -32,7 +32,36 @@ abstract class Hmac extends BaseSigner
             return false;
         }
 
-        return hash_equals($expected, $this->createHash($payload, $key));
+        $callback = function_exists('hash_equals') ? 'hash_equals' : [$this, 'hashEquals'];
+
+        return call_user_func($callback, $expected, $this->createHash($payload, $key));
+    }
+
+    /**
+     * PHP < 5.6 timing attack safe hash comparison
+     *
+     * @internal
+     *
+     * @param string $expected
+     * @param string $generated
+     *
+     * @return boolean
+     */
+    public function hashEquals($expected, $generated)
+    {
+        $expectedLength = strlen($expected);
+
+        if ($expectedLength !== strlen($generated)) {
+            return false;
+        }
+
+        $res = 0;
+
+        for ($i = 0; $i < $expectedLength; ++$i) {
+            $res |= ord($expected[$i]) ^ ord($generated[$i]);
+        }
+
+        return $res === 0;
     }
 
     /**

+ 0 - 25
api/vendor/lcobucci/jwt/src/Signer/InvalidKeyProvided.php

@@ -1,25 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Signer;
-
-use InvalidArgumentException;
-use Lcobucci\JWT\Exception;
-
-final class InvalidKeyProvided extends InvalidArgumentException implements Exception
-{
-    /**
-     * @param string $details
-     *
-     * @return self
-     */
-    public static function cannotBeParsed($details)
-    {
-        return new self('It was not possible to parse your key, reason: ' . $details);
-    }
-
-    /** @return self */
-    public static function incompatibleKey()
-    {
-        return new self('This key is not compatible with this signer');
-    }
-}

+ 11 - 36
api/vendor/lcobucci/jwt/src/Signer/Key.php

@@ -9,22 +9,18 @@ namespace Lcobucci\JWT\Signer;
 
 use Exception;
 use InvalidArgumentException;
-use Lcobucci\JWT\Signer\Key\FileCouldNotBeRead;
 use SplFileObject;
 
-use function strpos;
-use function substr;
-
 /**
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 3.0.4
  */
-class Key
+final class Key
 {
     /**
      * @var string
      */
-    protected $content;
+    private $content;
 
     /**
      * @var string
@@ -35,7 +31,7 @@ class Key
      * @param string $content
      * @param string $passphrase
      */
-    public function __construct($content, $passphrase = '')
+    public function __construct($content, $passphrase = null)
     {
         $this->setContent($content);
         $this->passphrase = $passphrase;
@@ -64,39 +60,21 @@ class Key
      */
     private function readFile($content)
     {
-        $path = substr($content, 7);
-
         try {
-            $file = new SplFileObject($path);
-        } catch (Exception $exception) {
-            throw FileCouldNotBeRead::onPath($path, $exception);
-        }
+            $file    = new SplFileObject(substr($content, 7));
+            $content = '';
 
-        $content = '';
+            while (! $file->eof()) {
+                $content .= $file->fgets();
+            }
 
-        while (! $file->eof()) {
-            $content .= $file->fgets();
+            return $content;
+        } catch (Exception $exception) {
+            throw new InvalidArgumentException('You must provide a valid key file', 0, $exception);
         }
-
-        return $content;
-    }
-
-    /** @return string */
-    public function contents()
-    {
-        return $this->content;
-    }
-
-    /** @return string */
-    public function passphrase()
-    {
-        return $this->passphrase;
     }
 
     /**
-     * @deprecated This method is no longer part of the public interface
-     * @see Key::contents()
-     *
      * @return string
      */
     public function getContent()
@@ -105,9 +83,6 @@ class Key
     }
 
     /**
-     * @deprecated This method is no longer part of the public interface
-     * @see Key::passphrase()
-     *
      * @return string
      */
     public function getPassphrase()

+ 0 - 39
api/vendor/lcobucci/jwt/src/Signer/Key/FileCouldNotBeRead.php

@@ -1,39 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Signer\Key;
-
-use Lcobucci\JWT\Exception;
-use InvalidArgumentException;
-
-if (PHP_MAJOR_VERSION === 7) {
-    final class FileCouldNotBeRead extends InvalidArgumentException implements Exception
-    {
-        /** @return self */
-        public static function onPath(string $path, \Throwable $cause = null)
-        {
-            return new self(
-                'The path "' . $path . '" does not contain a valid key file',
-                0,
-                $cause
-            );
-        }
-    }
-} else {
-    final class FileCouldNotBeRead extends InvalidArgumentException implements Exception
-    {
-        /**
-         * @param string $path
-         * @param \Exception|null $cause
-         *
-         * @return self
-         */
-        public static function onPath($path, \Exception $cause = null)
-        {
-            return new self(
-                'The path "' . $path . '" does not contain a valid key file',
-                0,
-                $cause
-            );
-        }
-    }
-}

+ 0 - 52
api/vendor/lcobucci/jwt/src/Signer/Key/InMemory.php

@@ -1,52 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Signer\Key;
-
-use Lcobucci\JWT\Encoding\CannotDecodeContent;
-use Lcobucci\JWT\Signer\Key;
-
-use function base64_decode;
-
-final class InMemory extends Key
-{
-    /**
-     * @param string $contents
-     * @param string $passphrase
-     *
-     * @return self
-     */
-    public static function plainText($contents, $passphrase = '')
-    {
-        return new self($contents, $passphrase);
-    }
-
-    /**
-     * @param string $contents
-     * @param string $passphrase
-     *
-     * @return self
-     */
-    public static function base64Encoded($contents, $passphrase = '')
-    {
-        $decoded = base64_decode($contents, true);
-
-        if ($decoded === false) {
-            throw CannotDecodeContent::invalidBase64String();
-        }
-
-        return new self($decoded, $passphrase);
-    }
-
-    /**
-     * @param string $path
-     * @param string $passphrase
-     *
-     * @return InMemory
-     *
-     * @throws FileCouldNotBeRead
-     */
-    public static function file($path, $passphrase = '')
-    {
-        return new self('file://' . $path, $passphrase);
-    }
-}

+ 0 - 38
api/vendor/lcobucci/jwt/src/Signer/Key/LocalFileReference.php

@@ -1,38 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Signer\Key;
-
-use Lcobucci\JWT\Signer\Key;
-
-use function file_exists;
-use function strpos;
-use function substr;
-
-final class LocalFileReference extends Key
-{
-    const PATH_PREFIX = 'file://';
-
-    /**
-     * @param string $path
-     * @param string $passphrase
-     *
-     * @return self
-     *
-     * @throws FileCouldNotBeRead
-     */
-    public static function file($path, $passphrase = '')
-    {
-        if (strpos($path, self::PATH_PREFIX) === 0) {
-            $path = substr($path, 7);
-        }
-
-        if (! file_exists($path)) {
-            throw FileCouldNotBeRead::onPath($path);
-        }
-
-        $key = new self('', $passphrase);
-        $key->content = self::PATH_PREFIX . $path;
-
-        return $key;
-    }
-}

+ 0 - 21
api/vendor/lcobucci/jwt/src/Signer/None.php

@@ -1,21 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Signer;
-
-final class None extends BaseSigner
-{
-    public function getAlgorithmId()
-    {
-        return 'none';
-    }
-
-    public function createHash($payload, Key $key)
-    {
-        return '';
-    }
-
-    public function doVerify($expected, $payload, Key $key)
-    {
-        return $expected === '';
-    }
-}

+ 11 - 4
api/vendor/lcobucci/jwt/src/Signer/OpenSSL.php

@@ -2,6 +2,9 @@
 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;
@@ -21,7 +24,9 @@ abstract class OpenSSL extends BaseSigner
             $signature = '';
 
             if (! openssl_sign($payload, $signature, $privateKey, $this->getAlgorithm())) {
-                throw CannotSignPayload::errorHappened(openssl_error_string());
+                throw new InvalidArgumentException(
+                    'There was an error while creating the signature: ' . openssl_error_string()
+                );
             }
 
             return $signature;
@@ -47,7 +52,7 @@ abstract class OpenSSL extends BaseSigner
     /**
      * @param $expected
      * @param $payload
-     * @param $key
+     * @param $pem
      * @return bool
      */
     public function doVerify($expected, $payload, Key $key)
@@ -82,13 +87,15 @@ abstract class OpenSSL extends BaseSigner
     private function validateKey($key)
     {
         if (! is_resource($key)) {
-            throw InvalidKeyProvided::cannotBeParsed(openssl_error_string());
+            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 InvalidKeyProvided::incompatibleKey();
+            throw new InvalidArgumentException('This key is not compatible with this signer');
         }
     }
 

+ 72 - 218
api/vendor/lcobucci/jwt/src/Token.php

@@ -7,22 +7,12 @@
 
 namespace Lcobucci\JWT;
 
-use DateTimeImmutable;
+use BadMethodCallException;
+use DateTime;
 use DateTimeInterface;
 use Generator;
-use Lcobucci\JWT\Claim\Factory;
 use Lcobucci\JWT\Claim\Validatable;
-use Lcobucci\JWT\Signer\Key;
-use Lcobucci\JWT\Token\DataSet;
-use Lcobucci\JWT\Token\RegisteredClaims;
 use OutOfBoundsException;
-use function current;
-use function func_num_args;
-use function in_array;
-use function is_array;
-use function sprintf;
-use function trigger_error;
-use const E_USER_DEPRECATED;
 
 /**
  * Basic structure of the JWT
@@ -35,14 +25,14 @@ class Token
     /**
      * The token headers
      *
-     * @var DataSet
+     * @var array
      */
     private $headers;
 
     /**
      * The token claim set
      *
-     * @var DataSet
+     * @var array
      */
     private $claims;
 
@@ -54,100 +44,57 @@ class Token
     private $signature;
 
     /**
-     * @internal This serves just as compatibility layer
+     * The encoded data
      *
-     * @var Factory
+     * @var array
      */
-    private $claimFactory;
+    private $payload;
 
     /**
      * Initializes the object
      *
-     * @param array|DataSet $headers
-     * @param array|DataSet $claims
-     * @param Signature|null $signature
+     * @param array $headers
+     * @param array $claims
      * @param array $payload
-     * @param Factory|null $claimFactory
+     * @param Signature $signature
      */
     public function __construct(
-        $headers = ['alg' => 'none'],
-        $claims = [],
+        array $headers = ['alg' => 'none'],
+        array $claims = [],
         Signature $signature = null,
-        array $payload = ['', ''],
-        Factory $claimFactory = null
+        array $payload = ['', '']
     ) {
-        $this->headers = $this->convertToDataSet($headers, $payload[0]);
-        $this->claims = $this->convertToDataSet($claims, $payload[1]);
-        $this->signature = $signature ?: Signature::fromEmptyData();
-        $this->claimFactory = $claimFactory ?: new Factory();
-    }
-
-    /**
-     * @param array|DataSet $data
-     * @param string $payload
-     */
-    private function convertToDataSet($data, $payload)
-    {
-        if ($data instanceof DataSet) {
-            return $data;
-        }
-
-        return new DataSet($data, $payload);
-    }
-
-    /** @return DataSet */
-    public function headers()
-    {
-        return $this->headers;
+        $this->headers = $headers;
+        $this->claims = $claims;
+        $this->signature = $signature;
+        $this->payload = $payload;
     }
 
     /**
      * Returns the token headers
      *
-     * @deprecated This method has been removed from the interface in v4.0
-     * @see Token::headers()
-     *
      * @return array
      */
     public function getHeaders()
     {
-        $items = [];
-
-        foreach ($this->headers->all() as $name => $value) {
-            if (! in_array($name, RegisteredClaims::ALL, true) || ! $this->claims->has($name)) {
-                $items[$name] = $value;
-                continue;
-            }
-
-            $items[$name] = $this->claimFactory->create($name, $value);
-        }
-
-        return $items;
+        return $this->headers;
     }
 
     /**
      * Returns if the header is configured
      *
-     * @deprecated This method has been removed from the interface in v4.0
-     * @see Token::headers()
-     * @see DataSet::has()
-     *
      * @param string $name
      *
      * @return boolean
      */
     public function hasHeader($name)
     {
-        return $this->headers->has($name);
+        return array_key_exists($name, $this->headers);
     }
 
     /**
      * Returns the value of a token header
      *
-     * @deprecated This method has been removed from the interface in v4.0
-     * @see Token::headers()
-     * @see DataSet::has()
-     *
      * @param string $name
      * @param mixed $default
      *
@@ -157,61 +104,60 @@ class Token
      */
     public function getHeader($name, $default = null)
     {
-        if (func_num_args() === 1 && ! $this->headers->has($name)) {
-            throw new OutOfBoundsException(sprintf('Requested header "%s" is not configured', $name));
+        if ($this->hasHeader($name)) {
+            return $this->getHeaderValue($name);
+        }
+
+        if ($default === null) {
+            throw new OutOfBoundsException('Requested header is not configured');
         }
 
-        return $this->headers->get($name, $default);
+        return $default;
     }
 
-    /** @return DataSet */
-    public function claims()
+    /**
+     * Returns the value stored in header
+     *
+     * @param string $name
+     *
+     * @return mixed
+     */
+    private function getHeaderValue($name)
     {
-        return $this->claims;
+        $header = $this->headers[$name];
+
+        if ($header instanceof Claim) {
+            return $header->getValue();
+        }
+
+        return $header;
     }
 
     /**
      * Returns the token claim set
      *
-     * @deprecated This method has been removed from the interface in v4.0
-     * @see Token::claims()
-     *
      * @return array
      */
     public function getClaims()
     {
-        $items = [];
-
-        foreach ($this->claims->all() as $name => $value) {
-            $items[$name] = $this->claimFactory->create($name, $value);
-        }
-
-        return $items;
+        return $this->claims;
     }
 
     /**
      * Returns if the claim is configured
      *
-     * @deprecated This method has been removed from the interface in v4.0
-     * @see Token::claims()
-     * @see DataSet::has()
-     *
      * @param string $name
      *
      * @return boolean
      */
     public function hasClaim($name)
     {
-        return $this->claims->has($name);
+        return array_key_exists($name, $this->claims);
     }
 
     /**
      * Returns the value of a token claim
      *
-     * @deprecated This method has been removed from the interface in v4.0
-     * @see Token::claims()
-     * @see DataSet::get()
-     *
      * @param string $name
      * @param mixed $default
      *
@@ -221,40 +167,34 @@ class Token
      */
     public function getClaim($name, $default = null)
     {
-        if (func_num_args() === 1 && ! $this->claims->has($name)) {
-            throw new OutOfBoundsException(sprintf('Requested header "%s" is not configured', $name));
+        if ($this->hasClaim($name)) {
+            return $this->claims[$name]->getValue();
         }
 
-        $value = $this->claims->get($name, $default);
-
-        if ($value instanceof DateTimeImmutable && in_array($name, RegisteredClaims::DATE_CLAIMS, true)) {
-            return $value->getTimestamp();
+        if ($default === null) {
+            throw new OutOfBoundsException('Requested claim is not configured');
         }
 
-        if ($name === RegisteredClaims::AUDIENCE && is_array($value)) {
-            if (count($value) > 1) {
-                trigger_error('You will only get the first array entry as a string. Use Token::claims()->get() instead.', E_USER_DEPRECATED);
-            }
-            return current($value);
-        }
-
-        return $value;
+        return $default;
     }
 
     /**
      * Verify if the key matches with the one that created the signature
      *
-     * @deprecated This method has been removed from the interface in v4.0
-     * @see \Lcobucci\JWT\Validation\Validator
-     *
      * @param Signer $signer
-     * @param Key|string $key
+     * @param string $key
      *
      * @return boolean
+     *
+     * @throws BadMethodCallException When token is not signed
      */
     public function verify(Signer $signer, $key)
     {
-        if ($this->headers->get('alg') !== $signer->getAlgorithmId()) {
+        if ($this->signature === null) {
+            throw new BadMethodCallException('This token is not signed');
+        }
+
+        if ($this->headers['alg'] !== $signer->getAlgorithmId()) {
             return false;
         }
 
@@ -264,9 +204,6 @@ class Token
     /**
      * Validates if the token is valid
      *
-     * @deprecated This method has been removed from the interface in v4.0
-     * @see \Lcobucci\JWT\Validation\Validator
-     *
      * @param ValidationData $data
      *
      * @return boolean
@@ -285,83 +222,24 @@ class Token
     /**
      * Determine if the token is expired.
      *
-     * @param DateTimeInterface|null $now Defaults to the current time.
+     * @param DateTimeInterface $now Defaults to the current time.
      *
      * @return bool
      */
     public function isExpired(DateTimeInterface $now = null)
     {
-        if (! $this->claims->has('exp')) {
+        $exp = $this->getClaim('exp', false);
+
+        if ($exp === false) {
             return false;
         }
 
-        if ($now === null) {
-            trigger_error('Not providing the current time is deprecated. Please pass an instance of DateTimeInterface.', E_USER_DEPRECATED);
-        }
+        $now = $now ?: new DateTime();
 
-        $now = $now ?: new DateTimeImmutable();
+        $expiresAt = new DateTime();
+        $expiresAt->setTimestamp($exp);
 
-        return $now >= $this->claims->get(RegisteredClaims::EXPIRATION_TIME);
-    }
-
-    /**
-     * @param string $audience
-     *
-     * @return bool
-     */
-    public function isPermittedFor($audience)
-    {
-        return in_array($audience, $this->claims->get(RegisteredClaims::AUDIENCE, []), true);
-    }
-
-    /**
-     * @param string $id
-     *
-     * @return bool
-     */
-    public function isIdentifiedBy($id)
-    {
-        return $this->claims->get(RegisteredClaims::ID) === $id;
-    }
-
-    /**
-     * @param string $subject
-     *
-     * @return bool
-     */
-    public function isRelatedTo($subject)
-    {
-        return $this->claims->get(RegisteredClaims::SUBJECT) === $subject;
-    }
-
-    /**
-     * @param list<string> $issuers
-     *
-     * @return bool
-     */
-    public function hasBeenIssuedBy(...$issuers)
-    {
-        return in_array($this->claims->get(RegisteredClaims::ISSUER), $issuers, true);
-    }
-
-    /**
-     * @param DateTimeInterface $now
-     *
-     * @return bool
-     */
-    public function hasBeenIssuedBefore(DateTimeInterface $now)
-    {
-        return $now >= $this->claims->get(RegisteredClaims::ISSUED_AT);
-    }
-
-    /**
-     * @param DateTimeInterface $now
-     *
-     * @return bool
-     */
-    public function isMinimumTimeBefore(DateTimeInterface $now)
-    {
-        return $now >= $this->claims->get(RegisteredClaims::NOT_BEFORE);
+        return $now > $expiresAt;
     }
 
     /**
@@ -371,7 +249,7 @@ class Token
      */
     private function getValidatableClaims()
     {
-        foreach ($this->getClaims() as $claim) {
+        foreach ($this->claims as $claim) {
             if ($claim instanceof Validatable) {
                 yield $claim;
             }
@@ -381,50 +259,26 @@ class Token
     /**
      * Returns the token payload
      *
-     * @deprecated This method has been removed from the interface in v4.0
-     * @see Token::payload()
-     *
      * @return string
      */
     public function getPayload()
     {
-        return $this->payload();
-    }
-
-    /**
-     * Returns the token payload
-     *
-     * @return string
-     */
-    public function payload()
-    {
-        return $this->headers->toString() . '.' . $this->claims->toString();
-    }
-
-    /** @return Signature */
-    public function signature()
-    {
-        return $this->signature;
+        return $this->payload[0] . '.' . $this->payload[1];
     }
 
     /**
      * Returns an encoded representation of the token
      *
-     * @deprecated This method has been removed from the interface in v4.0
-     * @see Token::toString()
-     *
      * @return string
      */
     public function __toString()
     {
-        return $this->toString();
-    }
+        $data = implode('.', $this->payload);
 
-    /** @return string */
-    public function toString()
-    {
-        return $this->headers->toString() . '.'
-             . $this->claims->toString() . '.'
-             . $this->signature->toString();
+        if ($this->signature === null) {
+            $data .= '.';
+        }
+
+        return $data;
     }
 }

+ 0 - 56
api/vendor/lcobucci/jwt/src/Token/DataSet.php

@@ -1,56 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Token;
-
-use function array_key_exists;
-
-final class DataSet
-{
-    /** @var array<string, mixed> */
-    private $data;
-    /** @var string */
-    private $encoded;
-
-    /**
-     * @param array<string, mixed> $data
-     * @param string               $encoded
-     */
-    public function __construct(array $data, $encoded)
-    {
-        $this->data    = $data;
-        $this->encoded = $encoded;
-    }
-
-    /**
-     * @param string     $name
-     * @param mixed|null $default
-     *
-     * @return mixed|null
-     */
-    public function get($name, $default = null)
-    {
-        return $this->has($name) ? $this->data[$name] : $default;
-    }
-
-    /**
-     * @param string $name
-     *
-     * @return bool
-     */
-    public function has($name)
-    {
-        return array_key_exists($name, $this->data);
-    }
-
-    /** @return array<string, mixed> */
-    public function all()
-    {
-        return $this->data;
-    }
-
-    /** @return string */
-    public function toString()
-    {
-        return $this->encoded;
-    }
-}

+ 0 - 35
api/vendor/lcobucci/jwt/src/Token/InvalidTokenStructure.php

@@ -1,35 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Token;
-
-use InvalidArgumentException;
-use Lcobucci\JWT\Exception;
-
-final class InvalidTokenStructure extends InvalidArgumentException implements Exception
-{
-    /** @return self */
-    public static function missingOrNotEnoughSeparators()
-    {
-        return new self('The JWT string must have two dots');
-    }
-
-    /**
-     * @param string $part
-     *
-     * @return self
-     */
-    public static function arrayExpected($part)
-    {
-        return new self($part . ' must be an array');
-    }
-
-    /**
-     * @param string $value
-     *
-     * @return self
-     */
-    public static function dateIsNotParseable($value)
-    {
-        return new self('Value is not in the allowed date format: ' . $value);
-    }
-}

+ 0 - 8
api/vendor/lcobucci/jwt/src/Token/Plain.php

@@ -1,8 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Token;
-
-use Lcobucci\JWT\Token;
-use function class_alias;
-
-class_exists(Plain::class, false) || class_alias(Token::class, Plain::class);

+ 0 - 24
api/vendor/lcobucci/jwt/src/Token/RegisteredClaimGiven.php

@@ -1,24 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Token;
-
-use InvalidArgumentException;
-use Lcobucci\JWT\Exception;
-
-use function sprintf;
-
-final class RegisteredClaimGiven extends InvalidArgumentException implements Exception
-{
-    const DEFAULT_MESSAGE = 'Builder#withClaim() is meant to be used for non-registered claims, '
-                                  . 'check the documentation on how to set claim "%s"';
-
-    /**
-     * @param string $name
-     *
-     * @return self
-     */
-    public static function forClaim($name)
-    {
-        return new self(sprintf(self::DEFAULT_MESSAGE, $name));
-    }
-}

+ 0 - 76
api/vendor/lcobucci/jwt/src/Token/RegisteredClaims.php

@@ -1,76 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Token;
-
-/**
- * Defines the list of claims that are registered in the IANA "JSON Web Token Claims" registry
- *
- * @see https://tools.ietf.org/html/rfc7519#section-4.1
- */
-interface RegisteredClaims
-{
-    const ALL = [
-        self::AUDIENCE,
-        self::EXPIRATION_TIME,
-        self::ID,
-        self::ISSUED_AT,
-        self::ISSUER,
-        self::NOT_BEFORE,
-        self::SUBJECT,
-    ];
-
-    const DATE_CLAIMS = [
-        self::ISSUED_AT,
-        self::NOT_BEFORE,
-        self::EXPIRATION_TIME,
-    ];
-
-    /**
-     * Identifies the recipients that the JWT is intended for
-     *
-     * @see https://tools.ietf.org/html/rfc7519#section-4.1.3
-     */
-    const AUDIENCE = 'aud';
-
-    /**
-     * Identifies the expiration time on or after which the JWT MUST NOT be accepted for processing
-     *
-     * @see https://tools.ietf.org/html/rfc7519#section-4.1.4
-     */
-    const EXPIRATION_TIME = 'exp';
-
-    /**
-     * Provides a unique identifier for the JWT
-     *
-     * @see https://tools.ietf.org/html/rfc7519#section-4.1.7
-     */
-    const ID = 'jti';
-
-    /**
-     * Identifies the time at which the JWT was issued
-     *
-     * @see https://tools.ietf.org/html/rfc7519#section-4.1.6
-     */
-    const ISSUED_AT = 'iat';
-
-    /**
-     * Identifies the principal that issued the JWT
-     *
-     * @see https://tools.ietf.org/html/rfc7519#section-4.1.1
-     */
-    const ISSUER = 'iss';
-
-    /**
-     * Identifies the time before which the JWT MUST NOT be accepted for processing
-     *
-     * https://tools.ietf.org/html/rfc7519#section-4.1.5
-     */
-    const NOT_BEFORE = 'nbf';
-
-    /**
-     * Identifies the principal that is the subject of the JWT.
-     *
-     * https://tools.ietf.org/html/rfc7519#section-4.1.2
-     */
-    const SUBJECT = 'sub';
-}

+ 0 - 8
api/vendor/lcobucci/jwt/src/Token/Signature.php

@@ -1,8 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Token;
-
-use Lcobucci\JWT\Signature as SignatureImpl;
-use function class_alias;
-
-class_exists(Signature::class, false) || class_alias(SignatureImpl::class, Signature::class);

+ 0 - 15
api/vendor/lcobucci/jwt/src/Token/UnsupportedHeaderFound.php

@@ -1,15 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Token;
-
-use InvalidArgumentException;
-use Lcobucci\JWT\Exception;
-
-final class UnsupportedHeaderFound extends InvalidArgumentException implements Exception
-{
-    /** @return self */
-    public static function encryption()
-    {
-        return new self('Encryption is not supported yet');
-    }
-}

+ 0 - 11
api/vendor/lcobucci/jwt/src/Validation/Constraint.php

@@ -1,11 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Validation;
-
-use Lcobucci\JWT\Token;
-
-interface Constraint
-{
-    /** @throws ConstraintViolation */
-    public function assert(Token $token);
-}

+ 0 - 28
api/vendor/lcobucci/jwt/src/Validation/Constraint/IdentifiedBy.php

@@ -1,28 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Validation\Constraint;
-
-use Lcobucci\JWT\Token;
-use Lcobucci\JWT\Validation\Constraint;
-use Lcobucci\JWT\Validation\ConstraintViolation;
-
-final class IdentifiedBy implements Constraint
-{
-    /** @var string */
-    private $id;
-
-    /** @param string $id */
-    public function __construct($id)
-    {
-        $this->id = $id;
-    }
-
-    public function assert(Token $token)
-    {
-        if (! $token->isIdentifiedBy($this->id)) {
-            throw new ConstraintViolation(
-                'The token is not identified with the expected ID'
-            );
-        }
-    }
-}

+ 0 - 28
api/vendor/lcobucci/jwt/src/Validation/Constraint/IssuedBy.php

@@ -1,28 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Validation\Constraint;
-
-use Lcobucci\JWT\Token;
-use Lcobucci\JWT\Validation\Constraint;
-use Lcobucci\JWT\Validation\ConstraintViolation;
-
-final class IssuedBy implements Constraint
-{
-    /** @var string[] */
-    private $issuers;
-
-    /** @param list<string> $issuers */
-    public function __construct(...$issuers)
-    {
-        $this->issuers = $issuers;
-    }
-
-    public function assert(Token $token)
-    {
-        if (! $token->hasBeenIssuedBy(...$this->issuers)) {
-            throw new ConstraintViolation(
-                'The token was not issued by the given issuers'
-            );
-        }
-    }
-}

+ 0 - 15
api/vendor/lcobucci/jwt/src/Validation/Constraint/LeewayCannotBeNegative.php

@@ -1,15 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Validation\Constraint;
-
-use InvalidArgumentException;
-use Lcobucci\JWT\Exception;
-
-final class LeewayCannotBeNegative extends InvalidArgumentException implements Exception
-{
-    /** @return self */
-    public static function create()
-    {
-        return new self('Leeway cannot be negative');
-    }
-}

+ 0 - 27
api/vendor/lcobucci/jwt/src/Validation/Constraint/PermittedFor.php

@@ -1,27 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Validation\Constraint;
-
-use Lcobucci\JWT\Token;
-use Lcobucci\JWT\Validation\Constraint;
-use Lcobucci\JWT\Validation\ConstraintViolation;
-
-final class PermittedFor implements Constraint
-{
-    /** @var string  */
-    private $audience;
-
-    public function __construct($audience)
-    {
-        $this->audience = $audience;
-    }
-
-    public function assert(Token $token)
-    {
-        if (! $token->isPermittedFor($this->audience)) {
-            throw new ConstraintViolation(
-                'The token is not allowed to be used by this audience'
-            );
-        }
-    }
-}

+ 0 - 27
api/vendor/lcobucci/jwt/src/Validation/Constraint/RelatedTo.php

@@ -1,27 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Validation\Constraint;
-
-use Lcobucci\JWT\Token;
-use Lcobucci\JWT\Validation\Constraint;
-use Lcobucci\JWT\Validation\ConstraintViolation;
-
-final class RelatedTo implements Constraint
-{
-    /** @var string */
-    private $subject;
-
-    public function __construct($subject)
-    {
-        $this->subject = $subject;
-    }
-
-    public function assert(Token $token)
-    {
-        if (! $token->isRelatedTo($this->subject)) {
-            throw new ConstraintViolation(
-                'The token is not related to the expected subject'
-            );
-        }
-    }
-}

+ 0 - 34
api/vendor/lcobucci/jwt/src/Validation/Constraint/SignedWith.php

@@ -1,34 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Validation\Constraint;
-
-use Lcobucci\JWT\Signer;
-use Lcobucci\JWT\Token;
-use Lcobucci\JWT\Validation\Constraint;
-use Lcobucci\JWT\Validation\ConstraintViolation;
-
-final class SignedWith implements Constraint
-{
-    /** @var Signer */
-    private $signer;
-
-    /** @var Signer\Key */
-    private $key;
-
-    public function __construct(Signer $signer, Signer\Key $key)
-    {
-        $this->signer = $signer;
-        $this->key    = $key;
-    }
-
-    public function assert(Token $token)
-    {
-        if ($token->headers()->get('alg') !== $this->signer->getAlgorithmId()) {
-            throw new ConstraintViolation('Token signer mismatch');
-        }
-
-        if (! $this->signer->verify((string) $token->signature(), $token->getPayload(), $this->key)) {
-            throw new ConstraintViolation('Token signature mismatch');
-        }
-    }
-}

+ 0 - 72
api/vendor/lcobucci/jwt/src/Validation/Constraint/ValidAt.php

@@ -1,72 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Validation\Constraint;
-
-use DateInterval;
-use DateTimeInterface;
-use Lcobucci\Clock\Clock;
-use Lcobucci\JWT\Token;
-use Lcobucci\JWT\Validation\Constraint;
-use Lcobucci\JWT\Validation\ConstraintViolation;
-
-final class ValidAt implements Constraint
-{
-    /** @var Clock */
-    private $clock;
-
-    /** @var DateInterval */
-    private $leeway;
-
-    public function __construct(Clock $clock, DateInterval $leeway = null)
-    {
-        $this->clock  = $clock;
-        $this->leeway = $this->guardLeeway($leeway);
-    }
-
-    /** @return DateInterval */
-    private function guardLeeway(DateInterval $leeway = null)
-    {
-        if ($leeway === null) {
-            return new DateInterval('PT0S');
-        }
-
-        if ($leeway->invert === 1) {
-            throw LeewayCannotBeNegative::create();
-        }
-
-        return $leeway;
-    }
-
-    public function assert(Token $token)
-    {
-        $now = $this->clock->now();
-
-        $this->assertIssueTime($token, $now->add($this->leeway));
-        $this->assertMinimumTime($token, $now->add($this->leeway));
-        $this->assertExpiration($token, $now->sub($this->leeway));
-    }
-
-    /** @throws ConstraintViolation */
-    private function assertExpiration(Token $token, DateTimeInterface $now)
-    {
-        if ($token->isExpired($now)) {
-            throw new ConstraintViolation('The token is expired');
-        }
-    }
-
-    /** @throws ConstraintViolation */
-    private function assertMinimumTime(Token $token, DateTimeInterface $now)
-    {
-        if (! $token->isMinimumTimeBefore($now)) {
-            throw new ConstraintViolation('The token cannot be used yet');
-        }
-    }
-
-    /** @throws ConstraintViolation */
-    private function assertIssueTime(Token $token, DateTimeInterface $now)
-    {
-        if (! $token->hasBeenIssuedBefore($now)) {
-            throw new ConstraintViolation('The token was issued in the future');
-        }
-    }
-}

+ 0 - 10
api/vendor/lcobucci/jwt/src/Validation/ConstraintViolation.php

@@ -1,10 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Validation;
-
-use Lcobucci\JWT\Exception;
-use RuntimeException;
-
-final class ConstraintViolation extends RuntimeException implements Exception
-{
-}

+ 0 - 10
api/vendor/lcobucci/jwt/src/Validation/NoConstraintsGiven.php

@@ -1,10 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Validation;
-
-use Lcobucci\JWT\Exception;
-use RuntimeException;
-
-final class NoConstraintsGiven extends RuntimeException implements Exception
-{
-}

+ 0 - 53
api/vendor/lcobucci/jwt/src/Validation/RequiredConstraintsViolated.php

@@ -1,53 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Validation;
-
-use Lcobucci\JWT\Exception;
-use RuntimeException;
-
-use function array_map;
-use function implode;
-
-final class RequiredConstraintsViolated extends RuntimeException implements Exception
-{
-    /** @var ConstraintViolation[] */
-    private $violations = [];
-
-    /**
-     * @param ConstraintViolation ...$violations
-     * @return self
-     */
-    public static function fromViolations(ConstraintViolation ...$violations)
-    {
-        $exception             = new self(self::buildMessage($violations));
-        $exception->violations = $violations;
-
-        return $exception;
-    }
-
-    /**
-     * @param ConstraintViolation[] $violations
-     *
-     * @return string
-     */
-    private static function buildMessage(array $violations)
-    {
-        $violations = array_map(
-            static function (ConstraintViolation $violation) {
-                return '- ' . $violation->getMessage();
-            },
-            $violations
-        );
-
-        $message  = "The token violates some mandatory constraints, details:\n";
-        $message .= implode("\n", $violations);
-
-        return $message;
-    }
-
-    /** @return ConstraintViolation[] */
-    public function violations()
-    {
-        return $this->violations;
-    }
-}

+ 0 - 55
api/vendor/lcobucci/jwt/src/Validation/Validator.php

@@ -1,55 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT\Validation;
-
-use Lcobucci\JWT\Token;
-
-final class Validator implements \Lcobucci\JWT\Validator
-{
-    public function assert(Token $token, Constraint ...$constraints)
-    {
-        if ($constraints === []) {
-            throw new NoConstraintsGiven('No constraint given.');
-        }
-
-        $violations = [];
-
-        foreach ($constraints as $constraint) {
-            $this->checkConstraint($constraint, $token, $violations);
-        }
-
-        if ($violations) {
-            throw RequiredConstraintsViolated::fromViolations(...$violations);
-        }
-    }
-
-    /** @param ConstraintViolation[] $violations */
-    private function checkConstraint(
-        Constraint $constraint,
-        Token $token,
-        array &$violations
-    ) {
-        try {
-            $constraint->assert($token);
-        } catch (ConstraintViolation $e) {
-            $violations[] = $e;
-        }
-    }
-
-    public function validate(Token $token, Constraint ...$constraints)
-    {
-        if ($constraints === []) {
-            throw new NoConstraintsGiven('No constraint given.');
-        }
-
-        try {
-            foreach ($constraints as $constraint) {
-                $constraint->assert($token);
-            }
-
-            return true;
-        } catch (ConstraintViolation $e) {
-            return false;
-        }
-    }
-}

+ 0 - 3
api/vendor/lcobucci/jwt/src/ValidationData.php

@@ -10,9 +10,6 @@ namespace Lcobucci\JWT;
 /**
  * Class that wraps validation values
  *
- * @deprecated This component has been removed from the interface in v4.0
- * @see \Lcobucci\JWT\Validation\Validator
- *
  * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  * @since 2.0.0
  */

+ 0 - 23
api/vendor/lcobucci/jwt/src/Validator.php

@@ -1,23 +0,0 @@
-<?php
-
-namespace Lcobucci\JWT;
-
-use Lcobucci\JWT\Validation\Constraint;
-use Lcobucci\JWT\Validation\NoConstraintsGiven;
-use Lcobucci\JWT\Validation\RequiredConstraintsViolated;
-
-interface Validator
-{
-    /**
-     * @throws RequiredConstraintsViolated
-     * @throws NoConstraintsGiven
-     */
-    public function assert(Token $token, Constraint ...$constraints);
-
-    /**
-     * @return bool
-     *
-     * @throws NoConstraintsGiven
-     */
-    public function validate(Token $token, Constraint ...$constraints);
-}

+ 328 - 0
api/vendor/lcobucci/jwt/test/functional/EcdsaTokenTest.php

@@ -0,0 +1,328 @@
+<?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\FunctionalTests;
+
+use Lcobucci\JWT\Builder;
+use Lcobucci\JWT\Parser;
+use Lcobucci\JWT\Signer\Key;
+use Lcobucci\JWT\Token;
+use Lcobucci\JWT\Signature;
+use Lcobucci\JWT\Signer\Ecdsa\Sha256;
+use Lcobucci\JWT\Signer\Ecdsa\Sha512;
+use Lcobucci\JWT\Signer\Keychain;
+use Lcobucci\JWT\Keys;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.1.0
+ */
+class EcdsaTokenTest extends \PHPUnit\Framework\TestCase
+{
+    use Keys;
+
+    /**
+     * @var Sha256
+     */
+    private $signer;
+
+    /**
+     * @before
+     */
+    public function createSigner()
+    {
+        $this->signer = new Sha256();
+    }
+
+    /**
+     * @test
+     *
+     * @expectedException \InvalidArgumentException
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @covers Lcobucci\JWT\Signer\Ecdsa
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
+     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     */
+    public function builderShouldRaiseExceptionWhenKeyIsInvalid()
+    {
+        $user = (object) ['name' => 'testing', 'email' => 'testing@abc.com'];
+
+        (new Builder())->setId(1)
+                       ->setAudience('http://client.abc.com')
+                       ->setIssuer('http://api.abc.com')
+                       ->set('user', $user)
+                       ->getToken($this->signer, new Key('testing'));
+    }
+
+    /**
+     * @test
+     *
+     * @expectedException \InvalidArgumentException
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @covers Lcobucci\JWT\Signer\Ecdsa
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
+     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     */
+    public function builderShouldRaiseExceptionWhenKeyIsNotEcdsaCompatible()
+    {
+        $user = (object) ['name' => 'testing', 'email' => 'testing@abc.com'];
+
+        (new Builder())->setId(1)
+                       ->setAudience('http://client.abc.com')
+                       ->setIssuer('http://api.abc.com')
+                       ->set('user', $user)
+                       ->getToken($this->signer, static::$rsaKeys['private']);
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @covers Lcobucci\JWT\Signer\Ecdsa
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
+     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     */
+    public function builderCanGenerateAToken()
+    {
+        $user = (object) ['name' => 'testing', 'email' => 'testing@abc.com'];
+
+        $token = (new Builder())->setId(1)
+                              ->setAudience('http://client.abc.com')
+                              ->setIssuer('http://api.abc.com')
+                              ->set('user', $user)
+                              ->setHeader('jki', '1234')
+                              ->sign($this->signer, static::$ecdsaKeys['private'])
+                              ->getToken();
+
+        $this->assertAttributeInstanceOf(Signature::class, 'signature', $token);
+        $this->assertEquals('1234', $token->getHeader('jki'));
+        $this->assertEquals('http://client.abc.com', $token->getClaim('aud'));
+        $this->assertEquals('http://api.abc.com', $token->getClaim('iss'));
+        $this->assertEquals($user, $token->getClaim('user'));
+
+        return $token;
+    }
+
+    /**
+     * @test
+     *
+     * @depends builderCanGenerateAToken
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Parser
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Parsing\Decoder
+     * @covers Lcobucci\JWT\Signer\Ecdsa
+     */
+    public function parserCanReadAToken(Token $generated)
+    {
+        $read = (new Parser())->parse((string) $generated);
+
+        $this->assertEquals($generated, $read);
+        $this->assertEquals('testing', $read->getClaim('user')->name);
+    }
+
+    /**
+     * @test
+     *
+     * @depends builderCanGenerateAToken
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Parser
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @covers Lcobucci\JWT\Signer\Ecdsa
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
+     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     */
+    public function verifyShouldReturnFalseWhenKeyIsNotRight(Token $token)
+    {
+        $this->assertFalse($token->verify($this->signer, static::$ecdsaKeys['public2']));
+    }
+
+    /**
+     * @test
+     *
+     * @depends builderCanGenerateAToken
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Parser
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @covers Lcobucci\JWT\Signer\Ecdsa
+     * @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)
+    {
+        $this->assertFalse($token->verify(new Sha512(), static::$ecdsaKeys['public1']));
+    }
+
+    /**
+     * @test
+     *
+     * @expectedException \InvalidArgumentException
+     *
+     * @depends builderCanGenerateAToken
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Parser
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @covers Lcobucci\JWT\Signer\Ecdsa
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
+     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     */
+    public function verifyShouldRaiseExceptionWhenKeyIsNotEcdsaCompatible(Token $token)
+    {
+        $this->assertFalse($token->verify($this->signer, static::$rsaKeys['public']));
+    }
+
+    /**
+     * @test
+     *
+     * @depends builderCanGenerateAToken
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Parser
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @covers Lcobucci\JWT\Signer\Ecdsa
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
+     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     */
+    public function verifyShouldReturnTrueWhenKeyIsRight(Token $token)
+    {
+        $this->assertTrue($token->verify($this->signer, static::$ecdsaKeys['public1']));
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @covers Lcobucci\JWT\Signer\Ecdsa
+     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
+     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     */
+    public function everythingShouldWorkWithAKeyWithParams()
+    {
+        $user = (object) ['name' => 'testing', 'email' => 'testing@abc.com'];
+
+        $token = (new Builder())->setId(1)
+                                ->setAudience('http://client.abc.com')
+                                ->setIssuer('http://api.abc.com')
+                                ->set('user', $user)
+                                ->setHeader('jki', '1234')
+                                ->sign($this->signer, static::$ecdsaKeys['private-params'])
+                                ->getToken();
+
+        $this->assertTrue($token->verify($this->signer, static::$ecdsaKeys['public-params']));
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Parser
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @covers Lcobucci\JWT\Signer\Ecdsa
+     * @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
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Parsing\Decoder
+     */
+    public function everythingShouldWorkWhenUsingATokenGeneratedByOtherLibs()
+    {
+        $data = 'eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJoZWxsbyI6IndvcmxkIn0.'
+                . 'AQx1MqdTni6KuzfOoedg2-7NUiwe-b88SWbdmviz40GTwrM0Mybp1i1tVtm'
+                . 'TSQ91oEXGXBdtwsN6yalzP9J-sp2YATX_Tv4h-BednbdSvYxZsYnUoZ--ZU'
+                . 'dL10t7g8Yt3y9hdY_diOjIptcha6ajX8yzkDGYG42iSe3f5LywSuD6FO5c';
+
+        $key = '-----BEGIN PUBLIC KEY-----' . PHP_EOL
+               . 'MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQAcpkss6wI7PPlxj3t7A1RqMH3nvL4' . PHP_EOL
+               . 'L5Tzxze/XeeYZnHqxiX+gle70DlGRMqqOq+PJ6RYX7vK0PJFdiAIXlyPQq0B3KaU' . PHP_EOL
+               . 'e86IvFeQSFrJdCc0K8NfiH2G1loIk3fiR+YLqlXk6FAeKtpXJKxR1pCQCAM+vBCs' . PHP_EOL
+               . 'mZudf1zCUZ8/4eodlHU=' . PHP_EOL
+               . '-----END PUBLIC KEY-----';
+
+        $keychain = new Keychain();
+        $token = (new Parser())->parse((string) $data);
+
+        $this->assertEquals('world', $token->getClaim('hello'));
+        $this->assertTrue($token->verify(new Sha512(), $keychain->getPublicKey($key)));
+    }
+}

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

@@ -0,0 +1,186 @@
+<?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\FunctionalTests;
+
+use Lcobucci\JWT\Builder;
+use Lcobucci\JWT\Parser;
+use Lcobucci\JWT\Token;
+use Lcobucci\JWT\Signature;
+use Lcobucci\JWT\Signer\Hmac\Sha256;
+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
+{
+    /**
+     * @var Sha256
+     */
+    private $signer;
+
+    /**
+     * @before
+     */
+    public function createSigner()
+    {
+        $this->signer = new Sha256();
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @covers Lcobucci\JWT\Signer\Hmac
+     * @covers Lcobucci\JWT\Signer\Hmac\Sha256
+     */
+    public function builderCanGenerateAToken()
+    {
+        $user = (object) ['name' => 'testing', 'email' => 'testing@abc.com'];
+
+        $token = (new Builder())->setId(1)
+                              ->setAudience('http://client.abc.com')
+                              ->setIssuer('http://api.abc.com')
+                              ->set('user', $user)
+                              ->setHeader('jki', '1234')
+                              ->sign($this->signer, 'testing')
+                              ->getToken();
+
+        $this->assertAttributeInstanceOf(Signature::class, 'signature', $token);
+        $this->assertEquals('1234', $token->getHeader('jki'));
+        $this->assertEquals('http://client.abc.com', $token->getClaim('aud'));
+        $this->assertEquals('http://api.abc.com', $token->getClaim('iss'));
+        $this->assertEquals($user, $token->getClaim('user'));
+
+        return $token;
+    }
+
+    /**
+     * @test
+     *
+     * @depends builderCanGenerateAToken
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Parser
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Parsing\Decoder
+     */
+    public function parserCanReadAToken(Token $generated)
+    {
+        $read = (new Parser())->parse((string) $generated);
+
+        $this->assertEquals($generated, $read);
+        $this->assertEquals('testing', $read->getClaim('user')->name);
+    }
+
+    /**
+     * @test
+     *
+     * @depends builderCanGenerateAToken
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Parser
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @covers Lcobucci\JWT\Signer\Hmac
+     * @covers Lcobucci\JWT\Signer\Hmac\Sha256
+     */
+    public function verifyShouldReturnFalseWhenKeyIsNotRight(Token $token)
+    {
+        $this->assertFalse($token->verify($this->signer, 'testing1'));
+    }
+
+    /**
+     * @test
+     *
+     * @depends builderCanGenerateAToken
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Parser
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @covers Lcobucci\JWT\Signer\Hmac
+     * @covers Lcobucci\JWT\Signer\Hmac\Sha256
+     * @covers Lcobucci\JWT\Signer\Hmac\Sha512
+     */
+    public function verifyShouldReturnFalseWhenAlgorithmIsDifferent(Token $token)
+    {
+        $this->assertFalse($token->verify(new Sha512(), 'testing'));
+    }
+
+    /**
+     * @test
+     *
+     * @depends builderCanGenerateAToken
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Parser
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @covers Lcobucci\JWT\Signer\Hmac
+     * @covers Lcobucci\JWT\Signer\Hmac\Sha256
+     */
+    public function verifyShouldReturnTrueWhenKeyIsRight(Token $token)
+    {
+        $this->assertTrue($token->verify($this->signer, 'testing'));
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Parser
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @covers Lcobucci\JWT\Signer\Hmac
+     * @covers Lcobucci\JWT\Signer\Hmac\Sha256
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Parsing\Decoder
+     */
+    public function everythingShouldWorkWhenUsingATokenGeneratedByOtherLibs()
+    {
+        $data = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJoZWxsbyI6IndvcmxkIn0.Rh'
+                . '7AEgqCB7zae1PkgIlvOpeyw9Ab8NGTbeOH7heHO0o';
+
+        $token = (new Parser())->parse((string) $data);
+
+        $this->assertEquals('world', $token->getClaim('hello'));
+        $this->assertTrue($token->verify($this->signer, 'testing'));
+    }
+}

+ 53 - 0
api/vendor/lcobucci/jwt/test/functional/Keys.php

@@ -0,0 +1,53 @@
+<?php
+namespace Lcobucci\JWT;
+
+use Lcobucci\JWT\Signer\Keychain;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ */
+trait Keys
+{
+    /**
+     * @var array
+     */
+    protected static $rsaKeys;
+
+    /**
+     * @var array
+     */
+    protected static $ecdsaKeys;
+
+    /**
+     * @beforeClass
+     */
+    public static function createRsaKeys()
+    {
+        $keychain = new Keychain();
+        $dir = 'file://' . __DIR__;
+
+        static::$rsaKeys = [
+            'private' => $keychain->getPrivateKey($dir . '/rsa/private.key'),
+            'public' => $keychain->getPublicKey($dir . '/rsa/public.key'),
+            'encrypted-private' => $keychain->getPrivateKey($dir . '/rsa/encrypted-private.key', 'testing'),
+            'encrypted-public' => $keychain->getPublicKey($dir . '/rsa/encrypted-public.key')
+        ];
+    }
+
+    /**
+     * @beforeClass
+     */
+    public static function createEcdsaKeys()
+    {
+        $keychain = new Keychain();
+        $dir = 'file://' . __DIR__;
+
+        static::$ecdsaKeys = [
+            'private' => $keychain->getPrivateKey($dir . '/ecdsa/private.key'),
+            'private-params' => $keychain->getPrivateKey($dir . '/ecdsa/private2.key'),
+            'public1' => $keychain->getPublicKey($dir . '/ecdsa/public1.key'),
+            'public2' => $keychain->getPublicKey($dir . '/ecdsa/public2.key'),
+            'public-params' => $keychain->getPublicKey($dir . '/ecdsa/public3.key'),
+        ];
+    }
+}

+ 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',
+            ],
+        ];
+    }
+}

+ 280 - 0
api/vendor/lcobucci/jwt/test/functional/RsaTokenTest.php

@@ -0,0 +1,280 @@
+<?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\FunctionalTests;
+
+use Lcobucci\JWT\Builder;
+use Lcobucci\JWT\Keys;
+use Lcobucci\JWT\Parser;
+use Lcobucci\JWT\Signer\Key;
+use Lcobucci\JWT\Token;
+use Lcobucci\JWT\Signature;
+use Lcobucci\JWT\Signer\Rsa\Sha256;
+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
+{
+    use Keys;
+
+    /**
+     * @var Sha256
+     */
+    private $signer;
+
+    /**
+     * @before
+     */
+    public function createSigner()
+    {
+        $this->signer = new Sha256();
+    }
+
+    /**
+     * @test
+     *
+     * @expectedException \InvalidArgumentException
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\Rsa
+     * @covers \Lcobucci\JWT\Signer\Rsa\Sha256
+     */
+    public function builderShouldRaiseExceptionWhenKeyIsInvalid()
+    {
+        $user = (object) ['name' => 'testing', 'email' => 'testing@abc.com'];
+
+        (new Builder())->setId(1)
+                       ->setAudience('http://client.abc.com')
+                       ->setIssuer('http://api.abc.com')
+                       ->set('user', $user)
+                       ->getToken($this->signer, new Key('testing'));
+    }
+
+    /**
+     * @test
+     *
+     * @expectedException \InvalidArgumentException
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\Rsa
+     * @covers \Lcobucci\JWT\Signer\Rsa\Sha256
+     */
+    public function builderShouldRaiseExceptionWhenKeyIsNotRsaCompatible()
+    {
+        $user = (object) ['name' => 'testing', 'email' => 'testing@abc.com'];
+
+        (new Builder())->setId(1)
+                       ->setAudience('http://client.abc.com')
+                       ->setIssuer('http://api.abc.com')
+                       ->set('user', $user)
+                       ->getToken($this->signer, static::$ecdsaKeys['private']);
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\Rsa
+     * @covers \Lcobucci\JWT\Signer\Rsa\Sha256
+     */
+    public function builderCanGenerateAToken()
+    {
+        $user = (object) ['name' => 'testing', 'email' => 'testing@abc.com'];
+
+        $token = (new Builder())->setId(1)
+                              ->setAudience('http://client.abc.com')
+                              ->setIssuer('http://api.abc.com')
+                              ->set('user', $user)
+                              ->setHeader('jki', '1234')
+                              ->sign($this->signer, static::$rsaKeys['private'])
+                              ->getToken();
+
+        $this->assertAttributeInstanceOf(Signature::class, 'signature', $token);
+        $this->assertEquals('1234', $token->getHeader('jki'));
+        $this->assertEquals('http://client.abc.com', $token->getClaim('aud'));
+        $this->assertEquals('http://api.abc.com', $token->getClaim('iss'));
+        $this->assertEquals($user, $token->getClaim('user'));
+
+        return $token;
+    }
+
+    /**
+     * @test
+     *
+     * @depends builderCanGenerateAToken
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Parser
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Parsing\Decoder
+     */
+    public function parserCanReadAToken(Token $generated)
+    {
+        $read = (new Parser())->parse((string) $generated);
+
+        $this->assertEquals($generated, $read);
+        $this->assertEquals('testing', $read->getClaim('user')->name);
+    }
+
+    /**
+     * @test
+     *
+     * @depends builderCanGenerateAToken
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Parser
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\Rsa
+     * @covers \Lcobucci\JWT\Signer\Rsa\Sha256
+     */
+    public function verifyShouldReturnFalseWhenKeyIsNotRight(Token $token)
+    {
+        $this->assertFalse($token->verify($this->signer, self::$rsaKeys['encrypted-public']));
+    }
+
+    /**
+     * @test
+     *
+     * @depends builderCanGenerateAToken
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Parser
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @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)
+    {
+        $this->assertFalse($token->verify(new Sha512(), self::$rsaKeys['public']));
+    }
+
+    /**
+     * @test
+     *
+     * @expectedException \InvalidArgumentException
+     *
+     * @depends builderCanGenerateAToken
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Parser
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\Rsa
+     * @covers \Lcobucci\JWT\Signer\Rsa\Sha256
+     */
+    public function verifyShouldRaiseExceptionWhenKeyIsNotRsaCompatible(Token $token)
+    {
+        $this->assertFalse($token->verify($this->signer, self::$ecdsaKeys['public1']));
+    }
+
+    /**
+     * @test
+     *
+     * @depends builderCanGenerateAToken
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Parser
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @covers \Lcobucci\JWT\Signer\OpenSSL
+     * @covers \Lcobucci\JWT\Signer\Rsa
+     * @covers \Lcobucci\JWT\Signer\Rsa\Sha256
+     */
+    public function verifyShouldReturnTrueWhenKeyIsRight(Token $token)
+    {
+        $this->assertTrue($token->verify($this->signer, self::$rsaKeys['public']));
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Parser
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Signature
+     * @covers Lcobucci\JWT\Signer\Key
+     * @covers Lcobucci\JWT\Signer\BaseSigner
+     * @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
+     * @covers Lcobucci\JWT\Parsing\Decoder
+     */
+    public function everythingShouldWorkWhenUsingATokenGeneratedByOtherLibs()
+    {
+        $data = 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXUyJ9.eyJoZWxsbyI6IndvcmxkIn0.s'
+                . 'GYbB1KrmnESNfJ4D9hOe1Zad_BMyxdb8G4p4LNP7StYlOyBWck6q7XPpPj_6gB'
+                . 'Bo1ohD3MA2o0HY42lNIrAStaVhfsFKGdIou8TarwMGZBPcif_3ThUV1pGS3fZc'
+                . 'lFwF2SP7rqCngQis_xcUVCyqa8E1Wa_v28grnl1QZrnmQFO8B5JGGLqcrfUHJO'
+                . 'nJCupP-Lqh4TmIhftIimSCgLNmJg80wyrpUEfZYReE7hPuEmY0ClTqAGIMQoNS'
+                . '98ljwDxwhfbSuL2tAdbV4DekbTpWzspe3dOJ7RSzmPKVZ6NoezaIazKqyqkmHZfcMaHI1lQeGia6LTbHU1bp0gINi74Vw';
+
+        $token = (new Parser())->parse((string) $data);
+
+        $this->assertEquals('world', $token->getClaim('hello'));
+        $this->assertTrue($token->verify($this->signer, self::$rsaKeys['public']));
+    }
+}

+ 161 - 0
api/vendor/lcobucci/jwt/test/functional/UnsignedTokenTest.php

@@ -0,0 +1,161 @@
+<?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\FunctionalTests;
+
+use Lcobucci\JWT\Builder;
+use Lcobucci\JWT\Parser;
+use Lcobucci\JWT\Token;
+use Lcobucci\JWT\ValidationData;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.1.0
+ */
+class UnsignedTokenTest extends \PHPUnit\Framework\TestCase
+{
+    const CURRENT_TIME = 100000;
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     */
+    public function builderCanGenerateAToken()
+    {
+        $user = (object) ['name' => 'testing', 'email' => 'testing@abc.com'];
+
+        $token = (new Builder())->setId(1)
+                              ->setAudience('http://client.abc.com')
+                              ->setIssuer('http://api.abc.com')
+                              ->setExpiration(self::CURRENT_TIME + 3000)
+                              ->set('user', $user)
+                              ->getToken();
+
+        $this->assertAttributeEquals(null, 'signature', $token);
+        $this->assertEquals('http://client.abc.com', $token->getClaim('aud'));
+        $this->assertEquals('http://api.abc.com', $token->getClaim('iss'));
+        $this->assertEquals(self::CURRENT_TIME + 3000, $token->getClaim('exp'));
+        $this->assertEquals($user, $token->getClaim('user'));
+
+        return $token;
+    }
+
+    /**
+     * @test
+     *
+     * @depends builderCanGenerateAToken
+     *
+     * @covers Lcobucci\JWT\Builder
+     * @covers Lcobucci\JWT\Parser
+     * @covers Lcobucci\JWT\Token
+     * @covers Lcobucci\JWT\Claim\Factory
+     * @covers Lcobucci\JWT\Claim\Basic
+     * @covers Lcobucci\JWT\Parsing\Encoder
+     * @covers Lcobucci\JWT\Parsing\Decoder
+     */
+    public function parserCanReadAToken(Token $generated)
+    {
+        $read = (new Parser())->parse((string) $generated);
+
+        $this->assertEquals($generated, $read);
+        $this->assertEquals('testing', $read->getClaim('user')->name);
+    }
+
+    /**
+     * @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 tokenValidationShouldReturnWhenEverythingIsFine(Token $generated)
+    {
+        $data = new ValidationData(self::CURRENT_TIME - 10);
+        $data->setAudience('http://client.abc.com');
+        $data->setIssuer('http://api.abc.com');
+
+        $this->assertTrue($generated->validate($data));
+    }
+
+    /**
+     * @test
+     *
+     * @dataProvider invalidValidationData
+     *
+     * @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 tokenValidationShouldReturnFalseWhenExpectedDataDontMatch(ValidationData $data, Token $generated)
+    {
+        $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);
+        $expired->setAudience('http://client.abc.com');
+        $expired->setIssuer('http://api.abc.com');
+
+        $invalidAudience = new ValidationData(self::CURRENT_TIME - 10);
+        $invalidAudience->setAudience('http://cclient.abc.com');
+        $invalidAudience->setIssuer('http://api.abc.com');
+
+        $invalidIssuer = new ValidationData(self::CURRENT_TIME - 10);
+        $invalidIssuer->setAudience('http://client.abc.com');
+        $invalidIssuer->setIssuer('http://aapi.abc.com');
+
+        return [[$expired], [$invalidAudience], [$invalidIssuer]];
+    }
+}

+ 5 - 0
api/vendor/lcobucci/jwt/test/functional/ecdsa/private.key

@@ -0,0 +1,5 @@
+-----BEGIN EC PRIVATE KEY-----
+MHcCAQEEIBGpMoZJ64MMSzuo5JbmXpf9V4qSWdLIl/8RmJLcfn/qoAoGCCqGSM49
+AwEHoUQDQgAE7it/EKmcv9bfpcV1fBreLMRXxWpnd0wxa2iFruiI2tsEdGFTLTsy
+U+GeRqC7zN0aTnTQajarUylKJ3UWr/r1kg==
+-----END EC PRIVATE KEY-----

+ 8 - 0
api/vendor/lcobucci/jwt/test/functional/ecdsa/private2.key

@@ -0,0 +1,8 @@
+-----BEGIN EC PARAMETERS-----
+BggqhkjOPQMBBw==
+-----END EC PARAMETERS-----
+-----BEGIN EC PRIVATE KEY-----
+MHcCAQEEIM6G7WZ6SqoPwrHwGXhOJkYD+ErT8dfRvrNifgBQvSb7oAoGCCqGSM49
+AwEHoUQDQgAE09Hkp/u0tIGdzlQ99R/sXCOr9DTZAfLex4D4Po0C1L3qUqHrzZ0m
+B3bAhe+pwEDQ/jqVqdzxhA9i4PqT7F4Aew==
+-----END EC PRIVATE KEY-----

+ 4 - 0
api/vendor/lcobucci/jwt/test/functional/ecdsa/public1.key

@@ -0,0 +1,4 @@
+-----BEGIN PUBLIC KEY-----
+MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE7it/EKmcv9bfpcV1fBreLMRXxWpn
+d0wxa2iFruiI2tsEdGFTLTsyU+GeRqC7zN0aTnTQajarUylKJ3UWr/r1kg==
+-----END PUBLIC KEY-----

+ 4 - 0
api/vendor/lcobucci/jwt/test/functional/ecdsa/public2.key

@@ -0,0 +1,4 @@
+-----BEGIN PUBLIC KEY-----
+MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEdgxRxlhzhHGj+v6S2ikp+33LoGp5
+QWbEWv8BORsr2Ayg6C7deDDRM/s/f0R++4zZqXro1gDTVF5VDv7nE+EfEw==
+-----END PUBLIC KEY-----

+ 4 - 0
api/vendor/lcobucci/jwt/test/functional/ecdsa/public3.key

@@ -0,0 +1,4 @@
+-----BEGIN PUBLIC KEY-----
+MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE09Hkp/u0tIGdzlQ99R/sXCOr9DTZ
+AfLex4D4Po0C1L3qUqHrzZ0mB3bAhe+pwEDQ/jqVqdzxhA9i4PqT7F4Aew==
+-----END PUBLIC KEY-----

+ 30 - 0
api/vendor/lcobucci/jwt/test/functional/rsa/encrypted-private.key

@@ -0,0 +1,30 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: AES-128-CBC,0D71668CE71033CB9150ED82FC87F4A1
+
+uLzPNDdlHnZ77tAGMHyPYERDMBcdV4SsQJYcSjiHhR2o0dLGTdgOpQrXTHPX4GJF
+LlEWLhAAV9wx2mM/2kHDWB4uZwThtT9/v+RFoW1WbVO/d3lhI9fg4/73/DWAH/7/
+afMRc7ZOVoAmVCESotPx4khCHoE97RdY/JtkLTzc3+peqmL53AbYXrg9rTN1B+ZV
+U3w4ciQS8Uki87zDYIBjYtaOCyMUTvug25CvdssvUMBoc/Jc0xps6/vAyXrnzlGT
+pZD0Tst8idswfDi613BhAaxJspeY0AErWA59qJ3eGzbiQq5RDWcbJe/Tz5r/6+NN
+DkvNQ7DaEZ6LpeWX0MUq6/QWfrM8yE95XhjyC1d3LYn32lXHUygbgTFWIgLDoOE6
+nBhu34SWtbLAnqYGewaJFxhlYVS9rb/uvYQg70r5X9Sx6alCQPiPyIv39IItezn2
+HF2GRfE91MPZUeDhdqdvvOlSZVM5KnYc1fhamGAwM48gdDDXe8Czu/JEGoANNvC3
+l/Z1p5RtGF4hrel9WpeX9zQq3pvtfVcVIiWuRUwCOSQytXlieRK37sMuYeggvmjV
+VvaCods3mS/panWg9T/D/deIXjhzNJLvyiJg8+3sY5H4yNe0XpbaAc/ySwt9Rcxy
+FzFQ+5pghLSZgR1uV3AhdcnzXBU2GkYhdGKt2tUsH0UeVQ2BXxTlBFsCOh2dWqcj
+y3suIG65bukDAAWidQ4q3S6ZIMpXBhhCj7nwB5jQ7wSlU3U9So0ndr7zxdUILiMm
+chHi3q5apVZnMGcwv2B33rt4nD7HgGEmRKkCelrSrBATY1ut+T4rCDzKDqDs3jpv
+hYIWrlNPTkJyQz3eWly6Db+FJEfdYGadYJusc7/nOxCh/QmUu8Sh3NhKT6TH0bS7
+1AAqd8H+2hJ9I32Dhd2qwAF7PkNe2LGi+P8tbAtepKGim5w65wnsPePMnrfxumsG
+PeDnMrqeCKy+fME7a/MS5kmEBpmD4BMhVC6/OhFVz8gBty1f8yIEZggHNQN2QK7m
+NIrG+PwqW2w8HoxOlAi2Ix4LTPifrdfsH02U7aM1pgo1rZzD4AOzqvzCaK43H2VB
+BHLeTBGoLEUxXA9C+iGbeQlKXkMC00QKkjK5+nvkvnvePFfsrTQIpuyGufD/MoPb
+6fpwsyHZDxhxMN1PJk1b1lPq2Ui4hXpVNOYd4Q6OQz7bwxTMRX9XQromUlKMMgAT
+edX8v2NdM7Ssy1IwHuGVbDEpZdjoeaWZ1iNRV17i/EaJAqwYDQLfsuHBlzZL1ov1
+xkKVJdL8Y3q80oRAzTQDVdzL/rI44LLAfv609YByCnw29feYJY2W6gV0O7ZSw413
+XUkc5CaEbR1LuG8NtnOOPJV4Tb/hNsIDtvVm7Hl5npBKBe4iVgQ2LNuC2eT69d/z
+uvzgjISlumPiO5ivuYe0QtLPuJSc+/Bl8bPL8gcNQEtqkzj7IftHPPZNs+bJC2uY
+bPjq5KoDNAMF6VHuKHwu48MBYpnXDIg3ZenmJwGRULRBhK6324hDS6NJ7ULTBU2M
+TZCHmg89ySLBfCAspVeo63o/R7bs9a7BP9x2h5uwCBogSvkEwhhPKnboVN45bp9c
+-----END RSA PRIVATE KEY-----

+ 9 - 0
api/vendor/lcobucci/jwt/test/functional/rsa/encrypted-public.key

@@ -0,0 +1,9 @@
+-----BEGIN PUBLIC KEY-----
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwLpbUP8a9yflt5LKUUS3
+NPuRM7yEouPWg0VKeY5AURu4i8bqQ20K5jwfRJ+w05FvlywG4EuxpnpTFTVS2/do
+q3xufzTf/C3KIDOAHEifkdx4140btKxxm4mD9Eu2CQ32adZyScha50KUFlfnAAic
+Hb8wYxjFyWo3PAbGYmCQCn2z97Ab0Ar6NR1e+V9f8EL9Orr2f04puKJfQTZdWVDF
+UJR4w7QZ/CPY0LEsiFLW3QQCNraka1mtrLJwPqreBtDEkj8IoISNkrguu/97RQZz
+miJgBQkVjr6OfqG5WIFr0MzbRZc1/aK9g8ft88nhhQm0E3GqkCxBKTwgA03HtK07
+qQIDAQAB
+-----END PUBLIC KEY-----

+ 28 - 0
api/vendor/lcobucci/jwt/test/functional/rsa/private.key

@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDTvwE87MtgREYL
+TL4aHhQo3ZzogmxxvMUsKnPzyxRs1YrXOSOpwN0npsXarBKKVIUMNLfFODp/vnQn
+2Zp06N8XG59WAOKwvC4MfxLDQkA+JXggzHlkbVoTN+dUkdYIFqSKuAPGwiWToRK2
+SxEhij3rE2FON8jQZvDxZkiP9a4vxJO3OTPQwKredXFiObsXD/c3RtLFhKctjCyH
+OIrP0bQEsee/m7JNtG4ry6BPusN6wb+vJo5ieBYPa3c19akNq6q/nYWhplhkkJSu
+aOrL5xXEFzI5TvcvnXR568GVcxK8YLfFkdxpsXGt5rAbeh0h/U5kILEAqv8P9PGT
+ZpicKbrnAgMBAAECggEAd3yTQEQHR91/ASVfKPHMQns77eCbPVtekFusbugsMHYY
+EPdHbqVMpvFvOMRc+f5Tzd15ziq6qBdbCJm8lThLm4iU0z1QrpaiDZ8vgUvDYM5Y
+CXoZDli+uZWUTp60/n94fmb0ipZIChScsI2PrzOJWTvobvD/uso8MJydWc8zafQm
+uqYzygOfjFZvU4lSfgzpefhpquy0JUy5TiKRmGUnwLb3TtcsVavjsn4QmNwLYgOF
+2OE+R12ex3pAKTiRE6FcnE1xFIo1GKhBa2Otgw3MDO6Gg+kn8Q4alKz6C6RRlgaH
+R7sYzEfJhsk/GGFTYOzXKQz2lSaStKt9wKCor04RcQKBgQDzPOu5jCTfayUo7xY2
+jHtiogHyKLLObt9l3qbwgXnaD6rnxYNvCrA0OMvT+iZXsFZKJkYzJr8ZOxOpPROk
+10WdOaefiwUyL5dypueSwlIDwVm+hI4Bs82MajHtzOozh+73wA+aw5rPs84Uix9w
+VbbwaVR6qP/BV09yJYS5kQ7fmwKBgQDe2xjywX2d2MC+qzRr+LfU+1+gq0jjhBCX
+WHqRN6IECB0xTnXUf9WL/VCoI1/55BhdbbEja+4btYgcXSPmlXBIRKQ4VtFfVmYB
+kPXeD8oZ7LyuNdCsbKNe+x1IHXDe6Wfs3L9ulCfXxeIE84wy3fd66mQahyXV9iD9
+CkuifMqUpQKBgQCiydHlY1LGJ/o9tA2Ewm5Na6mrvOs2V2Ox1NqbObwoYbX62eiF
+53xX5u8bVl5U75JAm+79it/4bd5RtKux9dUETbLOhwcaOFm+hM+VG/IxyzRZ2nMD
+1qcpY2U5BpxzknUvYF3RMTop6edxPk7zKpp9ubCtSu+oINvtxAhY/SkcIwKBgGP1
+upcImyO2GZ5shLL5eNubdSVILwV+M0LveOqyHYXZbd6z5r5OKKcGFKuWUnJwEU22
+6gGNY9wh7M9sJ7JBzX9c6pwqtPcidda2AtJ8GpbOTUOG9/afNBhiYpv6OKqD3w2r
+ZmJfKg/qvpqh83zNezgy8nvDqwDxyZI2j/5uIx/RAoGBAMWRmxtv6H2cKhibI/aI
+MTJM4QRjyPNxQqvAQsv+oHUbid06VK3JE+9iQyithjcfNOwnCaoO7I7qAj9QEfJS
+MZQc/W/4DHJebo2kd11yoXPVTXXOuEwLSKCejBXABBY0MPNuPUmiXeU0O3Tyi37J
+TUKzrgcd7NvlA41Y4xKcOqEA
+-----END PRIVATE KEY-----

+ 9 - 0
api/vendor/lcobucci/jwt/test/functional/rsa/public.key

@@ -0,0 +1,9 @@
+-----BEGIN PUBLIC KEY-----
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA078BPOzLYERGC0y+Gh4U
+KN2c6IJscbzFLCpz88sUbNWK1zkjqcDdJ6bF2qwSilSFDDS3xTg6f750J9madOjf
+FxufVgDisLwuDH8Sw0JAPiV4IMx5ZG1aEzfnVJHWCBakirgDxsIlk6EStksRIYo9
+6xNhTjfI0Gbw8WZIj/WuL8STtzkz0MCq3nVxYjm7Fw/3N0bSxYSnLYwshziKz9G0
+BLHnv5uyTbRuK8ugT7rDesG/ryaOYngWD2t3NfWpDauqv52FoaZYZJCUrmjqy+cV
+xBcyOU73L510eevBlXMSvGC3xZHcabFxreawG3odIf1OZCCxAKr/D/Txk2aYnCm6
+5wIDAQAB
+-----END PUBLIC KEY-----

+ 633 - 0
api/vendor/lcobucci/jwt/test/unit/BuilderTest.php

@@ -0,0 +1,633 @@
+<?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;
+
+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
+{
+    /**
+     * @var Encoder|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $encoder;
+
+    /**
+     * @var ClaimFactory|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $claimFactory;
+
+    /**
+     * @var Claim|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $defaultClaim;
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function setUp()
+    {
+        $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')
+                           ->willReturn($this->defaultClaim);
+    }
+
+    /**
+     * @return Builder
+     */
+    private function createBuilder()
+    {
+        return new Builder($this->encoder, $this->claimFactory);
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Builder::__construct
+     */
+    public function constructMustInitializeTheAttributes()
+    {
+        $builder = $this->createBuilder();
+
+        $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
+        $this->assertAttributeEquals([], 'claims', $builder);
+        $this->assertAttributeSame($this->encoder, 'encoder', $builder);
+        $this->assertAttributeSame($this->claimFactory, 'claimFactory', $builder);
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::permittedFor
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function permittedForMustChangeTheAudClaim()
+    {
+        $builder = $this->createBuilder();
+        $builder->permittedFor('test');
+
+        $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
+        $this->assertAttributeEquals(['aud' => $this->defaultClaim], 'claims', $builder);
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::permittedFor
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function permittedForCanReplicateItemOnHeader()
+    {
+        $builder = $this->createBuilder();
+        $builder->permittedFor('test', true);
+
+        $this->assertAttributeEquals(['aud' => $this->defaultClaim], 'claims', $builder);
+
+        $this->assertAttributeEquals(
+            ['alg' => 'none', 'typ' => 'JWT', 'aud' => $this->defaultClaim],
+            'headers',
+            $builder
+        );
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::permittedFor
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function permittedForMustKeepAFluentInterface()
+    {
+        $builder = $this->createBuilder();
+
+        $this->assertSame($builder, $builder->permittedFor('test'));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::expiresAt
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function expiresAtMustChangeTheExpClaim()
+    {
+        $builder = $this->createBuilder();
+        $builder->expiresAt('2');
+
+        $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
+        $this->assertAttributeEquals(['exp' => $this->defaultClaim], 'claims', $builder);
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::expiresAt
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function expiresAtCanReplicateItemOnHeader()
+    {
+        $builder = $this->createBuilder();
+        $builder->expiresAt('2', true);
+
+        $this->assertAttributeEquals(['exp' => $this->defaultClaim], 'claims', $builder);
+
+        $this->assertAttributeEquals(
+            ['alg' => 'none', 'typ' => 'JWT', 'exp' => $this->defaultClaim],
+            'headers',
+            $builder
+        );
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::expiresAt
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function expiresAtMustKeepAFluentInterface()
+    {
+        $builder = $this->createBuilder();
+
+        $this->assertSame($builder, $builder->expiresAt('2'));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::identifiedBy
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function identifiedByMustChangeTheJtiClaim()
+    {
+        $builder = $this->createBuilder();
+        $builder->identifiedBy('2');
+
+        $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
+        $this->assertAttributeEquals(['jti' => $this->defaultClaim], 'claims', $builder);
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::identifiedBy
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function identifiedByCanReplicateItemOnHeader()
+    {
+        $builder = $this->createBuilder();
+        $builder->identifiedBy('2', true);
+
+        $this->assertAttributeEquals(['jti' => $this->defaultClaim], 'claims', $builder);
+
+        $this->assertAttributeEquals(
+            ['alg' => 'none', 'typ' => 'JWT', 'jti' => $this->defaultClaim],
+            'headers',
+            $builder
+        );
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::identifiedBy
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function identifiedByMustKeepAFluentInterface()
+    {
+        $builder = $this->createBuilder();
+
+        $this->assertSame($builder, $builder->identifiedBy('2'));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::issuedAt
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function issuedAtMustChangeTheIatClaim()
+    {
+        $builder = $this->createBuilder();
+        $builder->issuedAt('2');
+
+        $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
+        $this->assertAttributeEquals(['iat' => $this->defaultClaim], 'claims', $builder);
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::issuedAt
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function issuedAtCanReplicateItemOnHeader()
+    {
+        $builder = $this->createBuilder();
+        $builder->issuedAt('2', true);
+
+        $this->assertAttributeEquals(['iat' => $this->defaultClaim], 'claims', $builder);
+
+        $this->assertAttributeEquals(
+            ['alg' => 'none', 'typ' => 'JWT', 'iat' => $this->defaultClaim],
+            'headers',
+            $builder
+        );
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::issuedAt
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function issuedAtMustKeepAFluentInterface()
+    {
+        $builder = $this->createBuilder();
+
+        $this->assertSame($builder, $builder->issuedAt('2'));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::issuedBy
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function issuedByMustChangeTheIssClaim()
+    {
+        $builder = $this->createBuilder();
+        $builder->issuedBy('2');
+
+        $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
+        $this->assertAttributeEquals(['iss' => $this->defaultClaim], 'claims', $builder);
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::issuedBy
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function issuedByCanReplicateItemOnHeader()
+    {
+        $builder = $this->createBuilder();
+        $builder->issuedBy('2', true);
+
+        $this->assertAttributeEquals(['iss' => $this->defaultClaim], 'claims', $builder);
+
+        $this->assertAttributeEquals(
+            ['alg' => 'none', 'typ' => 'JWT', 'iss' => $this->defaultClaim],
+            'headers',
+            $builder
+        );
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::issuedBy
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function issuedByMustKeepAFluentInterface()
+    {
+        $builder = $this->createBuilder();
+
+        $this->assertSame($builder, $builder->issuedBy('2'));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::canOnlyBeUsedAfter
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function canOnlyBeUsedAfterMustChangeTheNbfClaim()
+    {
+        $builder = $this->createBuilder();
+        $builder->canOnlyBeUsedAfter('2');
+
+        $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
+        $this->assertAttributeEquals(['nbf' => $this->defaultClaim], 'claims', $builder);
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::canOnlyBeUsedAfter
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function canOnlyBeUsedAfterCanReplicateItemOnHeader()
+    {
+        $builder = $this->createBuilder();
+        $builder->canOnlyBeUsedAfter('2', true);
+
+        $this->assertAttributeEquals(['nbf' => $this->defaultClaim], 'claims', $builder);
+
+        $this->assertAttributeEquals(
+            ['alg' => 'none', 'typ' => 'JWT', 'nbf' => $this->defaultClaim],
+            'headers',
+            $builder
+        );
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::canOnlyBeUsedAfter
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function canOnlyBeUsedAfterMustKeepAFluentInterface()
+    {
+        $builder = $this->createBuilder();
+
+        $this->assertSame($builder, $builder->canOnlyBeUsedAfter('2'));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::relatedTo
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function relatedToMustChangeTheSubClaim()
+    {
+        $builder = $this->createBuilder();
+        $builder->relatedTo('2');
+
+        $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
+        $this->assertAttributeEquals(['sub' => $this->defaultClaim], 'claims', $builder);
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::relatedTo
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function relatedToCanReplicateItemOnHeader()
+    {
+        $builder = $this->createBuilder();
+        $builder->relatedTo('2', true);
+
+        $this->assertAttributeEquals(['sub' => $this->defaultClaim], 'claims', $builder);
+
+        $this->assertAttributeEquals(
+            ['alg' => 'none', 'typ' => 'JWT', 'sub' => $this->defaultClaim],
+            'headers',
+            $builder
+        );
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     *
+     * @covers Lcobucci\JWT\Builder::relatedTo
+     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
+     */
+    public function relatedToMustKeepAFluentInterface()
+    {
+        $builder = $this->createBuilder();
+
+        $this->assertSame($builder, $builder->relatedTo('2'));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     *
+     * @covers Lcobucci\JWT\Builder::withClaim
+     */
+    public function withClaimMustConfigureTheGivenClaim()
+    {
+        $builder = $this->createBuilder();
+        $builder->withClaim('userId', 2);
+
+        $this->assertAttributeEquals(['userId' => $this->defaultClaim], 'claims', $builder);
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     *
+     * @covers Lcobucci\JWT\Builder::withClaim
+     */
+    public function withClaimMustKeepAFluentInterface()
+    {
+        $builder = $this->createBuilder();
+
+        $this->assertSame($builder, $builder->withClaim('userId', 2));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     *
+     * @covers Lcobucci\JWT\Builder::withHeader
+     */
+    public function withHeaderMustConfigureTheGivenClaim()
+    {
+        $builder = $this->createBuilder();
+        $builder->withHeader('userId', 2);
+
+        $this->assertAttributeEquals(
+            ['alg' => 'none', 'typ' => 'JWT', 'userId' => $this->defaultClaim],
+            'headers',
+            $builder
+        );
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     *
+     * @covers Lcobucci\JWT\Builder::withHeader
+     */
+    public function withHeaderMustKeepAFluentInterface()
+    {
+        $builder = $this->createBuilder();
+
+        $this->assertSame($builder, $builder->withHeader('userId', 2));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::getToken
+     * @uses Lcobucci\JWT\Token
+     *
+     * @covers Lcobucci\JWT\Builder::sign
+     */
+    public function signMustConfigureSignerAndKey()
+    {
+        $signer = $this->createMock(Signer::class);
+
+        $builder = $this->createBuilder();
+        $builder->sign($signer, 'test');
+
+        $this->assertAttributeSame($signer, 'signer', $builder);
+        $this->assertAttributeEquals(new Key('test'), 'key', $builder);
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::getToken
+     * @uses Lcobucci\JWT\Token
+     *
+     * @covers Lcobucci\JWT\Builder::sign
+     */
+    public function signMustKeepAFluentInterface()
+    {
+        $signer = $this->createMock(Signer::class);
+        $builder = $this->createBuilder();
+
+        $this->assertSame($builder, $builder->sign($signer, 'test'));
+
+        return $builder;
+    }
+
+    /**
+     * @test
+     *
+     * @depends signMustKeepAFluentInterface
+     *
+     * @covers Lcobucci\JWT\Builder::unsign
+     */
+    public function unsignMustRemoveTheSignerAndKey(Builder $builder)
+    {
+        $builder->unsign();
+
+        $this->assertAttributeSame(null, 'signer', $builder);
+        $this->assertAttributeSame(null, 'key', $builder);
+    }
+
+    /**
+     * @test
+     *
+     * @depends signMustKeepAFluentInterface
+     *
+     * @covers Lcobucci\JWT\Builder::unsign
+     */
+    public function unsignMustKeepAFluentInterface(Builder $builder)
+    {
+        $this->assertSame($builder, $builder->unsign());
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Builder::__construct
+     * @uses Lcobucci\JWT\Builder::withClaim
+     * @uses Lcobucci\JWT\Token
+     *
+     * @covers Lcobucci\JWT\Builder::getToken
+     */
+    public function getTokenMustReturnANewTokenWithCurrentConfiguration()
+    {
+        $signer = $this->createMock(Signer::class);
+        $signature = $this->createMock(Signature::class);
+
+        $signer->method('sign')->willReturn($signature);
+
+        $this->encoder->expects($this->exactly(2))
+                      ->method('jsonEncode')
+                      ->withConsecutive([['typ'=> 'JWT', 'alg' => 'none']], [['test' => $this->defaultClaim]])
+                      ->willReturnOnConsecutiveCalls('1', '2');
+
+        $this->encoder->expects($this->exactly(3))
+                      ->method('base64UrlEncode')
+                      ->withConsecutive(['1'], ['2'], [$signature])
+                      ->willReturnOnConsecutiveCalls('1', '2', '3');
+
+        $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($signature, 'signature', $token);
+    }
+}

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

@@ -0,0 +1,84 @@
+<?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\Claim;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.0.0
+ */
+class BasicTest extends \PHPUnit\Framework\TestCase
+{
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Claim\Basic::__construct
+     */
+    public function constructorShouldConfigureTheAttributes()
+    {
+        $claim = new Basic('test', 1);
+
+        $this->assertAttributeEquals('test', 'name', $claim);
+        $this->assertAttributeEquals(1, 'value', $claim);
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     *
+     * @covers Lcobucci\JWT\Claim\Basic::getName
+     */
+    public function getNameShouldReturnTheClaimName()
+    {
+        $claim = new Basic('test', 1);
+
+        $this->assertEquals('test', $claim->getName());
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     *
+     * @covers Lcobucci\JWT\Claim\Basic::getValue
+     */
+    public function getValueShouldReturnTheClaimValue()
+    {
+        $claim = new Basic('test', 1);
+
+        $this->assertEquals(1, $claim->getValue());
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     *
+     * @covers Lcobucci\JWT\Claim\Basic::jsonSerialize
+     */
+    public function jsonSerializeShouldReturnTheClaimValue()
+    {
+        $claim = new Basic('test', 1);
+
+        $this->assertEquals(1, $claim->jsonSerialize());
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     *
+     * @covers Lcobucci\JWT\Claim\Basic::__toString
+     */
+    public function toStringShouldReturnTheClaimValue()
+    {
+        $claim = new Basic('test', 1);
+
+        $this->assertEquals('1', (string) $claim);
+    }
+}

+ 83 - 0
api/vendor/lcobucci/jwt/test/unit/Claim/EqualsToTest.php

@@ -0,0 +1,83 @@
+<?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\Claim;
+
+use Lcobucci\JWT\ValidationData;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.0.0
+ */
+class EqualsToTest extends \PHPUnit\Framework\TestCase
+{
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     * @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
+     */
+    public function validateShouldReturnTrueWhenValidationDontHaveTheClaim()
+    {
+        $claim = new EqualsTo('iss', 'test');
+
+        $this->assertTrue($claim->validate(new ValidationData()));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     * @uses Lcobucci\JWT\Claim\Basic::getName
+     * @uses Lcobucci\JWT\Claim\Basic::getValue
+     * @uses Lcobucci\JWT\ValidationData::__construct
+     * @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
+     */
+    public function validateShouldReturnTrueWhenValueIsEqualsToValidationData()
+    {
+        $claim = new EqualsTo('iss', 'test');
+
+        $data = new ValidationData();
+        $data->setIssuer('test');
+
+        $this->assertTrue($claim->validate($data));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     * @uses Lcobucci\JWT\Claim\Basic::getName
+     * @uses Lcobucci\JWT\Claim\Basic::getValue
+     * @uses Lcobucci\JWT\ValidationData::__construct
+     * @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
+     */
+    public function validateShouldReturnFalseWhenValueIsNotEqualsToValidationData()
+    {
+        $claim = new EqualsTo('iss', 'test');
+
+        $data = new ValidationData();
+        $data->setIssuer('test1');
+
+        $this->assertFalse($claim->validate($data));
+    }
+}

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

@@ -0,0 +1,168 @@
+<?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\Claim;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.0.0
+ */
+class FactoryTest extends \PHPUnit\Framework\TestCase
+{
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Claim\Factory::__construct
+     */
+    public function constructMustConfigureTheCallbacks()
+    {
+        $callback = function () {
+        };
+        $factory = new Factory(['test' => $callback]);
+
+        $expected = [
+            'iat' => [$factory, 'createLesserOrEqualsTo'],
+            'nbf' => [$factory, 'createLesserOrEqualsTo'],
+            'exp' => [$factory, 'createGreaterOrEqualsTo'],
+            'iss' => [$factory, 'createEqualsTo'],
+            'aud' => [$factory, 'createEqualsTo'],
+            'sub' => [$factory, 'createEqualsTo'],
+            'jti' => [$factory, 'createEqualsTo'],
+            'test' => $callback
+        ];
+
+        $this->assertAttributeEquals($expected, 'callbacks', $factory);
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Factory::__construct
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     *
+     * @covers Lcobucci\JWT\Claim\Factory::create
+     * @covers Lcobucci\JWT\Claim\Factory::createLesserOrEqualsTo
+     */
+    public function createShouldReturnALesserOrEqualsToClaimForIssuedAt()
+    {
+        $claim = new Factory();
+
+        $this->assertInstanceOf(LesserOrEqualsTo::class, $claim->create('iat', 1));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Factory::__construct
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     *
+     * @covers Lcobucci\JWT\Claim\Factory::create
+     * @covers Lcobucci\JWT\Claim\Factory::createLesserOrEqualsTo
+     */
+    public function createShouldReturnALesserOrEqualsToClaimForNotBefore()
+    {
+        $claim = new Factory();
+
+        $this->assertInstanceOf(LesserOrEqualsTo::class, $claim->create('nbf', 1));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Factory::__construct
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     *
+     * @covers Lcobucci\JWT\Claim\Factory::create
+     * @covers Lcobucci\JWT\Claim\Factory::createGreaterOrEqualsTo
+     */
+    public function createShouldReturnAGreaterOrEqualsToClaimForExpiration()
+    {
+        $claim = new Factory();
+
+        $this->assertInstanceOf(GreaterOrEqualsTo::class, $claim->create('exp', 1));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Factory::__construct
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     *
+     * @covers Lcobucci\JWT\Claim\Factory::create
+     * @covers Lcobucci\JWT\Claim\Factory::createEqualsTo
+     */
+    public function createShouldReturnAnEqualsToClaimForId()
+    {
+        $claim = new Factory();
+
+        $this->assertInstanceOf(EqualsTo::class, $claim->create('jti', 1));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Factory::__construct
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     *
+     * @covers Lcobucci\JWT\Claim\Factory::create
+     * @covers Lcobucci\JWT\Claim\Factory::createEqualsTo
+     */
+    public function createShouldReturnAnEqualsToClaimForIssuer()
+    {
+        $claim = new Factory();
+
+        $this->assertInstanceOf(EqualsTo::class, $claim->create('iss', 1));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Factory::__construct
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     *
+     * @covers Lcobucci\JWT\Claim\Factory::create
+     * @covers Lcobucci\JWT\Claim\Factory::createEqualsTo
+     */
+    public function createShouldReturnAnEqualsToClaimForAudience()
+    {
+        $claim = new Factory();
+
+        $this->assertInstanceOf(EqualsTo::class, $claim->create('aud', 1));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Factory::__construct
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     *
+     * @covers Lcobucci\JWT\Claim\Factory::create
+     * @covers Lcobucci\JWT\Claim\Factory::createEqualsTo
+     */
+    public function createShouldReturnAnEqualsToClaimForSubject()
+    {
+        $claim = new Factory();
+
+        $this->assertInstanceOf(EqualsTo::class, $claim->create('sub', 1));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Factory::__construct
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     *
+     * @covers Lcobucci\JWT\Claim\Factory::create
+     * @covers Lcobucci\JWT\Claim\Factory::createBasic
+     */
+    public function createShouldReturnABasiclaimForOtherClaims()
+    {
+        $claim = new Factory();
+
+        $this->assertInstanceOf(Basic::class, $claim->create('test', 1));
+    }
+}

+ 107 - 0
api/vendor/lcobucci/jwt/test/unit/Claim/GreaterOrEqualsToTest.php

@@ -0,0 +1,107 @@
+<?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\Claim;
+
+use Lcobucci\JWT\ValidationData;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.0.0
+ */
+class GreaterOrEqualsToTest extends \PHPUnit\Framework\TestCase
+{
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     * @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
+     */
+    public function validateShouldReturnTrueWhenValidationDontHaveTheClaim()
+    {
+        $claim = new GreaterOrEqualsTo('iss', 10);
+
+        $this->assertTrue($claim->validate(new ValidationData()));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     * @uses Lcobucci\JWT\Claim\Basic::getName
+     * @uses Lcobucci\JWT\Claim\Basic::getValue
+     * @uses Lcobucci\JWT\ValidationData::__construct
+     * @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
+     */
+    public function validateShouldReturnTrueWhenValueIsGreaterThanValidationData()
+    {
+        $claim = new GreaterOrEqualsTo('iss', 11);
+
+        $data = new ValidationData();
+        $data->setIssuer(10);
+
+        $this->assertTrue($claim->validate($data));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     * @uses Lcobucci\JWT\Claim\Basic::getName
+     * @uses Lcobucci\JWT\Claim\Basic::getValue
+     * @uses Lcobucci\JWT\ValidationData::__construct
+     * @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
+     */
+    public function validateShouldReturnTrueWhenValueIsEqualsToValidationData()
+    {
+        $claim = new GreaterOrEqualsTo('iss', 10);
+
+        $data = new ValidationData();
+        $data->setIssuer(10);
+
+        $this->assertTrue($claim->validate($data));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     * @uses Lcobucci\JWT\Claim\Basic::getName
+     * @uses Lcobucci\JWT\Claim\Basic::getValue
+     * @uses Lcobucci\JWT\ValidationData::__construct
+     * @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
+     */
+    public function validateShouldReturnFalseWhenValueIsLesserThanValidationData()
+    {
+        $claim = new GreaterOrEqualsTo('iss', 10);
+
+        $data = new ValidationData();
+        $data->setIssuer(11);
+
+        $this->assertFalse($claim->validate($data));
+    }
+}

+ 107 - 0
api/vendor/lcobucci/jwt/test/unit/Claim/LesserOrEqualsToTest.php

@@ -0,0 +1,107 @@
+<?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\Claim;
+
+use Lcobucci\JWT\ValidationData;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.0.0
+ */
+class LesserOrEqualsToTest extends \PHPUnit\Framework\TestCase
+{
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     * @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
+     */
+    public function validateShouldReturnTrueWhenValidationDontHaveTheClaim()
+    {
+        $claim = new LesserOrEqualsTo('iss', 10);
+
+        $this->assertTrue($claim->validate(new ValidationData()));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     * @uses Lcobucci\JWT\Claim\Basic::getName
+     * @uses Lcobucci\JWT\Claim\Basic::getValue
+     * @uses Lcobucci\JWT\ValidationData::__construct
+     * @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
+     */
+    public function validateShouldReturnTrueWhenValueIsLesserThanValidationData()
+    {
+        $claim = new LesserOrEqualsTo('iss', 10);
+
+        $data = new ValidationData();
+        $data->setIssuer(11);
+
+        $this->assertTrue($claim->validate($data));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     * @uses Lcobucci\JWT\Claim\Basic::getName
+     * @uses Lcobucci\JWT\Claim\Basic::getValue
+     * @uses Lcobucci\JWT\ValidationData::__construct
+     * @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
+     */
+    public function validateShouldReturnTrueWhenValueIsEqualsToValidationData()
+    {
+        $claim = new LesserOrEqualsTo('iss', 10);
+
+        $data = new ValidationData();
+        $data->setIssuer(10);
+
+        $this->assertTrue($claim->validate($data));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Claim\Basic::__construct
+     * @uses Lcobucci\JWT\Claim\Basic::getName
+     * @uses Lcobucci\JWT\Claim\Basic::getValue
+     * @uses Lcobucci\JWT\ValidationData::__construct
+     * @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
+     */
+    public function validateShouldReturnFalseWhenValueIsGreaterThanValidationData()
+    {
+        $claim = new LesserOrEqualsTo('iss', 11);
+
+        $data = new ValidationData();
+        $data->setIssuer(10);
+
+        $this->assertFalse($claim->validate($data));
+    }
+}

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

@@ -0,0 +1,244 @@
+<?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;
+
+use Lcobucci\JWT\Claim\Factory as ClaimFactory;
+use Lcobucci\JWT\Parsing\Decoder;
+use RuntimeException;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ */
+class ParserTest extends \PHPUnit\Framework\TestCase
+{
+    /**
+     * @var Decoder|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $decoder;
+
+    /**
+     * @var ClaimFactory|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $claimFactory;
+
+    /**
+     * @var Claim|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $defaultClaim;
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function setUp()
+    {
+        $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')
+                           ->willReturn($this->defaultClaim);
+    }
+
+    /**
+     * @return Parser
+     */
+    private function createParser()
+    {
+        return new Parser($this->decoder, $this->claimFactory);
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Parser::__construct
+     */
+    public function constructMustConfigureTheAttributes()
+    {
+        $parser = $this->createParser();
+
+        $this->assertAttributeSame($this->decoder, 'decoder', $parser);
+        $this->assertAttributeSame($this->claimFactory, 'claimFactory', $parser);
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Parser::__construct
+     *
+     * @covers Lcobucci\JWT\Parser::parse
+     * @covers Lcobucci\JWT\Parser::splitJwt
+     *
+     * @expectedException InvalidArgumentException
+     */
+    public function parseMustRaiseExceptionWhenJWSIsNotAString()
+    {
+        $parser = $this->createParser();
+        $parser->parse(['asdasd']);
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Parser::__construct
+     *
+     * @covers Lcobucci\JWT\Parser::parse
+     * @covers Lcobucci\JWT\Parser::splitJwt
+     *
+     * @expectedException InvalidArgumentException
+     */
+    public function parseMustRaiseExceptionWhenJWSDontHaveThreeParts()
+    {
+        $parser = $this->createParser();
+        $parser->parse('');
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Parser::__construct
+     *
+     * @covers Lcobucci\JWT\Parser::parse
+     * @covers Lcobucci\JWT\Parser::splitJwt
+     * @covers Lcobucci\JWT\Parser::parseHeader
+     *
+     * @expectedException RuntimeException
+     */
+    public function parseMustRaiseExceptionWhenHeaderCannotBeDecoded()
+    {
+        $this->decoder->expects($this->any())
+                      ->method('jsonDecode')
+                      ->willThrowException(new RuntimeException());
+
+        $parser = $this->createParser();
+        $parser->parse('asdfad.asdfasdf.');
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Parser::__construct
+     *
+     * @covers Lcobucci\JWT\Parser::parse
+     * @covers Lcobucci\JWT\Parser::splitJwt
+     * @covers Lcobucci\JWT\Parser::parseHeader
+     *
+     * @expectedException InvalidArgumentException
+     */
+    public function parseMustRaiseExceptionWhenHeaderIsFromAnEncryptedToken()
+    {
+        $this->decoder->expects($this->any())
+                      ->method('jsonDecode')
+                      ->willReturn(['enc' => 'AAA']);
+
+        $parser = $this->createParser();
+        $parser->parse('a.a.');
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Parser::__construct
+     * @uses Lcobucci\JWT\Token::__construct
+     *
+     * @covers Lcobucci\JWT\Parser::parse
+     * @covers Lcobucci\JWT\Parser::splitJwt
+     * @covers Lcobucci\JWT\Parser::parseHeader
+     * @covers Lcobucci\JWT\Parser::parseClaims
+     * @covers Lcobucci\JWT\Parser::parseSignature
+     *
+     */
+    public function parseMustReturnANonSignedTokenWhenSignatureIsNotInformed()
+    {
+        $this->decoder->expects($this->at(1))
+                      ->method('jsonDecode')
+                      ->willReturn(['typ' => 'JWT', 'alg' => 'none']);
+
+        $this->decoder->expects($this->at(3))
+                      ->method('jsonDecode')
+                      ->willReturn(['aud' => 'test']);
+
+        $parser = $this->createParser();
+        $token = $parser->parse('a.a.');
+
+        $this->assertAttributeEquals(['typ' => 'JWT', 'alg' => 'none'], 'headers', $token);
+        $this->assertAttributeEquals(['aud' => $this->defaultClaim], 'claims', $token);
+        $this->assertAttributeEquals(null, 'signature', $token);
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Parser::__construct
+     * @uses Lcobucci\JWT\Token::__construct
+     *
+     * @covers Lcobucci\JWT\Parser::parse
+     * @covers Lcobucci\JWT\Parser::splitJwt
+     * @covers Lcobucci\JWT\Parser::parseHeader
+     * @covers Lcobucci\JWT\Parser::parseClaims
+     * @covers Lcobucci\JWT\Parser::parseSignature
+     */
+    public function parseShouldReplicateClaimValueOnHeaderWhenNeeded()
+    {
+        $this->decoder->expects($this->at(1))
+                      ->method('jsonDecode')
+                      ->willReturn(['typ' => 'JWT', 'alg' => 'none', 'aud' => 'test']);
+
+        $this->decoder->expects($this->at(3))
+                      ->method('jsonDecode')
+                      ->willReturn(['aud' => 'test']);
+
+        $parser = $this->createParser();
+        $token = $parser->parse('a.a.');
+
+        $this->assertAttributeEquals(
+            ['typ' => 'JWT', 'alg' => 'none', 'aud' => $this->defaultClaim],
+            'headers',
+            $token
+        );
+
+        $this->assertAttributeEquals(['aud' => $this->defaultClaim], 'claims', $token);
+        $this->assertAttributeEquals(null, 'signature', $token);
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Parser::__construct
+     * @uses Lcobucci\JWT\Token::__construct
+     * @uses Lcobucci\JWT\Signature::__construct
+     *
+     * @covers Lcobucci\JWT\Parser::parse
+     * @covers Lcobucci\JWT\Parser::splitJwt
+     * @covers Lcobucci\JWT\Parser::parseHeader
+     * @covers Lcobucci\JWT\Parser::parseClaims
+     * @covers Lcobucci\JWT\Parser::parseSignature
+     */
+    public function parseMustReturnASignedTokenWhenSignatureIsInformed()
+    {
+        $this->decoder->expects($this->at(1))
+                      ->method('jsonDecode')
+                      ->willReturn(['typ' => 'JWT', 'alg' => 'HS256']);
+
+        $this->decoder->expects($this->at(3))
+                      ->method('jsonDecode')
+                      ->willReturn(['aud' => 'test']);
+
+        $this->decoder->expects($this->at(4))
+                      ->method('base64UrlDecode')
+                      ->willReturn('aaa');
+
+        $parser = $this->createParser();
+        $token = $parser->parse('a.a.a');
+
+        $this->assertAttributeEquals(['typ' => 'JWT', 'alg' => 'HS256'], 'headers', $token);
+        $this->assertAttributeEquals(['aud' => $this->defaultClaim], 'claims', $token);
+        $this->assertAttributeEquals(new Signature('aaa'), 'signature', $token);
+    }
+}

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

@@ -0,0 +1,56 @@
+<?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\Parsing;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ */
+class DecoderTest extends \PHPUnit\Framework\TestCase
+{
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Parsing\Decoder::jsonDecode
+     */
+    public function jsonDecodeMustReturnTheDecodedData()
+    {
+        $decoder = new Decoder();
+
+        $this->assertEquals(
+            (object) ['test' => 'test'],
+            $decoder->jsonDecode('{"test":"test"}')
+        );
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Parsing\Decoder::jsonDecode
+     *
+     * @expectedException \RuntimeException
+     */
+    public function jsonDecodeMustRaiseExceptionWhenAnErrorHasOccured()
+    {
+        $decoder = new Decoder();
+        $decoder->jsonDecode('{"test":\'test\'}');
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Parsing\Decoder::base64UrlDecode
+     */
+    public function base64UrlDecodeMustReturnTheRightData()
+    {
+        $data = base64_decode('0MB2wKB+L3yvIdzeggmJ+5WOSLaRLTUPXbpzqUe0yuo=');
+
+        $decoder = new Decoder();
+        $this->assertEquals($data, $decoder->base64UrlDecode('0MB2wKB-L3yvIdzeggmJ-5WOSLaRLTUPXbpzqUe0yuo'));
+    }
+}

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

@@ -0,0 +1,53 @@
+<?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\Parsing;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ */
+class EncoderTest extends \PHPUnit\Framework\TestCase
+{
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Parsing\Encoder::jsonEncode
+     */
+    public function jsonEncodeMustReturnAJSONString()
+    {
+        $encoder = new Encoder();
+
+        $this->assertEquals('{"test":"test"}', $encoder->jsonEncode(['test' => 'test']));
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Parsing\Encoder::jsonEncode
+     *
+     * @expectedException \RuntimeException
+     */
+    public function jsonEncodeMustRaiseExceptionWhenAnErrorHasOccured()
+    {
+        $encoder = new Encoder();
+        $encoder->jsonEncode("\xB1\x31");
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Parsing\Encoder::base64UrlEncode
+     */
+    public function base64UrlEncodeMustReturnAnUrlSafeBase64()
+    {
+        $data = base64_decode('0MB2wKB+L3yvIdzeggmJ+5WOSLaRLTUPXbpzqUe0yuo=');
+
+        $encoder = new Encoder();
+        $this->assertEquals('0MB2wKB-L3yvIdzeggmJ-5WOSLaRLTUPXbpzqUe0yuo', $encoder->base64UrlEncode($data));
+    }
+}

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

@@ -0,0 +1,73 @@
+<?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;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ */
+class SignatureTest extends \PHPUnit\Framework\TestCase
+{
+    /**
+     * @var Signer|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $signer;
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function setUp()
+    {
+        $this->signer = $this->createMock(Signer::class);
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Signature::__construct
+     */
+    public function constructorMustConfigureAttributes()
+    {
+        $signature = new Signature('test');
+
+        $this->assertAttributeEquals('test', 'hash', $signature);
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Signature::__construct
+     *
+     * @covers Lcobucci\JWT\Signature::__toString
+     */
+    public function toStringMustReturnTheHash()
+    {
+        $signature = new Signature('test');
+
+        $this->assertEquals('test', (string) $signature);
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Signature::__construct
+     * @uses Lcobucci\JWT\Signature::__toString
+     *
+     * @covers Lcobucci\JWT\Signature::verify
+     */
+    public function verifyMustReturnWhatSignerSays()
+    {
+        $this->signer->expects($this->any())
+                     ->method('verify')
+                     ->willReturn(true);
+
+        $signature = new Signature('test');
+
+        $this->assertTrue($signature->verify($this->signer, 'one', 'key'));
+    }
+}

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

@@ -0,0 +1,128 @@
+<?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;
+
+use Lcobucci\JWT\Signature;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ */
+class BaseSignerTest extends \PHPUnit\Framework\TestCase
+{
+    /**
+     * @var BaseSigner|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $signer;
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function setUp()
+    {
+        $this->signer = $this->getMockForAbstractClass(BaseSigner::class);
+
+        $this->signer->method('getAlgorithmId')
+                     ->willReturn('TEST123');
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Signer\BaseSigner::modifyHeader
+     */
+    public function modifyHeaderShouldChangeAlgorithm()
+    {
+        $headers = ['typ' => 'JWT'];
+
+        $this->signer->modifyHeader($headers);
+
+        $this->assertEquals($headers['typ'], 'JWT');
+        $this->assertEquals($headers['alg'], 'TEST123');
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Signature::__construct
+     * @uses Lcobucci\JWT\Signer\Key
+     *
+     * @covers Lcobucci\JWT\Signer\BaseSigner::sign
+     * @covers Lcobucci\JWT\Signer\BaseSigner::getKey
+     */
+    public function signMustReturnANewSignature()
+    {
+        $key = new Key('123');
+
+        $this->signer->expects($this->once())
+                     ->method('createHash')
+                     ->with('test', $key)
+                     ->willReturn('test');
+
+        $this->assertEquals(new Signature('test'), $this->signer->sign('test', $key));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Signature::__construct
+     * @uses Lcobucci\JWT\Signer\Key
+     *
+     * @covers Lcobucci\JWT\Signer\BaseSigner::sign
+     * @covers Lcobucci\JWT\Signer\BaseSigner::getKey
+     */
+    public function signShouldConvertKeyWhenItsNotAnObject()
+    {
+        $this->signer->expects($this->once())
+                     ->method('createHash')
+                     ->with('test', new Key('123'))
+                     ->willReturn('test');
+
+        $this->assertEquals(new Signature('test'), $this->signer->sign('test', '123'));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Signature::__construct
+     * @uses Lcobucci\JWT\Signer\Key
+     *
+     * @covers Lcobucci\JWT\Signer\BaseSigner::verify
+     * @covers Lcobucci\JWT\Signer\BaseSigner::getKey
+     */
+    public function verifyShouldDelegateTheCallToAbstractMethod()
+    {
+        $key = new Key('123');
+
+        $this->signer->expects($this->once())
+                     ->method('doVerify')
+                     ->with('test', 'test', $key)
+                     ->willReturn(true);
+
+        $this->assertTrue($this->signer->verify('test', 'test', $key));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Signature::__construct
+     * @uses Lcobucci\JWT\Signer\Key
+     *
+     * @covers Lcobucci\JWT\Signer\BaseSigner::verify
+     * @covers Lcobucci\JWT\Signer\BaseSigner::getKey
+     */
+    public function verifyShouldConvertKeyWhenItsNotAnObject()
+    {
+        $this->signer->expects($this->once())
+                     ->method('doVerify')
+                     ->with('test', 'test', new Key('123'))
+                     ->willReturn(true);
+
+        $this->assertTrue($this->signer->verify('test', 'test', '123'));
+    }
+}

+ 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'],
+        ];
+    }
+}

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

@@ -0,0 +1,60 @@
+<?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;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.1.0
+ */
+class Sha256Test extends \PHPUnit\Framework\TestCase
+{
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Signer\Ecdsa
+     * @uses Lcobucci\JWT\Signer\OpenSSL
+     *
+     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256::getAlgorithmId
+     */
+    public function getAlgorithmIdMustBeCorrect()
+    {
+        $signer = new Sha256();
+
+        $this->assertEquals('ES256', $signer->getAlgorithmId());
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Signer\Ecdsa
+     * @uses Lcobucci\JWT\Signer\OpenSSL
+     *
+     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256::getAlgorithm
+     */
+    public function getAlgorithmMustBeCorrect()
+    {
+        $signer = new Sha256();
+
+        $this->assertEquals('sha256', $signer->getAlgorithm());
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Signer\Ecdsa
+     * @uses Lcobucci\JWT\Signer\OpenSSL
+     *
+     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256::getKeyLength
+     */
+    public function getKeyLengthMustBeCorrect()
+    {
+        $signer = new Sha256();
+
+        $this->assertEquals(64, $signer->getKeyLength());
+    }
+}

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

@@ -0,0 +1,60 @@
+<?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;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.1.0
+ */
+class Sha384Test extends \PHPUnit\Framework\TestCase
+{
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Signer\Ecdsa
+     * @uses Lcobucci\JWT\Signer\OpenSSL
+     *
+     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha384::getAlgorithmId
+     */
+    public function getAlgorithmIdMustBeCorrect()
+    {
+        $signer = new Sha384();
+
+        $this->assertEquals('ES384', $signer->getAlgorithmId());
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Signer\Ecdsa
+     * @uses Lcobucci\JWT\Signer\OpenSSL
+     *
+     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha384::getAlgorithm
+     */
+    public function getAlgorithmMustBeCorrect()
+    {
+        $signer = new Sha384();
+
+        $this->assertEquals('sha384', $signer->getAlgorithm());
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Signer\Ecdsa
+     * @uses Lcobucci\JWT\Signer\OpenSSL
+     *
+     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha384::getKeyLength
+     */
+    public function getKeyLengthMustBeCorrect()
+    {
+        $signer = new Sha384();
+
+        $this->assertEquals(96, $signer->getKeyLength());
+    }
+}

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

@@ -0,0 +1,60 @@
+<?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;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.1.0
+ */
+class Sha512Test extends \PHPUnit\Framework\TestCase
+{
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Signer\Ecdsa
+     * @uses Lcobucci\JWT\Signer\OpenSSL
+     *
+     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha512::getAlgorithmId
+     */
+    public function getAlgorithmIdMustBeCorrect()
+    {
+        $signer = new Sha512();
+
+        $this->assertEquals('ES512', $signer->getAlgorithmId());
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Signer\Ecdsa
+     * @uses Lcobucci\JWT\Signer\OpenSSL
+     *
+     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha512::getAlgorithm
+     */
+    public function getAlgorithmMustBeCorrect()
+    {
+        $signer = new Sha512();
+
+        $this->assertEquals('sha512', $signer->getAlgorithm());
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Signer\Ecdsa
+     * @uses Lcobucci\JWT\Signer\OpenSSL
+     *
+     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha512::getKeyLength
+     */
+    public function getKeyLengthMustBeCorrect()
+    {
+        $signer = new Sha512();
+
+        $this->assertEquals(132, $signer->getKeyLength());
+    }
+}

+ 117 - 0
api/vendor/lcobucci/jwt/test/unit/Signer/EcdsaTest.php

@@ -0,0 +1,117 @@
+<?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;
+
+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
+{
+    use Keys;
+
+    /**
+     * @var MultibyteStringConverter
+     */
+    private $pointsManipulator;
+
+    /**
+     * @before
+     */
+    public function createDependencies()
+    {
+        $this->pointsManipulator = new MultibyteStringConverter();
+    }
+
+    private function getSigner()
+    {
+        $signer = $this->getMockForAbstractClass(Ecdsa::class, [$this->pointsManipulator]);
+
+        $signer->method('getAlgorithm')
+            ->willReturn(OPENSSL_ALGO_SHA256);
+
+        $signer->method('getAlgorithmId')
+            ->willReturn('ES256');
+
+        $signer->method('getKeyLength')
+            ->willReturn(64);
+
+        return $signer;
+    }
+
+    /**
+     * @test
+     *
+     * @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
+     *
+     * @uses \Lcobucci\JWT\Signer\Ecdsa::__construct
+     * @uses \Lcobucci\JWT\Signer\Key
+     * @uses \Lcobucci\JWT\Signature
+     */
+    public function createHashShouldReturnTheAHashBasedOnTheOpenSslSignature()
+    {
+        $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
+     *
+     * @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
+     *
+     * @uses \Lcobucci\JWT\Signer\Ecdsa::__construct
+     * @uses \Lcobucci\JWT\Signer\Key
+     */
+    public function doVerifyShouldDelegateToEcdsaSignerUsingPublicKey()
+    {
+        $payload    = 'testing';
+        $privateKey = openssl_pkey_get_private(self::$ecdsaKeys['private']->getContent());
+
+        self::assertInternalType('resource', $privateKey);
+
+        $signature = '';
+        openssl_sign($payload, $signature, $privateKey, OPENSSL_ALGO_SHA256);
+
+        $signer = $this->getSigner();
+
+        self::assertTrue(
+            $signer->verify(
+                $this->pointsManipulator->fromAsn1($signature, $signer->getKeyLength()),
+                $payload,
+                self::$ecdsaKeys['public1']
+            )
+        );
+    }
+}

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

@@ -0,0 +1,39 @@
+<?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\Hmac;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ */
+class Sha256Test extends \PHPUnit\Framework\TestCase
+{
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Signer\Hmac\Sha256::getAlgorithmId
+     */
+    public function getAlgorithmIdMustBeCorrect()
+    {
+        $signer = new Sha256();
+
+        $this->assertEquals('HS256', $signer->getAlgorithmId());
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Signer\Hmac\Sha256::getAlgorithm
+     */
+    public function getAlgorithmMustBeCorrect()
+    {
+        $signer = new Sha256();
+
+        $this->assertEquals('sha256', $signer->getAlgorithm());
+    }
+}

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

@@ -0,0 +1,39 @@
+<?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\Hmac;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ */
+class Sha384Test extends \PHPUnit\Framework\TestCase
+{
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Signer\Hmac\Sha384::getAlgorithmId
+     */
+    public function getAlgorithmIdMustBeCorrect()
+    {
+        $signer = new Sha384();
+
+        $this->assertEquals('HS384', $signer->getAlgorithmId());
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Signer\Hmac\Sha384::getAlgorithm
+     */
+    public function getAlgorithmMustBeCorrect()
+    {
+        $signer = new Sha384();
+
+        $this->assertEquals('sha384', $signer->getAlgorithm());
+    }
+}

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

@@ -0,0 +1,39 @@
+<?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\Hmac;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ */
+class Sha512Test extends \PHPUnit\Framework\TestCase
+{
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Signer\Hmac\Sha512::getAlgorithmId
+     */
+    public function getAlgorithmIdMustBeCorrect()
+    {
+        $signer = new Sha512();
+
+        $this->assertEquals('HS512', $signer->getAlgorithmId());
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Signer\Hmac\Sha512::getAlgorithm
+     */
+    public function getAlgorithmMustBeCorrect()
+    {
+        $signer = new Sha512();
+
+        $this->assertEquals('sha512', $signer->getAlgorithm());
+    }
+}

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

@@ -0,0 +1,134 @@
+<?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;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ */
+class HmacTest extends \PHPUnit\Framework\TestCase
+{
+    /**
+     * @var Hmac|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $signer;
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function setUp()
+    {
+        $this->signer = $this->getMockForAbstractClass(Hmac::class);
+
+        $this->signer->expects($this->any())
+                     ->method('getAlgorithmId')
+                     ->willReturn('TEST123');
+
+        $this->signer->expects($this->any())
+                     ->method('getAlgorithm')
+                     ->willReturn('sha256');
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Signer\Key
+     *
+     * @covers Lcobucci\JWT\Signer\Hmac::createHash
+     */
+    public function createHashMustReturnAHashAccordingWithTheAlgorithm()
+    {
+        $hash = hash_hmac('sha256', 'test', '123', true);
+
+        $this->assertEquals($hash, $this->signer->createHash('test', new Key('123')));
+
+        return $hash;
+    }
+
+    /**
+     * @test
+     *
+     * @depends createHashMustReturnAHashAccordingWithTheAlgorithm
+     *
+     * @uses Lcobucci\JWT\Signer\Hmac::createHash
+     * @uses Lcobucci\JWT\Signer\Key
+     *
+     * @covers Lcobucci\JWT\Signer\Hmac::doVerify
+     */
+    public function doVerifyShouldReturnTrueWhenExpectedHashWasCreatedWithSameInformation($expected)
+    {
+        $this->assertTrue($this->signer->doVerify($expected, 'test', new Key('123')));
+    }
+
+    /**
+     * @test
+     *
+     * @depends createHashMustReturnAHashAccordingWithTheAlgorithm
+     *
+     * @uses Lcobucci\JWT\Signer\Hmac::createHash
+     * @uses Lcobucci\JWT\Signer\Key
+     *
+     * @covers Lcobucci\JWT\Signer\Hmac::doVerify
+     */
+    public function doVerifyShouldReturnFalseWhenExpectedHashWasNotCreatedWithSameInformation($expected)
+    {
+        $this->assertFalse($this->signer->doVerify($expected, 'test', new Key('1234')));
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Signer\Key
+     *
+     * @covers Lcobucci\JWT\Signer\Hmac::doVerify
+     */
+    public function doVerifyShouldReturnFalseWhenExpectedHashIsNotString()
+    {
+        $this->assertFalse($this->signer->doVerify(false, 'test', new Key('1234')));
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Signer\Hmac::hashEquals
+     */
+    public function hashEqualsShouldReturnFalseWhenExpectedHashHasDifferentLengthThanGenerated()
+    {
+        $this->assertFalse($this->signer->hashEquals('123', '1234'));
+    }
+
+    /**
+     * @test
+     *
+     * @depends createHashMustReturnAHashAccordingWithTheAlgorithm
+     *
+     * @uses Lcobucci\JWT\Signer\Hmac::createHash
+     * @uses Lcobucci\JWT\Signer\Key
+     *
+     * @covers Lcobucci\JWT\Signer\Hmac::hashEquals
+     */
+    public function hashEqualsShouldReturnFalseWhenExpectedHashIsDifferentThanGenerated($expected)
+    {
+        $this->assertFalse($this->signer->hashEquals($expected, $this->signer->createHash('test', new Key('1234'))));
+    }
+
+    /**
+     * @test
+     *
+     * @depends createHashMustReturnAHashAccordingWithTheAlgorithm
+     *
+     * @uses Lcobucci\JWT\Signer\Hmac::createHash
+     * @uses Lcobucci\JWT\Signer\Key
+     *
+     * @covers Lcobucci\JWT\Signer\Hmac::hashEquals
+     */
+    public function hashEqualsShouldReturnTrueWhenExpectedHashIsEqualsThanGenerated($expected)
+    {
+        $this->assertTrue($this->signer->hashEquals($expected, $this->signer->createHash('test', new Key('123'))));
+    }
+}

+ 119 - 0
api/vendor/lcobucci/jwt/test/unit/Signer/KeyTest.php

@@ -0,0 +1,119 @@
+<?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;
+
+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
+{
+    /**
+     * @before
+     */
+    public function configureRootDir()
+    {
+        vfsStream::setup(
+            'root',
+            null,
+            [
+                'test.pem' => 'testing',
+                'emptyFolder' => []
+            ]
+        );
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Signer\Key::__construct
+     * @covers Lcobucci\JWT\Signer\Key::setContent
+     */
+    public function constructShouldConfigureContentAndPassphrase()
+    {
+        $key = new Key('testing', 'test');
+
+        $this->assertAttributeEquals('testing', 'content', $key);
+        $this->assertAttributeEquals('test', 'passphrase', $key);
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Signer\Key::__construct
+     * @covers Lcobucci\JWT\Signer\Key::setContent
+     * @covers Lcobucci\JWT\Signer\Key::readFile
+     */
+    public function constructShouldBeAbleToConfigureContentFromFile()
+    {
+        $key = new Key('file://' . vfsStream::url('root/test.pem'));
+
+        $this->assertAttributeEquals('testing', 'content', $key);
+        $this->assertAttributeEquals(null, 'passphrase', $key);
+    }
+
+    /**
+     * @test
+     *
+     * @expectedException \InvalidArgumentException
+     *
+     * @covers Lcobucci\JWT\Signer\Key::__construct
+     * @covers Lcobucci\JWT\Signer\Key::setContent
+     * @covers Lcobucci\JWT\Signer\Key::readFile
+     */
+    public function constructShouldRaiseExceptionWhenFileDoesNotExists()
+    {
+        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
+     *
+     * @uses Lcobucci\JWT\Signer\Key::__construct
+     * @uses Lcobucci\JWT\Signer\Key::setContent
+     *
+     * @covers Lcobucci\JWT\Signer\Key::getContent
+     */
+    public function getContentShouldReturnConfiguredData()
+    {
+        $key = new Key('testing', 'test');
+
+        $this->assertEquals('testing', $key->getContent());
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Signer\Key::__construct
+     * @uses Lcobucci\JWT\Signer\Key::setContent
+     *
+     * @covers Lcobucci\JWT\Signer\Key::getPassphrase
+     */
+    public function getPassphraseShouldReturnConfiguredData()
+    {
+        $key = new Key('testing', 'test');
+
+        $this->assertEquals('test', $key->getPassphrase());
+    }
+}

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

@@ -0,0 +1,49 @@
+<?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;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.1.0
+ */
+class KeychainTest extends \PHPUnit\Framework\TestCase
+{
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Signer\Key
+     *
+     * @covers Lcobucci\JWT\Signer\Keychain::getPrivateKey
+     */
+    public function getPrivateKeyShouldReturnAKey()
+    {
+        $keychain = new Keychain();
+        $key = $keychain->getPrivateKey('testing', 'test');
+
+        $this->assertInstanceOf(Key::class, $key);
+        $this->assertAttributeEquals('testing', 'content', $key);
+        $this->assertAttributeEquals('test', 'passphrase', $key);
+    }
+
+    /**
+     * @test
+     *
+     * @uses Lcobucci\JWT\Signer\Key
+     *
+     * @covers Lcobucci\JWT\Signer\Keychain::getPublicKey
+     */
+    public function getPublicKeyShouldReturnAValidResource()
+    {
+        $keychain = new Keychain();
+        $key = $keychain->getPublicKey('testing');
+
+        $this->assertInstanceOf(Key::class, $key);
+        $this->assertAttributeEquals('testing', 'content', $key);
+        $this->assertAttributeEquals(null, 'passphrase', $key);
+    }
+}

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

@@ -0,0 +1,39 @@
+<?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\Rsa;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.1.0
+ */
+class Sha256Test extends \PHPUnit\Framework\TestCase
+{
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Signer\Rsa\Sha256::getAlgorithmId
+     */
+    public function getAlgorithmIdMustBeCorrect()
+    {
+        $signer = new Sha256();
+
+        $this->assertEquals('RS256', $signer->getAlgorithmId());
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Signer\Rsa\Sha256::getAlgorithm
+     */
+    public function getAlgorithmMustBeCorrect()
+    {
+        $signer = new Sha256();
+
+        $this->assertEquals(OPENSSL_ALGO_SHA256, $signer->getAlgorithm());
+    }
+}

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

@@ -0,0 +1,39 @@
+<?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\Rsa;
+
+/**
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.1.0
+ */
+class Sha384Test extends \PHPUnit\Framework\TestCase
+{
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Signer\Rsa\Sha384::getAlgorithmId
+     */
+    public function getAlgorithmIdMustBeCorrect()
+    {
+        $signer = new Sha384();
+
+        $this->assertEquals('RS384', $signer->getAlgorithmId());
+    }
+
+    /**
+     * @test
+     *
+     * @covers Lcobucci\JWT\Signer\Rsa\Sha384::getAlgorithm
+     */
+    public function getAlgorithmMustBeCorrect()
+    {
+        $signer = new Sha384();
+
+        $this->assertEquals(OPENSSL_ALGO_SHA384, $signer->getAlgorithm());
+    }
+}

Some files were not shown because too many files changed in this diff