caviar 3 years ago
parent
commit
d6d27d3ac5
100 changed files with 6568 additions and 217 deletions
  1. 10 2
      app/admin/controller/Activity.php
  2. 7 0
      app/admin/controller/Admin.php
  3. 17 0
      app/admin/controller/Config.php
  4. 26 8
      app/admin/controller/Customer.php
  5. 53 0
      app/admin/controller/Order.php
  6. 2 0
      app/admin/lang/zh-cn.php
  7. 1 1
      app/admin/middleware.php
  8. 9 5
      app/admin/view/activity/edit.html
  9. 29 48
      app/admin/view/config/index.html
  10. 59 19
      app/admin/view/customer/add.html
  11. 58 12
      app/admin/view/customer/edit.html
  12. 5 3
      app/admin/view/customer/index.html
  13. 6 0
      app/admin/view/order/index.html
  14. 0 1
      app/admin/view/user/edit.html
  15. 4 0
      app/common/model/AdminModel.php
  16. 15 0
      app/common/model/ConfigModel.php
  17. 13 0
      app/common/model/OrderModel.php
  18. 2 1
      composer.json
  19. 83 115
      composer.lock
  20. BIN
      public/order.xlsx
  21. 2 0
      public/static/js/common.js
  22. 0 2
      vendor/.gitignore
  23. 7 0
      vendor/autoload.php
  24. 1 0
      vendor/bin/var-dump-server
  25. 445 0
      vendor/composer/ClassLoader.php
  26. 21 0
      vendor/composer/LICENSE
  27. 14 0
      vendor/composer/autoload_classmap.php
  28. 18 0
      vendor/composer/autoload_files.php
  29. 11 0
      vendor/composer/autoload_namespaces.php
  30. 27 0
      vendor/composer/autoload_psr4.php
  31. 73 0
      vendor/composer/autoload_real.php
  32. 169 0
      vendor/composer/autoload_static.php
  33. 1364 0
      vendor/composer/installed.json
  34. 27 0
      vendor/lcobucci/jwt/LICENSE
  35. 4 0
      vendor/lcobucci/jwt/compat/class-aliases.php
  36. 7 0
      vendor/lcobucci/jwt/compat/json-exception-polyfill.php
  37. 70 0
      vendor/lcobucci/jwt/compat/lcobucci-clock-polyfill.php
  38. 57 0
      vendor/lcobucci/jwt/composer.json
  39. 592 0
      vendor/lcobucci/jwt/src/Builder.php
  40. 40 0
      vendor/lcobucci/jwt/src/Claim.php
  41. 75 0
      vendor/lcobucci/jwt/src/Claim/Basic.php
  42. 34 0
      vendor/lcobucci/jwt/src/Claim/EqualsTo.php
  43. 131 0
      vendor/lcobucci/jwt/src/Claim/Factory.php
  44. 34 0
      vendor/lcobucci/jwt/src/Claim/GreaterOrEqualsTo.php
  45. 34 0
      vendor/lcobucci/jwt/src/Claim/LesserOrEqualsTo.php
  46. 30 0
      vendor/lcobucci/jwt/src/Claim/Validatable.php
  47. 178 0
      vendor/lcobucci/jwt/src/Configuration.php
  48. 26 0
      vendor/lcobucci/jwt/src/Encoding/CannotDecodeContent.php
  49. 20 0
      vendor/lcobucci/jwt/src/Encoding/CannotEncodeContent.php
  50. 13 0
      vendor/lcobucci/jwt/src/Exception.php
  51. 175 0
      vendor/lcobucci/jwt/src/Parser.php
  52. 70 0
      vendor/lcobucci/jwt/src/Parsing/Decoder.php
  53. 65 0
      vendor/lcobucci/jwt/src/Parsing/Encoder.php
  54. 87 0
      vendor/lcobucci/jwt/src/Signature.php
  55. 59 0
      vendor/lcobucci/jwt/src/Signer.php
  56. 89 0
      vendor/lcobucci/jwt/src/Signer/BaseSigner.php
  57. 19 0
      vendor/lcobucci/jwt/src/Signer/CannotSignPayload.php
  58. 69 0
      vendor/lcobucci/jwt/src/Signer/Ecdsa.php
  59. 27 0
      vendor/lcobucci/jwt/src/Signer/Ecdsa/ConversionFailed.php
  60. 133 0
      vendor/lcobucci/jwt/src/Signer/Ecdsa/MultibyteStringConverter.php
  61. 43 0
      vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha256.php
  62. 43 0
      vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha384.php
  63. 43 0
      vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha512.php
  64. 38 0
      vendor/lcobucci/jwt/src/Signer/Ecdsa/SignatureConverter.php
  65. 46 0
      vendor/lcobucci/jwt/src/Signer/Hmac.php
  66. 35 0
      vendor/lcobucci/jwt/src/Signer/Hmac/Sha256.php
  67. 35 0
      vendor/lcobucci/jwt/src/Signer/Hmac/Sha384.php
  68. 35 0
      vendor/lcobucci/jwt/src/Signer/Hmac/Sha512.php
  69. 25 0
      vendor/lcobucci/jwt/src/Signer/InvalidKeyProvided.php
  70. 117 0
      vendor/lcobucci/jwt/src/Signer/Key.php
  71. 39 0
      vendor/lcobucci/jwt/src/Signer/Key/FileCouldNotBeRead.php
  72. 52 0
      vendor/lcobucci/jwt/src/Signer/Key/InMemory.php
  73. 32 0
      vendor/lcobucci/jwt/src/Signer/Key/LocalFileReference.php
  74. 44 0
      vendor/lcobucci/jwt/src/Signer/Keychain.php
  75. 21 0
      vendor/lcobucci/jwt/src/Signer/None.php
  76. 108 0
      vendor/lcobucci/jwt/src/Signer/OpenSSL.php
  77. 24 0
      vendor/lcobucci/jwt/src/Signer/Rsa.php
  78. 35 0
      vendor/lcobucci/jwt/src/Signer/Rsa/Sha256.php
  79. 35 0
      vendor/lcobucci/jwt/src/Signer/Rsa/Sha384.php
  80. 35 0
      vendor/lcobucci/jwt/src/Signer/Rsa/Sha512.php
  81. 430 0
      vendor/lcobucci/jwt/src/Token.php
  82. 56 0
      vendor/lcobucci/jwt/src/Token/DataSet.php
  83. 35 0
      vendor/lcobucci/jwt/src/Token/InvalidTokenStructure.php
  84. 8 0
      vendor/lcobucci/jwt/src/Token/Plain.php
  85. 24 0
      vendor/lcobucci/jwt/src/Token/RegisteredClaimGiven.php
  86. 76 0
      vendor/lcobucci/jwt/src/Token/RegisteredClaims.php
  87. 8 0
      vendor/lcobucci/jwt/src/Token/Signature.php
  88. 15 0
      vendor/lcobucci/jwt/src/Token/UnsupportedHeaderFound.php
  89. 11 0
      vendor/lcobucci/jwt/src/Validation/Constraint.php
  90. 28 0
      vendor/lcobucci/jwt/src/Validation/Constraint/IdentifiedBy.php
  91. 28 0
      vendor/lcobucci/jwt/src/Validation/Constraint/IssuedBy.php
  92. 15 0
      vendor/lcobucci/jwt/src/Validation/Constraint/LeewayCannotBeNegative.php
  93. 27 0
      vendor/lcobucci/jwt/src/Validation/Constraint/PermittedFor.php
  94. 27 0
      vendor/lcobucci/jwt/src/Validation/Constraint/RelatedTo.php
  95. 34 0
      vendor/lcobucci/jwt/src/Validation/Constraint/SignedWith.php
  96. 72 0
      vendor/lcobucci/jwt/src/Validation/Constraint/ValidAt.php
  97. 10 0
      vendor/lcobucci/jwt/src/Validation/ConstraintViolation.php
  98. 10 0
      vendor/lcobucci/jwt/src/Validation/NoConstraintsGiven.php
  99. 53 0
      vendor/lcobucci/jwt/src/Validation/RequiredConstraintsViolated.php
  100. 0 0
      vendor/lcobucci/jwt/src/Validation/Validator.php

+ 10 - 2
app/admin/controller/Activity.php

@@ -86,6 +86,14 @@ class Activity extends BaseController
         return $this->fail(lang("Fail"));
     }
 
+    public function delete(\think\Request $request) {
+        $params = $request->param();
+        if(!isset($params['ids']))
+            return $this->fail(lang("Please select the data you want to delete"));
+        $this->activityModel->deleteByIds(explode(',', $params['ids']));
+        return $this->ok(true);
+    }
+
     public function delete_relation() {
         $params = $this->request->param();
         if(isset($params['id'])) {
@@ -96,12 +104,12 @@ class Activity extends BaseController
 
     public function add_relation() {
         $params = $this->request->param();
-        if(isset($params['id'])) {
+        if(isset($params['product_id'])) {
             $relation = $this->activityProductModel->doesItExist($params['product_id']);
             if($relation && $relation->id != $params['id'])
                 return $this->fail("Fail to add. Data duplication");
             $this->activityProductModel->save([
-                'activity_id' => $relation->id,
+                'activity_id' => $params['activity_id'],
                 'product_id' => $params['product_id'],
                 'type' => $params['type'],
                 'discount' => $params['discount'],

+ 7 - 0
app/admin/controller/Admin.php

@@ -174,6 +174,13 @@ class Admin extends BaseController
         return view();
     }
 
+    public function findAdmins(Request $request) {
+        $params = $request->param();
+        if(!isset($params['text']))
+            return $this->fail(lang('Data not exist'));
+        return $this->ok($this->model->findAdmins($params['text']));
+    }
+
 }
 
 

+ 17 - 0
app/admin/controller/Config.php

@@ -5,11 +5,28 @@ namespace app\admin\controller;
 
 
 use app\BaseController;
+use app\common\model\ConfigModel;
+use think\App;
+use think\facade\View;
 
 class Config extends BaseController
 {
 
+    private $model;
+
+    public function __construct(App $app)
+    {
+        $this->model = new ConfigModel();
+        parent::__construct($app);
+    }
+
     public function index() {
+        $config = $this->model->findById(1);
+        if ($this->request->isAjax()) {
+           $this->model->where('id', 1)->update($this->request->param());
+           return $this->ok(true);
+        }
+        View::assign('config', $config);
         return view();
     }
 

+ 26 - 8
app/admin/controller/Customer.php

@@ -38,8 +38,10 @@ class Customer extends BaseController
             'name_en' => format_string($params['name_en'] ?? null),
             'mobile' => format_string($params['mobile'] ?? null),
         ];
+        $list = $this->customerModel->findByPaginate($format_params);
+        foreach ($list as &$item) $item['sex_str'] = ['',lang("Man"), lang("Woman"),lang("Unknown")][$item->sex];
         View::assign([
-            'list' => $this->customerModel->findByPaginate($format_params),
+            'list' => $list,
             'params' => $format_params
         ]);
         return view();
@@ -61,9 +63,17 @@ class Customer extends BaseController
             $admin = $this->adminModel->findById($params['follow_user_id']);
             if (!$admin)
                 return $this->fail(lang("The employees dont exist"));
+            $store_id = explode(",", $admin->store_ids ?? '-1')[0];
+            if (!($store_id > 0))
+                return $this->fail(lang("The employee is not bound to a store"));
+            $store = $this->storeModel->findById($store_id);
+            if(!$store)
+                return $this->fail(lang("Stores do not exist"));
+            $params['store_id'] = $store->id;
+            $params['store_abbr'] = $store->abbr;
             $params['follow_username'] = $admin->nickname;
-            $params['store_id'] = explode(",", $admin->store_ids ?? '-1')[0];
-            $params['store_abbr'] = $admin->store_abbr;
+            $params['create_user_id'] = $admin->id;
+            $params['create_username'] = $admin->nickname;
             $this->customerModel->save($params);
             return $this->ok(true);
         } else {
@@ -87,12 +97,20 @@ class Customer extends BaseController
         if(!$customer)
             return $this->fail(lang('"The customer doesn t exist"'));
         if ($request->isAjax()) {
-            $user = $this->adminModel->findById($params['follow_user_id']);
-            if (!$user)
+            $admin = $this->adminModel->findById($params['follow_user_id']);
+            if (!$admin)
                 return $this->fail(lang("The employees dont exist"));
-            $params['follow_username'] = $user->username;
-            $params['store_id'] = $user->store_id;
-            $params['store_abbr'] = $user->store_abbr;
+            $store_id = explode(",", $admin->store_ids ?? '-1')[0];
+            if (!($store_id > 0))
+                return $this->fail(lang("The employee is not bound to a store"));
+            $store = $this->storeModel->findById($store_id);
+            if(!$store)
+                return $this->fail(lang("Stores do not exist"));
+            $params['store_id'] = $store->id;
+            $params['store_abbr'] = $store->abbr;
+            $params['follow_username'] = $admin->nickname;
+            $params['create_user_id'] = $admin->id;
+            $params['create_username'] = $admin->nickname;
             $params['update_time'] = time();
             $this->customerModel->where('id',$params['id'])->update($params);
             return $this->ok(true);

+ 53 - 0
app/admin/controller/Order.php

@@ -50,6 +50,59 @@ class Order extends \app\BaseController
     }
 
 
+    public function report(Request $request) {
+        $params = $request->param();
+        $format_params = [
+            'store_id' => format_string($params['store_id'] ?? null),
+            'type' => format_string($params['type'] ?? null) != null ? (int)$params['type']: null,
+        ];
+        $orders = $this->model->report($format_params)->toArray();
+        $objPHPExcel = new \PHPExcel();
+        try {
+            $objSheet = $objPHPExcel->getActiveSheet();
+            //工作表标题
+            $objSheet->setTitle("sheet1");
+            //第一行内容,放列标题
+            $objSheet->setCellValue("A1", lang("Order no"));
+            $objSheet->setCellValue("B1", lang("Customer"));
+            $objSheet->setCellValue("C1", lang("Store"));
+            $objSheet->setCellValue("D1", lang("Product"));
+            $objSheet->setCellValue("E1", lang("Rental amount"));
+            $objSheet->setCellValue("F1", lang("Receivable amount"));
+            $objSheet->setCellValue("G1", lang("Receive amount"));
+            $objSheet->setCellValue("H1", lang("Imposed amount"));
+            $objSheet->setCellValue("I1", lang("Creator"));
+            //设置第一行的背景颜色
+            $objPHPExcel->getActiveSheet()
+                ->getStyle('A1:I1')
+                ->getFill()
+                ->setFillType(\PHPExcel_Style_Fill::FILL_SOLID)
+                ->getStartColor()
+                ->setRGB('FFFF00');
+            //后面行循环放内容
+            for($i=0;$i<count($orders);$i++){
+                $order = $orders[$i];
+                $objSheet->setCellValue("A".($i + 2), $order['no']);
+                $objSheet->setCellValue("B".($i + 2), '【'.$order["customer_id"].'】'.$order['customer_name']);
+                $objSheet->setCellValue("C".($i + 2), '【'.$order['store_id'].'】'.$order['store']['name']);
+                $objSheet->setCellValue("D".($i + 2), join('<br />', array_map(function($data) {
+                    return $data['product_name'];
+                },$order['products'])));
+                $objSheet->setCellValue("E".($i + 2), $order['rental_amount']);
+                $objSheet->setCellValue("F".($i + 2), $order['receivable_amount']);
+                $objSheet->setCellValue("G".($i + 2), $order['receive_amount']);
+                $objSheet->setCellValue("H".($i + 2), $order['imposed_amount']);
+                $objSheet->setCellValue("I".($i + 2), '【'.$order["admin_id"].'】'.$order['admin_name']);
+            }
+            $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
+            $fileName = "order";
+            header('Content-Disposition: attachment;filename="'.$fileName.'.xlsx"'); //设置excel文件名称
+            header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
+            return json($objWriter->save("php://output"));
+        } catch (\PHPExcel_Exception $e) {
+        }
+    }
+
 
 
 

+ 2 - 0
app/admin/lang/zh-cn.php

@@ -153,6 +153,7 @@ return [
     "Discount"  =>  "折扣",
     "Reduced price" =>  "减免价",
     "Enter the product name or number and press Enter to select the product" => "输入商品名称或者编号后按回车选择商品",
+    "Please enter employee nickname or ID and press Enter to search" => "请输入员工昵称或者ID后按回车搜索",
     "Reception rules"   =>  "前台权限",
     "Backstage permission"  =>  "后台权限",
     "Relevance department"  => "关联部门",
@@ -195,6 +196,7 @@ return [
     "Stage num" => "分期数",
     "Is pay" => "是否已经支付",
     "Annual Fee" => "年费",
+    "Stores do not exist" => "门店不存在!",
 ];
 
 

+ 1 - 1
app/admin/middleware.php

@@ -7,6 +7,6 @@ return [
     // \think\middleware\LoadLangPack::class,
     // Session初始化
     // \think\middleware\SessionInit::class
-//    \app\common\middleware\VerifyToken::class,
+    \app\common\middleware\VerifyToken::class,
     \think\middleware\LoadLangPack::class
 ];

+ 9 - 5
app/admin/view/activity/edit.html

@@ -100,9 +100,10 @@
 
 
 <script>
-
     function advanced(data) {
-        $("#product_table").append(`<tr id="${data.product_id}">
+        request("{:url('admin/activity/add_relation')}", {...data, activity_id:"{$activity.id}"}).then((res) => {
+            if(res.code == 200) {
+                $("#product_table").append(`<tr id="${data.product_id}"><td>${data.product_id}</td>
                                                         <td hidden><input type="text" class="layui-input" name="product_ids[]" value="${data.product_id}"></td>
                                                         <td>${data.product_name}</td>
                                                         <td><input disabled type="text" class="layui-input" name="types[]" value=${data.type ? '{:lang("Discount")}':'{:lang("Reduced price")}'}></td>
@@ -114,7 +115,11 @@
                                                             </div>
                                                         </td>
                                                     </tr>`)
-
+            } else {
+                layer.msg(res.message,{icon: 5})
+            }
+            return false;
+        })
     }
     window.advanced = advanced;
     var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
@@ -123,7 +128,6 @@
         response.then((res) => {
             res.code === 200 ? layer.msg("{:lang('Succeed')}", {icon: 1,time:500},() => {
                 $(`#${id}`).remove();
-                parent.layer.close(index); //再执行关闭
             }) : layer.msg(res.message,{icon: 5})
         })
 
@@ -133,7 +137,7 @@
         const form = layui.form;
         const laydate = layui.laydate;
         form.on('submit(caviar_submit_btn)', (data) =>{
-            const response = request('/admin/activity/add',data.field)
+            const response = request('/admin/activity/edit',data.field)
             response.then((res) => {
                 res.code === 200 ? layer.msg("{:lang('Succeed')}", {icon: 1,time:500},() => {
                     parent.location.reload();

+ 29 - 48
app/admin/view/config/index.html

@@ -5,58 +5,27 @@
         <div class="card">
             <ul class="nav nav-tabs page-tabs">
                 <li class="active"> <a href="#!">基本</a> </li>
-<!--                <li> <a href="lyear-config-system.html">系统</a> </li>-->
-<!--                <li> <a href="lyear-config-upload.html">上传</a> </li>-->
             </ul>
             <div class="tab-content">
                 <div class="tab-pane active">
 
-                    <form action="#!" method="post" name="edit-form" class="edit-form">
-                        <div class="form-group">
-                            <label for="web_site_title">网站标题</label>
-                            <input class="form-control" type="text" id="web_site_title" name="web_site_title" value="光年后台管理系统HTML模板" placeholder="请输入站点标题" >
-                            <small class="help-block">调用方式:<code>config('web_site_title')</code></small>
-                        </div>
-                        <div class="form-group">
-                            <label for="web_site_logo">LOGO图片</label>
-                            <div class="input-group">
-                                <input type="text" class="form-control" name="web_site_logo" id="web_site_logo" value="/home/images/logo.png" />
-                                <div class="input-group-btn"><button class="btn btn-default" type="button">上传图片</button></div>
+                    <div class="card-body">
+                        <form class="layui-form">
+                            <input hidden name="id" value="{$config.id}">
+                            <div class="layui-form-item">
+                                <label class="layui-form-label">{:lang("Tax rate")}</label>
+                                <div class="layui-input-block">
+                                    <input type="number" value="{$config.tax_rate}" name="tax_rate" lay-verify="required" lay-reqtext="{:lang('Please fill in')}" autocomplete="off" class="layui-input">
+                                </div>
                             </div>
-                        </div>
-                        <div class="form-group">
-                            <label for="web_site_keywords">站点关键词</label>
-                            <input class="form-control" type="text" id="web_site_keywords" name="web_site_keywords" value="后台系统模板,LightYear Admin Template,html模板,后台模板,管理系统模板" placeholder="请输入站点关键词" >
-                            <small class="help-block">网站搜索引擎关键字</small>
-                        </div>
-                        <div class="form-group">
-                            <label for="web_site_description">站点描述</label>
-                            <textarea class="form-control" id="web_site_description" rows="5" name="web_site_description" placeholder="请输入站点描述" >光年(Light Year Admin)后台管理系统模板是一个基于基于Bootstrap v3.3.7的纯HTML模板。</textarea>
-                            <small class="help-block">网站描述,有利于搜索引擎抓取相关信息</small>
-                        </div>
-                        <div class="form-group">
-                            <label for="web_site_copyright">版权信息</label>
-                            <input class="form-control" type="text" id="web_site_copyright" name="web_site_copyright" value="" placeholder="请输入版权信息" >
-                            <small class="help-block">调用方式:<code>config('web_site_copyright')</code></small>
-                        </div>
-                        <div class="form-group">
-                            <label for="web_site_icp">备案信息</label>
-                            <input class="form-control" type="text" id="web_site_icp" name="web_site_icp" value="" placeholder="请输入备案信息" >
-                            <small class="help-block">调用方式:<code>config('web_site_icp')</code></small>
-                        </div>
-                        <div class="form-group">
-                            <label class="btn-block" for="web_site_status">站点开关</label>
-                            <label class="lyear-switch switch-solid switch-primary">
-                                <input type="checkbox" checked="">
-                                <span></span>
-                            </label>
-                            <small class="help-block">站点关闭后将不能访问,后台可正常登录</small>
-                        </div>
-                        <div class="form-group">
-                            <button type="submit" class="btn btn-primary m-r-5">确 定</button>
-                            <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);return false;">返 回</button>
-                        </div>
-                    </form>
+
+                            <div class="layui-form-item">
+                                <div class="layui-input-block">
+                                    <button type="submit" class="layui-btn" lay-submit="" lay-filter="caviar_submit_btn">{:lang('Submit')}</button>
+                                </div>
+                            </div>
+                        </form>
+                    </div>
 
                 </div>
             </div>
@@ -64,4 +33,16 @@
         </div>
     </div>
 
-</div>
+</div>
+<script>
+    layui.use(['form'], () => {
+        const form = layui.form;
+        form.on('submit(caviar_submit_btn)', (data) =>{
+            const response = request('/admin/config/index',{...data.field, id: 1})
+            response.then((res) => {
+                res.code === 200 ? layer.msg("{:lang('Succeed')}", {icon: 1,time:500}) : layer.msg(res.message,{icon: 5})
+            })
+            return false;
+        });
+    });
+</script>

+ 59 - 19
app/admin/view/customer/add.html

@@ -46,21 +46,25 @@
                   <div class="layui-inline">
                     <label class="layui-form-label">{:lang("sun_calendar")}</label>
                     <div class="layui-input-block">
-                      <input type="text" name="sun_calendar" id="sun_calendar" lay-verify="datetime" placeholder="yyyy-MM-dd H:i:s" autocomplete="off" class="layui-input" lay-key="1">
+                      <input type="text" name="sun_calendar" id="sun_calendar" lay-verify="required" placeholder="yyyy-MM-dd H:i:s" autocomplete="off" class="layui-input" lay-key="1">
                     </div>
                   </div>
 
                   <div class="layui-inline">
                     <label class="layui-form-label">{:lang("lunar_calendar")}</label>
                     <div class="layui-input-block">
-                      <input type="text" name="lunar_calendar" id="lunar_calendar" lay-verify="datetime" placeholder="yyyy-MM-dd H:i:s" autocomplete="off" class="layui-input" lay-key="1">
+                      <input type="text" name="lunar_calendar" id="lunar_calendar" lay-verify="required" placeholder="yyyy-MM-dd H:i:s" autocomplete="off" class="layui-input" lay-key="1">
                     </div>
                   </div>
 
-                  <div class="layui-form-item">
-                    <label class="layui-form-label">{:lang("follow_user_id")}</label>
+                  <div class="layui-form-item unfold_ajax">
+                    <label class="layui-form-label">{:lang('Counselor')}</label>
                     <div class="layui-input-block">
-                      <input type="text" name="follow_user_id" lay-verify="required" lay-reqtext="{:lang('Please fill in')}" autocomplete="off" class="layui-input">
+                      <input type="text" id="ajax_search_id" name="follow_user_id" class="layui-input"
+                             placeholder="{:lang('Please enter employee nickname or ID and press Enter to search')}" style="position:absolute;z-index:2;width:88%;" value="" autocomplete="off">
+                      <select id="ajax_search" name="follow_user_id" lay-verify="required" lay-filter="ajax_search" >
+                        <option value="">{:lang('Please enter employee nickname or ID and press Enter to search')}</option>
+                      </select>
                     </div>
                   </div>
 
@@ -94,19 +98,9 @@
                     </div>
                   </div>
 
-<!--                  <div class="layui-form-item">-->
-<!--                    <label class="layui-form-label">{:lang('Store')}</label>-->
-<!--                    <div class="layui-input-block">-->
-<!--                      <select name="store_id" lay-filter="required">-->
-<!--                        {volist name="stores" id="item"}-->
-<!--                        <option value="{$item.id}">{$item.name}</option>-->
-<!--                        {/volist}-->
-<!--                      </select>-->
-<!--                    </div>-->
-<!--                  </div>-->
                   <div class="layui-form-item">
                     <div class="layui-input-block">
-                      <button type="submit" class="layui-btn" lay-submit="" lay-filter="caviar_submit_btn">{:lang('Submit')}</button>
+                      <button type="button" class="layui-btn" lay-submit="" lay-filter="caviar_submit_btn">{:lang('Submit')}</button>
                       <button type="reset" class="layui-btn layui-btn-primary">{:lang("Reset")}</button>
                     </div>
                   </div>
@@ -124,14 +118,60 @@
   </div>
 </div>
 <script>
-  //当你在iframe页面关闭自身时
-  // var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
-  // parent.layer.close(index); //再执行关闭
+
+  // 用于缓存下拉获取的数据
+  let dropData
+
+  // 请求返回数据
+  function getData(str){
+    return new Promise(resolve=>{
+      request("{:url('admin/admin/findAdmins')}", {"text": str}).then((data) => {
+        if (data.code === 200) {
+          resolve(data.data.map(v => {
+            return {
+              value: v.id,
+              text: `【${v.id}】 ${v.nickname}`
+            }
+          }))
+        }
+      })
+    })
+  }
+
+  $("#ajax_search_id").on("keyup", async function(e){
+    if(e.which=='13'){
+      dropData=await getData($(this).val())
+      innitSelect("#ajax_search", dropData)
+      let form = layui.form;
+      form.render()
+      $(".unfold_ajax .layui-form-select").addClass("layui-form-selected")
+    }
+  })
+
+  // 渲染下拉框的数据
+  function innitSelect(name,data){
+    let html=''
+    if(data && data instanceof Array){
+      data.forEach(item=>{
+        html+="<option value="+item.value+">"+item.text+"</option>"
+      })
+    }
+    $(name).html(html)
+  }
+  var index = parent.layer.getFrameIndex(window.name);
 
   layui.use(['laydate','form'], () => {
     const laydate = layui.laydate;
     const form = layui.form;
 
+    form.on("select(ajax_search)",function(data){
+      let value = data.value
+      let selectObj = dropData.filter(item=> {
+        return item.value == value
+      })
+      $("#ajax_search_id").val(selectObj[0].text);
+    })
+
     form.on('submit(caviar_submit_btn)', (data) =>{
       const response = request('/admin/customer/add',data.field)
       response.then((res) => {

+ 58 - 12
app/admin/view/customer/edit.html

@@ -61,20 +61,17 @@
                 </div>
               </div>
 
-              <div class="layui-form-item">
-                <label class="layui-form-label">{:lang("follow_user_id")}</label>
+              <div class="layui-form-item unfold_ajax">
+                <label class="layui-form-label">{:lang('Counselor')}</label>
                 <div class="layui-input-block">
-                  <input type="text" name="follow_user_id" value="{$customer.follow_user_id}" lay-verify="required" lay-reqtext="{:lang('Please fill in')}" autocomplete="off" class="layui-input">
+                  <input type="text" id="ajax_search_id" name="follow_user_id" value="【{$customer.follow_user_id}】{$customer.follow_username}" class="layui-input"
+                         placeholder="{:lang('Please enter employee nickname or ID and press Enter to search')}" style="position:absolute;z-index:2;width:88%;" value="" autocomplete="off">
+                  <select id="ajax_search" name="follow_user_id" lay-verify="required" lay-filter="ajax_search" >
+                    <option value="">{:lang('Please enter employee nickname or ID and press Enter to search')}</option>
+                  </select>
                 </div>
               </div>
-
-              <div class="layui-form-item">
-                <label class="layui-form-label">{:lang("follow_username")}</label>
-                <div class="layui-input-block">
-                  <input type="text" name="follow_username" value="{$customer.follow_username}" lay-verify="required" lay-reqtext="{:lang('Please fill in')}" autocomplete="off" class="layui-input" disabled>
-                </div>
-              </div>
-
+              <input id="follow_user_id" name="follow_user_id" value="{$customer.follow_user_id}" hidden>
 
               <div class="layui-form-item">
                 <label class="layui-form-label">{:lang("linkman")}</label>
@@ -118,7 +115,7 @@
               </div>
               <div class="layui-form-item">
                 <div class="layui-input-block">
-                  <button type="submit" class="layui-btn" lay-submit="" lay-filter="caviar_submit_btn">{:lang('Update')}</button>
+                  <button type="button" class="layui-btn" lay-submit="" lay-filter="caviar_submit_btn">{:lang('Update')}</button>
                 </div>
               </div>
             </form>
@@ -131,10 +128,59 @@
   </div>
 </div>
 <script>
+  // 用于缓存下拉获取的数据
+  let dropData
+
+  // 请求返回数据
+  function getData(str){
+    return new Promise(resolve=>{
+      request("{:url('admin/admin/findAdmins')}", {"text": str}).then((data) => {
+        if (data.code === 200) {
+          resolve(data.data.map(v => {
+            return {
+              value: v.id,
+              text: `【${v.id}】 ${v.nickname}`
+            }
+          }))
+        }
+      })
+    })
+  }
+
+  $("#ajax_search_id").on("keyup", async function(e){
+    if(e.which=='13'){
+      dropData=await getData($(this).val())
+      innitSelect("#ajax_search", dropData)
+      let form = layui.form;
+      form.render()
+      $(".unfold_ajax .layui-form-select").addClass("layui-form-selected")
+    }
+  })
+
+  // 渲染下拉框的数据
+  function innitSelect(name,data){
+    let html=''
+    if(data && data instanceof Array){
+      data.forEach(item=>{
+        html+="<option value="+item.value+">"+item.text+"</option>"
+      })
+    }
+    $(name).html(html)
+  }
+
   layui.use(['laydate','form'], () => {
     const laydate = layui.laydate;
     const form = layui.form;
 
+    form.on("select(ajax_search)",function(data){
+      let value = data.value
+      let selectObj = dropData.filter(item=> {
+        return item.value == value
+      })
+      $("#ajax_search_id").val(selectObj[0].text);
+      $("#follow_user_id").val(selectObj[0].value);
+    })
+
     form.on('submit(caviar_submit_btn)', (data) =>{
       const response = request('/admin/customer/edit',data.field)
       response.then((res) => {

+ 5 - 3
app/admin/view/customer/index.html

@@ -72,10 +72,11 @@
                                 <th>{:lang('sex')}</th>
                                 <th>{:lang('sun_calendar')}</th>
                                 <th>{:lang('lunar_calendar')}</th>
-                                <th>{:lang('follow_user_id')}/{:lang('follow_username')}</th>
+                                <th>{:lang('Counselor')}</th>
                                 <th>{:lang('address')}</th>
                                 <th>{:lang('email')}</th>
-                                <th>{:lang('store_id')}/{:lang('store_abbr')}</th>
+                                <th>{:lang('store_abbr')}</th>
+                                <th>{:lang('Creator')}</th>
                                 <th>{:lang('create_time')}</th>
                                 <th>{:lang('operation')}</th>
                             </tr>
@@ -92,13 +93,14 @@
                                 <td>{$item.name_zh}</td>
                                 <td>{$item.name_en}</td>
                                 <td>{$item.mobile}</td>
-                                <td>{$item.sex}</td>
+                                <td>{$item.sex_str}</td>
                                 <td>{$item.sun_calendar}</td>
                                 <td>{$item.lunar_calendar}</td>
                                 <td>【{$item.follow_user_id}】{$item.follow_username}</td>
                                 <td>{$item.address}</td>
                                 <td>{$item.email}</td>
                                 <td>【{$item.store_id}】/{$item.store_abbr}</td>
+                                <td>【{$item.create_user_id}】{$item.create_username}</td>
                                 <td>{$item.create_time}</td>
                                 <td>
                                     <div class="btn-group">

+ 6 - 0
app/admin/view/order/index.html

@@ -50,6 +50,7 @@
                 <div class="card-toolbar clearfix">
                     <div class="toolbar-btn-action">
                         <a class="btn btn-success m-r-5" id="caviar_search_btn" href="#!" onclick="select_card_switch()">{$Think.lang.unfold_search}</a>
+                        <a class="btn btn-cyan m-r-5" id="caviar_report_btn" href="#!" onclick="caviar_report()">{$Think.lang.Report}</a>
 <!--                        <a class="btn btn-primary m-r-5" href="#!" onclick="add('{:url(\'admin/order/add\')}')"><i class="mdi mdi-plus"></i> {:lang('add')}</a>-->
 <!--                        <a class="btn btn-danger" href="#!" onclick="-->
 <!--                            caviar_checkbox_delete('{:url(\'admin/order/delete\')}', ['{:lang(\'Check at least one box\')}','{:lang(\'Succeed\')}'],'{:lang(\'Warn\')}','{:lang(\'Are you sure you want to delete the selected data\')}',['{:lang(\'Confirm\')}'])"-->
@@ -126,6 +127,11 @@
 </style>
 
 <script type="text/javascript">
+    function caviar_report() {
+        const store_id = $("select[name='store_id']").val();
+        const type = $("select[name='type']").val();
+        location.href = `{:url('admin/order/report')}?store_id=${store_id}&type=${type}`;
+    }
     if(check_params(["{$params.type}","{$params.store_id}"]))
         $('#select_card_caviar').css('display','block');
 </script>

+ 0 - 1
app/admin/view/user/edit.html

@@ -63,7 +63,6 @@
                                         </div>
                                     </div>
                                 </form>
-                                </form>
                             </div>
                         </div>
                     </div>

+ 4 - 0
app/common/model/AdminModel.php

@@ -84,4 +84,8 @@ class AdminModel extends BaseModel
         return $this->where('id',$id)->with(['access','access.group','department'])->find();
     }
 
+    public function findAdmins($text) {
+        return $this->where('id|nickname','like', '%'.$text.'%')->select();
+    }
+
 }

+ 15 - 0
app/common/model/ConfigModel.php

@@ -0,0 +1,15 @@
+<?php
+
+
+namespace app\common\model;
+
+
+class ConfigModel extends BaseModel
+{
+    protected $table = 'erp_config';
+
+    protected function genSchema(array $schema)
+    {
+        // TODO: Implement genSchema() method.
+    }
+}

+ 13 - 0
app/common/model/OrderModel.php

@@ -45,6 +45,19 @@ class OrderModel extends BaseModel
             ->order('create_time','desc')
             ->paginate(['list_rows'=>10, "query" => $params]);
     }
+    public function report(array $params) {
+        $where = [
+            ['is_delete', '=', 0]
+        ];
+        if($params['store_id'] > 0)
+            array_push($where,['store_id', '=', $params['store_id']]);
+        if($params['type'] > 0)
+            array_push($where,['type', '=', $params['type']]);
+        return $this->where($where)
+            ->with(['products','store'])
+            ->order('create_time','desc')
+            ->select();
+    }
 
     public function findById($id)
     {

+ 2 - 1
composer.json

@@ -27,7 +27,8 @@
         "topthink/think-multi-app": "^1.0",
         "lcobucci/jwt": "^3.4",
         "topthink/think-view": "^1.0",
-      "ext-json": "*"
+      "ext-json": "*",
+        "phpoffice/phpexcel": "^1.8"
     },
     "require-dev": {
         "symfony/var-dumper": "^4.2",

+ 83 - 115
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": "588f627ebfdc8bc264e18f205ee82368",
+    "content-hash": "de0282c118d7fdd722d2055b46c9504e",
     "packages": [
         {
             "name": "lcobucci/jwt",
@@ -18,13 +18,7 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/lcobucci/jwt/zipball/3ef8657a78278dfeae7707d51747251db4176240",
                 "reference": "3ef8657a78278dfeae7707d51747251db4176240",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
+                "shasum": ""
             },
             "require": {
                 "ext-mbstring": "*",
@@ -101,13 +95,7 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1",
                 "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
+                "shasum": ""
             },
             "require": {
                 "ext-fileinfo": "*",
@@ -201,13 +189,7 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/thephpleague/flysystem-cached-adapter/zipball/d1925efb2207ac4be3ad0c40b8277175f99ffaff",
                 "reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
+                "shasum": ""
             },
             "require": {
                 "league/flysystem": "~1.0",
@@ -258,13 +240,7 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ff6248ea87a9f116e78edd6002e39e5128a0d4dd",
                 "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
+                "shasum": ""
             },
             "require": {
                 "ext-fileinfo": "*",
@@ -309,6 +285,69 @@
             "time": "2022-04-17T13:12:02+00:00"
         },
         {
+            "name": "phpoffice/phpexcel",
+            "version": "1.8.2",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/PHPOffice/PHPExcel.git",
+                "reference": "1441011fb7ecdd8cc689878f54f8b58a6805f870"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/PHPOffice/PHPExcel/zipball/1441011fb7ecdd8cc689878f54f8b58a6805f870",
+                "reference": "1441011fb7ecdd8cc689878f54f8b58a6805f870",
+                "shasum": ""
+            },
+            "require": {
+                "ext-mbstring": "*",
+                "ext-xml": "*",
+                "ext-xmlwriter": "*",
+                "php": "^5.2|^7.0"
+            },
+            "require-dev": {
+                "squizlabs/php_codesniffer": "2.*"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-0": {
+                    "PHPExcel": "Classes/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "LGPL-2.1"
+            ],
+            "authors": [
+                {
+                    "name": "Maarten Balliauw",
+                    "homepage": "http://blog.maartenballiauw.be"
+                },
+                {
+                    "name": "Erik Tilt"
+                },
+                {
+                    "name": "Franck Lefevre",
+                    "homepage": "http://rootslabs.net"
+                },
+                {
+                    "name": "Mark Baker",
+                    "homepage": "http://markbakeruk.net"
+                }
+            ],
+            "description": "PHPExcel - OpenXML - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
+            "homepage": "https://github.com/PHPOffice/PHPExcel",
+            "keywords": [
+                "OpenXML",
+                "excel",
+                "php",
+                "spreadsheet",
+                "xls",
+                "xlsx"
+            ],
+            "abandoned": "phpoffice/phpspreadsheet",
+            "time": "2018-11-22T23:07:24+00:00"
+        },
+        {
             "name": "psr/cache",
             "version": "1.0.1",
             "source": {
@@ -320,13 +359,7 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
                 "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
+                "shasum": ""
             },
             "require": {
                 "php": ">=5.3.0"
@@ -375,13 +408,7 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf",
                 "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
+                "shasum": ""
             },
             "require": {
                 "php": ">=7.2.0"
@@ -429,13 +456,7 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
                 "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
+                "shasum": ""
             },
             "require": {
                 "php": ">=5.3.0"
@@ -488,13 +509,7 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
                 "reference": "d49695b909c3b7628b6289db5479a1c204601f11",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
+                "shasum": ""
             },
             "require": {
                 "php": ">=5.3.0"
@@ -544,13 +559,7 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
                 "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
+                "shasum": ""
             },
             "require": {
                 "php": ">=5.3.0"
@@ -601,13 +610,7 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/top-think/framework/zipball/2cb56f3e6f3c479fe90ea5f28d38d3b5ef6c4210",
                 "reference": "2cb56f3e6f3c479fe90ea5f28d38d3b5ef6c4210",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
+                "shasum": ""
             },
             "require": {
                 "ext-json": "*",
@@ -672,13 +675,7 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/top-think/think-filesystem/zipball/cfc510520db9bcd22d8d80f51d7e415a2f470af6",
                 "reference": "cfc510520db9bcd22d8d80f51d7e415a2f470af6",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
+                "shasum": ""
             },
             "require": {
                 "league/flysystem": "^1.1.4",
@@ -726,13 +723,7 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/top-think/think-helper/zipball/769acbe50a4274327162f9c68ec2e89a38eb2aff",
                 "reference": "769acbe50a4274327162f9c68ec2e89a38eb2aff",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
+                "shasum": ""
             },
             "require": {
                 "php": ">=7.1.0"
@@ -778,13 +769,7 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/top-think/think-multi-app/zipball/387e0dac059c20f92cac5da41a871e10829c1c97",
                 "reference": "387e0dac059c20f92cac5da41a871e10829c1c97",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
+                "shasum": ""
             },
             "require": {
                 "php": ">=7.1.0",
@@ -832,13 +817,7 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/top-think/think-orm/zipball/97b061b47616301ff29fbd4c35ed9184e1162e4e",
                 "reference": "97b061b47616301ff29fbd4c35ed9184e1162e4e",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
+                "shasum": ""
             },
             "require": {
                 "ext-json": "*",
@@ -893,13 +872,7 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/top-think/think-template/zipball/abfc293f74f9ef5127b5c416310a01fe42e59368",
                 "reference": "abfc293f74f9ef5127b5c416310a01fe42e59368",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
+                "shasum": ""
             },
             "require": {
                 "php": ">=7.1.0",
@@ -940,13 +913,7 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/top-think/think-view/zipball/edce0ae2c9551ab65f9e94a222604b0dead3576d",
                 "reference": "edce0ae2c9551ab65f9e94a222604b0dead3576d",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
+                "shasum": ""
             },
             "require": {
                 "php": ">=7.1.0",
@@ -1396,8 +1363,9 @@
     "prefer-stable": false,
     "prefer-lowest": false,
     "platform": {
-        "php": ">=7.2.5"
+        "php": ">=7.2.5",
+        "ext-json": "*"
     },
     "platform-dev": [],
-    "plugin-api-version": "2.3.0"
+    "plugin-api-version": "1.1.0"
 }

BIN
public/order.xlsx


+ 2 - 0
public/static/js/common.js

@@ -29,6 +29,8 @@ function select_card_switch() {
     }
 }
 
+
+
 function check_params(p = []) {
     const index = p.findIndex(v => v !== undefined && v.toString().length > 0);
     return index >= 0;

+ 0 - 2
vendor/.gitignore

@@ -1,2 +0,0 @@
-*
-!.gitignore

+ 7 - 0
vendor/autoload.php

@@ -0,0 +1,7 @@
+<?php
+
+// autoload.php @generated by Composer
+
+require_once __DIR__ . '/composer/autoload_real.php';
+
+return ComposerAutoloaderInit1e35666d44f6241113050f08f28e3325::getLoader();

+ 1 - 0
vendor/bin/var-dump-server

@@ -0,0 +1 @@
+../symfony/var-dumper/Resources/bin/var-dump-server

+ 445 - 0
vendor/composer/ClassLoader.php

@@ -0,0 +1,445 @@
+<?php
+
+/*
+ * This file is part of Composer.
+ *
+ * (c) Nils Adermann <naderman@naderman.de>
+ *     Jordi Boggiano <j.boggiano@seld.be>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\Autoload;
+
+/**
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
+ *
+ *     $loader = new \Composer\Autoload\ClassLoader();
+ *
+ *     // register classes with namespaces
+ *     $loader->add('Symfony\Component', __DIR__.'/component');
+ *     $loader->add('Symfony',           __DIR__.'/framework');
+ *
+ *     // activate the autoloader
+ *     $loader->register();
+ *
+ *     // to enable searching the include path (eg. for PEAR packages)
+ *     $loader->setUseIncludePath(true);
+ *
+ * In this example, if you try to use a class in the Symfony\Component
+ * namespace or one of its children (Symfony\Component\Console for instance),
+ * the autoloader will first look for the class under the component/
+ * directory, and it will then fallback to the framework/ directory if not
+ * found before giving up.
+ *
+ * This class is loosely based on the Symfony UniversalClassLoader.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ * @author Jordi Boggiano <j.boggiano@seld.be>
+ * @see    http://www.php-fig.org/psr/psr-0/
+ * @see    http://www.php-fig.org/psr/psr-4/
+ */
+class ClassLoader
+{
+    // PSR-4
+    private $prefixLengthsPsr4 = array();
+    private $prefixDirsPsr4 = array();
+    private $fallbackDirsPsr4 = array();
+
+    // PSR-0
+    private $prefixesPsr0 = array();
+    private $fallbackDirsPsr0 = array();
+
+    private $useIncludePath = false;
+    private $classMap = array();
+    private $classMapAuthoritative = false;
+    private $missingClasses = array();
+    private $apcuPrefix;
+
+    public function getPrefixes()
+    {
+        if (!empty($this->prefixesPsr0)) {
+            return call_user_func_array('array_merge', $this->prefixesPsr0);
+        }
+
+        return array();
+    }
+
+    public function getPrefixesPsr4()
+    {
+        return $this->prefixDirsPsr4;
+    }
+
+    public function getFallbackDirs()
+    {
+        return $this->fallbackDirsPsr0;
+    }
+
+    public function getFallbackDirsPsr4()
+    {
+        return $this->fallbackDirsPsr4;
+    }
+
+    public function getClassMap()
+    {
+        return $this->classMap;
+    }
+
+    /**
+     * @param array $classMap Class to filename map
+     */
+    public function addClassMap(array $classMap)
+    {
+        if ($this->classMap) {
+            $this->classMap = array_merge($this->classMap, $classMap);
+        } else {
+            $this->classMap = $classMap;
+        }
+    }
+
+    /**
+     * Registers a set of PSR-0 directories for a given prefix, either
+     * appending or prepending to the ones previously set for this prefix.
+     *
+     * @param string       $prefix  The prefix
+     * @param array|string $paths   The PSR-0 root directories
+     * @param bool         $prepend Whether to prepend the directories
+     */
+    public function add($prefix, $paths, $prepend = false)
+    {
+        if (!$prefix) {
+            if ($prepend) {
+                $this->fallbackDirsPsr0 = array_merge(
+                    (array) $paths,
+                    $this->fallbackDirsPsr0
+                );
+            } else {
+                $this->fallbackDirsPsr0 = array_merge(
+                    $this->fallbackDirsPsr0,
+                    (array) $paths
+                );
+            }
+
+            return;
+        }
+
+        $first = $prefix[0];
+        if (!isset($this->prefixesPsr0[$first][$prefix])) {
+            $this->prefixesPsr0[$first][$prefix] = (array) $paths;
+
+            return;
+        }
+        if ($prepend) {
+            $this->prefixesPsr0[$first][$prefix] = array_merge(
+                (array) $paths,
+                $this->prefixesPsr0[$first][$prefix]
+            );
+        } else {
+            $this->prefixesPsr0[$first][$prefix] = array_merge(
+                $this->prefixesPsr0[$first][$prefix],
+                (array) $paths
+            );
+        }
+    }
+
+    /**
+     * Registers a set of PSR-4 directories for a given namespace, either
+     * appending or prepending to the ones previously set for this namespace.
+     *
+     * @param string       $prefix  The prefix/namespace, with trailing '\\'
+     * @param array|string $paths   The PSR-4 base directories
+     * @param bool         $prepend Whether to prepend the directories
+     *
+     * @throws \InvalidArgumentException
+     */
+    public function addPsr4($prefix, $paths, $prepend = false)
+    {
+        if (!$prefix) {
+            // Register directories for the root namespace.
+            if ($prepend) {
+                $this->fallbackDirsPsr4 = array_merge(
+                    (array) $paths,
+                    $this->fallbackDirsPsr4
+                );
+            } else {
+                $this->fallbackDirsPsr4 = array_merge(
+                    $this->fallbackDirsPsr4,
+                    (array) $paths
+                );
+            }
+        } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
+            // Register directories for a new namespace.
+            $length = strlen($prefix);
+            if ('\\' !== $prefix[$length - 1]) {
+                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+            }
+            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+            $this->prefixDirsPsr4[$prefix] = (array) $paths;
+        } elseif ($prepend) {
+            // Prepend directories for an already registered namespace.
+            $this->prefixDirsPsr4[$prefix] = array_merge(
+                (array) $paths,
+                $this->prefixDirsPsr4[$prefix]
+            );
+        } else {
+            // Append directories for an already registered namespace.
+            $this->prefixDirsPsr4[$prefix] = array_merge(
+                $this->prefixDirsPsr4[$prefix],
+                (array) $paths
+            );
+        }
+    }
+
+    /**
+     * Registers a set of PSR-0 directories for a given prefix,
+     * replacing any others previously set for this prefix.
+     *
+     * @param string       $prefix The prefix
+     * @param array|string $paths  The PSR-0 base directories
+     */
+    public function set($prefix, $paths)
+    {
+        if (!$prefix) {
+            $this->fallbackDirsPsr0 = (array) $paths;
+        } else {
+            $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
+        }
+    }
+
+    /**
+     * Registers a set of PSR-4 directories for a given namespace,
+     * replacing any others previously set for this namespace.
+     *
+     * @param string       $prefix The prefix/namespace, with trailing '\\'
+     * @param array|string $paths  The PSR-4 base directories
+     *
+     * @throws \InvalidArgumentException
+     */
+    public function setPsr4($prefix, $paths)
+    {
+        if (!$prefix) {
+            $this->fallbackDirsPsr4 = (array) $paths;
+        } else {
+            $length = strlen($prefix);
+            if ('\\' !== $prefix[$length - 1]) {
+                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+            }
+            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+            $this->prefixDirsPsr4[$prefix] = (array) $paths;
+        }
+    }
+
+    /**
+     * Turns on searching the include path for class files.
+     *
+     * @param bool $useIncludePath
+     */
+    public function setUseIncludePath($useIncludePath)
+    {
+        $this->useIncludePath = $useIncludePath;
+    }
+
+    /**
+     * Can be used to check if the autoloader uses the include path to check
+     * for classes.
+     *
+     * @return bool
+     */
+    public function getUseIncludePath()
+    {
+        return $this->useIncludePath;
+    }
+
+    /**
+     * Turns off searching the prefix and fallback directories for classes
+     * that have not been registered with the class map.
+     *
+     * @param bool $classMapAuthoritative
+     */
+    public function setClassMapAuthoritative($classMapAuthoritative)
+    {
+        $this->classMapAuthoritative = $classMapAuthoritative;
+    }
+
+    /**
+     * Should class lookup fail if not found in the current class map?
+     *
+     * @return bool
+     */
+    public function isClassMapAuthoritative()
+    {
+        return $this->classMapAuthoritative;
+    }
+
+    /**
+     * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
+     *
+     * @param string|null $apcuPrefix
+     */
+    public function setApcuPrefix($apcuPrefix)
+    {
+        $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
+    }
+
+    /**
+     * The APCu prefix in use, or null if APCu caching is not enabled.
+     *
+     * @return string|null
+     */
+    public function getApcuPrefix()
+    {
+        return $this->apcuPrefix;
+    }
+
+    /**
+     * Registers this instance as an autoloader.
+     *
+     * @param bool $prepend Whether to prepend the autoloader or not
+     */
+    public function register($prepend = false)
+    {
+        spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+    }
+
+    /**
+     * Unregisters this instance as an autoloader.
+     */
+    public function unregister()
+    {
+        spl_autoload_unregister(array($this, 'loadClass'));
+    }
+
+    /**
+     * Loads the given class or interface.
+     *
+     * @param  string    $class The name of the class
+     * @return bool|null True if loaded, null otherwise
+     */
+    public function loadClass($class)
+    {
+        if ($file = $this->findFile($class)) {
+            includeFile($file);
+
+            return true;
+        }
+    }
+
+    /**
+     * Finds the path to the file where the class is defined.
+     *
+     * @param string $class The name of the class
+     *
+     * @return string|false The path if found, false otherwise
+     */
+    public function findFile($class)
+    {
+        // class map lookup
+        if (isset($this->classMap[$class])) {
+            return $this->classMap[$class];
+        }
+        if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
+            return false;
+        }
+        if (null !== $this->apcuPrefix) {
+            $file = apcu_fetch($this->apcuPrefix.$class, $hit);
+            if ($hit) {
+                return $file;
+            }
+        }
+
+        $file = $this->findFileWithExtension($class, '.php');
+
+        // Search for Hack files if we are running on HHVM
+        if (false === $file && defined('HHVM_VERSION')) {
+            $file = $this->findFileWithExtension($class, '.hh');
+        }
+
+        if (null !== $this->apcuPrefix) {
+            apcu_add($this->apcuPrefix.$class, $file);
+        }
+
+        if (false === $file) {
+            // Remember that this class does not exist.
+            $this->missingClasses[$class] = true;
+        }
+
+        return $file;
+    }
+
+    private function findFileWithExtension($class, $ext)
+    {
+        // PSR-4 lookup
+        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
+
+        $first = $class[0];
+        if (isset($this->prefixLengthsPsr4[$first])) {
+            $subPath = $class;
+            while (false !== $lastPos = strrpos($subPath, '\\')) {
+                $subPath = substr($subPath, 0, $lastPos);
+                $search = $subPath . '\\';
+                if (isset($this->prefixDirsPsr4[$search])) {
+                    $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
+                    foreach ($this->prefixDirsPsr4[$search] as $dir) {
+                        if (file_exists($file = $dir . $pathEnd)) {
+                            return $file;
+                        }
+                    }
+                }
+            }
+        }
+
+        // PSR-4 fallback dirs
+        foreach ($this->fallbackDirsPsr4 as $dir) {
+            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
+                return $file;
+            }
+        }
+
+        // PSR-0 lookup
+        if (false !== $pos = strrpos($class, '\\')) {
+            // namespaced class name
+            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
+                . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
+        } else {
+            // PEAR-like class name
+            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
+        }
+
+        if (isset($this->prefixesPsr0[$first])) {
+            foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
+                if (0 === strpos($class, $prefix)) {
+                    foreach ($dirs as $dir) {
+                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+                            return $file;
+                        }
+                    }
+                }
+            }
+        }
+
+        // PSR-0 fallback dirs
+        foreach ($this->fallbackDirsPsr0 as $dir) {
+            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+                return $file;
+            }
+        }
+
+        // PSR-0 include paths.
+        if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
+            return $file;
+        }
+
+        return false;
+    }
+}
+
+/**
+ * Scope isolated include.
+ *
+ * Prevents access to $this/self from included files.
+ */
+function includeFile($file)
+{
+    include $file;
+}

+ 21 - 0
vendor/composer/LICENSE

@@ -0,0 +1,21 @@
+
+Copyright (c) Nils Adermann, Jordi Boggiano
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+

+ 14 - 0
vendor/composer/autoload_classmap.php

@@ -0,0 +1,14 @@
+<?php
+
+// autoload_classmap.php @generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+    'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
+    'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
+    'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
+    'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
+    'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
+);

+ 18 - 0
vendor/composer/autoload_files.php

@@ -0,0 +1,18 @@
+<?php
+
+// autoload_files.php @generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+    '9b552a3cc426e3287cc811caefa3cf53' => $vendorDir . '/topthink/think-helper/src/helper.php',
+    '35fab96057f1bf5e7aba31a8a6d5fdde' => $vendorDir . '/topthink/think-orm/stubs/load_stubs.php',
+    '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
+    '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php',
+    'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.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',
+    '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
+);

+ 11 - 0
vendor/composer/autoload_namespaces.php

@@ -0,0 +1,11 @@
+<?php
+
+// autoload_namespaces.php @generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+    'PHPExcel' => array($vendorDir . '/phpoffice/phpexcel/Classes'),
+    '' => array($baseDir . '/extend'),
+);

+ 27 - 0
vendor/composer/autoload_psr4.php

@@ -0,0 +1,27 @@
+<?php
+
+// autoload_psr4.php @generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+    'think\\view\\driver\\' => array($vendorDir . '/topthink/think-view/src'),
+    'think\\trace\\' => array($vendorDir . '/topthink/think-trace/src'),
+    'think\\app\\' => array($vendorDir . '/topthink/think-multi-app/src'),
+    'think\\' => array($vendorDir . '/topthink/framework/src/think', $vendorDir . '/topthink/think-filesystem/src', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/think-template/src'),
+    'app\\' => array($baseDir . '/app'),
+    'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
+    'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'),
+    'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
+    'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'),
+    'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
+    'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
+    'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'),
+    'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
+    'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'),
+    'League\\MimeTypeDetection\\' => array($vendorDir . '/league/mime-type-detection/src'),
+    'League\\Flysystem\\Cached\\' => array($vendorDir . '/league/flysystem-cached-adapter/src'),
+    'League\\Flysystem\\' => array($vendorDir . '/league/flysystem/src'),
+    'Lcobucci\\JWT\\' => array($vendorDir . '/lcobucci/jwt/src'),
+);

+ 73 - 0
vendor/composer/autoload_real.php

@@ -0,0 +1,73 @@
+<?php
+
+// autoload_real.php @generated by Composer
+
+class ComposerAutoloaderInit1e35666d44f6241113050f08f28e3325
+{
+    private static $loader;
+
+    public static function loadClassLoader($class)
+    {
+        if ('Composer\Autoload\ClassLoader' === $class) {
+            require __DIR__ . '/ClassLoader.php';
+        }
+    }
+
+    /**
+     * @return \Composer\Autoload\ClassLoader
+     */
+    public static function getLoader()
+    {
+        if (null !== self::$loader) {
+            return self::$loader;
+        }
+
+        spl_autoload_register(array('ComposerAutoloaderInit1e35666d44f6241113050f08f28e3325', 'loadClassLoader'), true, true);
+        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
+        spl_autoload_unregister(array('ComposerAutoloaderInit1e35666d44f6241113050f08f28e3325', 'loadClassLoader'));
+
+        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
+        if ($useStaticLoader) {
+            require_once __DIR__ . '/autoload_static.php';
+
+            call_user_func(\Composer\Autoload\ComposerStaticInit1e35666d44f6241113050f08f28e3325::getInitializer($loader));
+        } else {
+            $map = require __DIR__ . '/autoload_namespaces.php';
+            foreach ($map as $namespace => $path) {
+                $loader->set($namespace, $path);
+            }
+
+            $map = require __DIR__ . '/autoload_psr4.php';
+            foreach ($map as $namespace => $path) {
+                $loader->setPsr4($namespace, $path);
+            }
+
+            $classMap = require __DIR__ . '/autoload_classmap.php';
+            if ($classMap) {
+                $loader->addClassMap($classMap);
+            }
+        }
+
+        $loader->register(true);
+
+        if ($useStaticLoader) {
+            $includeFiles = Composer\Autoload\ComposerStaticInit1e35666d44f6241113050f08f28e3325::$files;
+        } else {
+            $includeFiles = require __DIR__ . '/autoload_files.php';
+        }
+        foreach ($includeFiles as $fileIdentifier => $file) {
+            composerRequire1e35666d44f6241113050f08f28e3325($fileIdentifier, $file);
+        }
+
+        return $loader;
+    }
+}
+
+function composerRequire1e35666d44f6241113050f08f28e3325($fileIdentifier, $file)
+{
+    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
+        require $file;
+
+        $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
+    }
+}

+ 169 - 0
vendor/composer/autoload_static.php

@@ -0,0 +1,169 @@
+<?php
+
+// autoload_static.php @generated by Composer
+
+namespace Composer\Autoload;
+
+class ComposerStaticInit1e35666d44f6241113050f08f28e3325
+{
+    public static $files = array (
+        '9b552a3cc426e3287cc811caefa3cf53' => __DIR__ . '/..' . '/topthink/think-helper/src/helper.php',
+        '35fab96057f1bf5e7aba31a8a6d5fdde' => __DIR__ . '/..' . '/topthink/think-orm/stubs/load_stubs.php',
+        '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
+        '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php',
+        'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.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',
+        '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
+    );
+
+    public static $prefixLengthsPsr4 = array (
+        't' => 
+        array (
+            'think\\view\\driver\\' => 18,
+            'think\\trace\\' => 12,
+            'think\\app\\' => 10,
+            'think\\' => 6,
+        ),
+        'a' => 
+        array (
+            'app\\' => 4,
+        ),
+        'S' => 
+        array (
+            'Symfony\\Polyfill\\Php80\\' => 23,
+            'Symfony\\Polyfill\\Php72\\' => 23,
+            'Symfony\\Polyfill\\Mbstring\\' => 26,
+            'Symfony\\Component\\VarDumper\\' => 28,
+        ),
+        'P' => 
+        array (
+            'Psr\\SimpleCache\\' => 16,
+            'Psr\\Log\\' => 8,
+            'Psr\\Http\\Message\\' => 17,
+            'Psr\\Container\\' => 14,
+            'Psr\\Cache\\' => 10,
+        ),
+        'L' => 
+        array (
+            'League\\MimeTypeDetection\\' => 25,
+            'League\\Flysystem\\Cached\\' => 24,
+            'League\\Flysystem\\' => 17,
+            'Lcobucci\\JWT\\' => 13,
+        ),
+    );
+
+    public static $prefixDirsPsr4 = array (
+        'think\\view\\driver\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/topthink/think-view/src',
+        ),
+        'think\\trace\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/topthink/think-trace/src',
+        ),
+        'think\\app\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/topthink/think-multi-app/src',
+        ),
+        'think\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/topthink/framework/src/think',
+            1 => __DIR__ . '/..' . '/topthink/think-filesystem/src',
+            2 => __DIR__ . '/..' . '/topthink/think-helper/src',
+            3 => __DIR__ . '/..' . '/topthink/think-orm/src',
+            4 => __DIR__ . '/..' . '/topthink/think-template/src',
+        ),
+        'app\\' => 
+        array (
+            0 => __DIR__ . '/../..' . '/app',
+        ),
+        'Symfony\\Polyfill\\Php80\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
+        ),
+        'Symfony\\Polyfill\\Php72\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/symfony/polyfill-php72',
+        ),
+        'Symfony\\Polyfill\\Mbstring\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
+        ),
+        'Symfony\\Component\\VarDumper\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/symfony/var-dumper',
+        ),
+        'Psr\\SimpleCache\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/psr/simple-cache/src',
+        ),
+        'Psr\\Log\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
+        ),
+        'Psr\\Http\\Message\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/psr/http-message/src',
+        ),
+        'Psr\\Container\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/psr/container/src',
+        ),
+        'Psr\\Cache\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/psr/cache/src',
+        ),
+        'League\\MimeTypeDetection\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/league/mime-type-detection/src',
+        ),
+        'League\\Flysystem\\Cached\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/league/flysystem-cached-adapter/src',
+        ),
+        'League\\Flysystem\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/league/flysystem/src',
+        ),
+        'Lcobucci\\JWT\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/lcobucci/jwt/src',
+        ),
+    );
+
+    public static $prefixesPsr0 = array (
+        'P' => 
+        array (
+            'PHPExcel' => 
+            array (
+                0 => __DIR__ . '/..' . '/phpoffice/phpexcel/Classes',
+            ),
+        ),
+    );
+
+    public static $fallbackDirsPsr0 = array (
+        0 => __DIR__ . '/../..' . '/extend',
+    );
+
+    public static $classMap = array (
+        'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
+        'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
+        'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
+        'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
+        'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
+    );
+
+    public static function getInitializer(ClassLoader $loader)
+    {
+        return \Closure::bind(function () use ($loader) {
+            $loader->prefixLengthsPsr4 = ComposerStaticInit1e35666d44f6241113050f08f28e3325::$prefixLengthsPsr4;
+            $loader->prefixDirsPsr4 = ComposerStaticInit1e35666d44f6241113050f08f28e3325::$prefixDirsPsr4;
+            $loader->prefixesPsr0 = ComposerStaticInit1e35666d44f6241113050f08f28e3325::$prefixesPsr0;
+            $loader->fallbackDirsPsr0 = ComposerStaticInit1e35666d44f6241113050f08f28e3325::$fallbackDirsPsr0;
+            $loader->classMap = ComposerStaticInit1e35666d44f6241113050f08f28e3325::$classMap;
+
+        }, null, ClassLoader::class);
+    }
+}

File diff suppressed because it is too large
+ 1364 - 0
vendor/composer/installed.json


+ 27 - 0
vendor/lcobucci/jwt/LICENSE

@@ -0,0 +1,27 @@
+Copyright (c) 2014-2015, Luís Otávio Cobucci Oblonczyk
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+
+* Neither the name of the {organization} nor the names of its
+  contributors may be used to endorse or promote products derived from
+  this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

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

@@ -0,0 +1,4 @@
+<?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);

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

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

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

@@ -0,0 +1,70 @@
+<?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);
+        }
+    }
+}

+ 57 - 0
vendor/lcobucci/jwt/composer.json

@@ -0,0 +1,57 @@
+{
+    "name": "lcobucci/jwt",
+    "description": "A simple library to work with JSON Web Token and JSON Web Signature",
+    "type": "library",
+    "authors": [
+        {
+            "name": "Luís Otávio Cobucci Oblonczyk",
+            "email": "lcobucci@gmail.com",
+            "role": "Developer"
+        }
+    ],
+    "keywords": [
+        "JWT",
+        "JWS"
+    ],
+    "license": [
+        "BSD-3-Clause"
+    ],
+    "require": {
+        "php": "^5.6 || ^7.0",
+        "ext-mbstring": "*",
+        "ext-openssl": "*"
+    },
+    "require-dev": {
+        "phpunit/phpunit": "^5.7 || ^7.3",
+        "squizlabs/php_codesniffer": "~2.3",
+        "phpmd/phpmd": "~2.2",
+        "phpunit/php-invoker": "~1.1",
+        "mikey179/vfsstream": "~1.5"
+    },
+    "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": {
+            "Lcobucci\\JWT\\": [
+                "test/unit",
+                "test/functional"
+            ]
+        }
+    },
+    "suggest": {
+        "lcobucci/clock": "*"
+    },
+    "extra": {
+        "branch-alias": {
+            "dev-master": "3.1-dev"
+        }
+    }
+}

+ 592 - 0
vendor/lcobucci/jwt/src/Builder.php

@@ -0,0 +1,592 @@
+<?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 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;
+
+/**
+ * This class makes easier the token creation process
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ */
+class Builder
+{
+    /**
+     * The token header
+     *
+     * @var array
+     */
+    private $headers = ['typ'=> 'JWT', 'alg' => 'none'];
+
+    /**
+     * The token claim set
+     *
+     * @var array
+     */
+    private $claims = [];
+
+    /**
+     * The data encoder
+     *
+     * @var Encoder
+     */
+    private $encoder;
+
+    /**
+     * The factory of claims
+     *
+     * @var ClaimFactory
+     */
+    private $claimFactory;
+
+    /**
+     * @var Signer|null
+     */
+    private $signer;
+
+    /**
+     * @var Key|null
+     */
+    private $key;
+
+    /**
+     * Initializes a new builder
+     *
+     * @param Encoder $encoder
+     * @param ClaimFactory $claimFactory
+     */
+    public function __construct(
+        Encoder $encoder = null,
+        ClaimFactory $claimFactory = null
+    ) {
+        $this->encoder = $encoder ?: new Encoder();
+        $this->claimFactory = $claimFactory ?: new ClaimFactory();
+    }
+
+    /**
+     * Configures the audience
+     *
+     * @deprecated This method has been wrongly added and doesn't exist on v4
+     * @see Builder::permittedFor()
+     *
+     * @param string $audience
+     * @param bool $replicateAsHeader
+     *
+     * @return Builder
+     */
+    public function canOnlyBeUsedBy($audience, $replicateAsHeader = false)
+    {
+        return $this->permittedFor($audience, $replicateAsHeader);
+    }
+
+    /**
+     * Configures the audience
+     *
+     * @param list<string|bool> $audiences A list of audiences and, optionally, the instruction to replicate as header
+     *
+     * @return Builder
+     */
+    public function permittedFor(...$audiences)
+    {
+        $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);
+    }
+
+    /**
+     * Configures the audience
+     *
+     * @deprecated This method will be removed on v4
+     * @see Builder::permittedFor()
+     *
+     * @param string $audience
+     * @param boolean $replicateAsHeader
+     *
+     * @return Builder
+     */
+    public function setAudience($audience, $replicateAsHeader = false)
+    {
+        return $this->permittedFor($audience, $replicateAsHeader);
+    }
+
+    /**
+     * Configures the expiration time
+     *
+     * @param int|DateTimeImmutable $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;
+    }
+
+    /**
+     * Configures the expiration time
+     *
+     * @deprecated This method will be removed on v4
+     * @see Builder::expiresAt()
+     *
+     * @param int|DateTimeImmutable $expiration
+     * @param boolean $replicateAsHeader
+     *
+     * @return Builder
+     */
+    public function setExpiration($expiration, $replicateAsHeader = false)
+    {
+        return $this->expiresAt($expiration, $replicateAsHeader);
+    }
+
+    /**
+     * Configures the token id
+     *
+     * @param string $id
+     * @param boolean $replicateAsHeader
+     *
+     * @return Builder
+     */
+    public function identifiedBy($id, $replicateAsHeader = false)
+    {
+        return $this->setRegisteredClaim('jti', (string) $id, $replicateAsHeader);
+    }
+
+    /**
+     * Configures the token id
+     *
+     * @deprecated This method will be removed on v4
+     * @see Builder::identifiedBy()
+     *
+     * @param string $id
+     * @param boolean $replicateAsHeader
+     *
+     * @return Builder
+     */
+    public function setId($id, $replicateAsHeader = false)
+    {
+        return $this->identifiedBy($id, $replicateAsHeader);
+    }
+
+    /**
+     * Configures the time that the token was issued
+     *
+     * @param int|DateTimeImmutable $issuedAt
+     * @param boolean $replicateAsHeader
+     *
+     * @return Builder
+     */
+    public function issuedAt($issuedAt, $replicateAsHeader = false)
+    {
+        return $this->setRegisteredClaim('iat', $this->convertToDate($issuedAt), $replicateAsHeader);
+    }
+
+    /**
+     * Configures the time that the token was issued
+     *
+     * @deprecated This method will be removed on v4
+     * @see Builder::issuedAt()
+     *
+     * @param int|DateTimeImmutable $issuedAt
+     * @param boolean $replicateAsHeader
+     *
+     * @return Builder
+     */
+    public function setIssuedAt($issuedAt, $replicateAsHeader = false)
+    {
+        return $this->issuedAt($issuedAt, $replicateAsHeader);
+    }
+
+    /**
+     * Configures the issuer
+     *
+     * @param string $issuer
+     * @param boolean $replicateAsHeader
+     *
+     * @return Builder
+     */
+    public function issuedBy($issuer, $replicateAsHeader = false)
+    {
+        return $this->setRegisteredClaim('iss', (string) $issuer, $replicateAsHeader);
+    }
+
+    /**
+     * Configures the issuer
+     *
+     * @deprecated This method will be removed on v4
+     * @see Builder::issuedBy()
+     *
+     * @param string $issuer
+     * @param boolean $replicateAsHeader
+     *
+     * @return Builder
+     */
+    public function setIssuer($issuer, $replicateAsHeader = false)
+    {
+        return $this->issuedBy($issuer, $replicateAsHeader);
+    }
+
+    /**
+     * Configures the time before which the token cannot be accepted
+     *
+     * @param int|DateTimeImmutable $notBefore
+     * @param boolean $replicateAsHeader
+     *
+     * @return Builder
+     */
+    public function canOnlyBeUsedAfter($notBefore, $replicateAsHeader = false)
+    {
+        return $this->setRegisteredClaim('nbf', $this->convertToDate($notBefore), $replicateAsHeader);
+    }
+
+    /**
+     * Configures the time before which the token cannot be accepted
+     *
+     * @deprecated This method will be removed on v4
+     * @see Builder::canOnlyBeUsedAfter()
+     *
+     * @param int|DateTimeImmutable $notBefore
+     * @param boolean $replicateAsHeader
+     *
+     * @return Builder
+     */
+    public function setNotBefore($notBefore, $replicateAsHeader = false)
+    {
+        return $this->canOnlyBeUsedAfter($notBefore, $replicateAsHeader);
+    }
+
+    /**
+     * Configures the subject
+     *
+     * @param string $subject
+     * @param boolean $replicateAsHeader
+     *
+     * @return Builder
+     */
+    public function relatedTo($subject, $replicateAsHeader = false)
+    {
+        return $this->setRegisteredClaim('sub', (string) $subject, $replicateAsHeader);
+    }
+
+    /**
+     * Configures the subject
+     *
+     * @deprecated This method will be removed on v4
+     * @see Builder::relatedTo()
+     *
+     * @param string $subject
+     * @param boolean $replicateAsHeader
+     *
+     * @return Builder
+     */
+    public function setSubject($subject, $replicateAsHeader = false)
+    {
+        return $this->relatedTo($subject, $replicateAsHeader);
+    }
+
+    /**
+     * Configures a registered claim
+     *
+     * @param string $name
+     * @param mixed $value
+     * @param boolean $replicate
+     *
+     * @return Builder
+     */
+    protected function setRegisteredClaim($name, $value, $replicate)
+    {
+        $this->configureClaim($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;
+        }
+
+        return $this;
+    }
+
+    /**
+     * Configures a header item
+     *
+     * @param string $name
+     * @param mixed $value
+     *
+     * @return Builder
+     */
+    public function withHeader($name, $value)
+    {
+        $this->headers[(string) $name] = $value;
+
+        return $this;
+    }
+
+    /**
+     * Configures a header item
+     *
+     * @deprecated This method will be removed on v4
+     * @see Builder::withHeader()
+     *
+     * @param string $name
+     * @param mixed $value
+     *
+     * @return Builder
+     */
+    public function setHeader($name, $value)
+    {
+        return $this->withHeader($name, $value);
+    }
+
+    /**
+     * Configures a claim item
+     *
+     * @deprecated This method has been wrongly added and doesn't exist on v4
+     * @see Builder::withClaim()
+     *
+     * @param string $name
+     * @param mixed $value
+     *
+     * @return Builder
+     */
+    public function with($name, $value)
+    {
+        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
+     *
+     * @param string $name
+     * @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);
+        }
+
+        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);
+        }
+    }
+
+    /**
+     * Configures a claim item
+     *
+     * @deprecated This method will be removed on v4
+     * @see Builder::withClaim()
+     *
+     * @param string $name
+     * @param mixed $value
+     *
+     * @return Builder
+     */
+    public function set($name, $value)
+    {
+        return $this->forwardCallToCorrectClaimMethod($name, $value);
+    }
+
+    /**
+     * Signs the data
+     *
+     * @deprecated This method will be removed on v4
+     * @see Builder::getToken()
+     *
+     * @param Signer $signer
+     * @param Key|string $key
+     *
+     * @return 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);
+        }
+
+        $this->signer = $signer;
+        $this->key = $key;
+
+        return $this;
+    }
+
+    /**
+     * Removes the signature from the builder
+     *
+     * @deprecated This method will be removed on v4
+     * @see Builder::getToken()
+     *
+     * @return Builder
+     */
+    public function unsign()
+    {
+        $this->signer = null;
+        $this->key = null;
+
+        return $this;
+    }
+
+    /**
+     * Returns the resultant token
+     *
+     * @return Token
+     */
+    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;
+
+        if ($signer instanceof Signer) {
+            $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();
+        }
+
+        $audience = RegisteredClaims::AUDIENCE;
+
+        if (array_key_exists($audience, $items) && is_array($items[$audience]) && count($items[$audience]) === 1) {
+            $items[$audience] = current($items[$audience]);
+        }
+
+        return $items;
+    }
+
+    /**
+     * @param string $payload
+     *
+     * @return Signature
+     */
+    private function createSignature($payload, Signer $signer = null, Key $key = null)
+    {
+        if ($signer === null || $key === null) {
+            return Signature::fromEmptyData();
+        }
+
+        $hash = $signer->sign($payload, $key)->hash();
+
+        return new Signature($hash, $this->encoder->base64UrlEncode($hash));
+    }
+}

+ 40 - 0
vendor/lcobucci/jwt/src/Claim.php

@@ -0,0 +1,40 @@
+<?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 JsonSerializable;
+
+/**
+ * Basic interface for token claims
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.0.0
+ */
+interface Claim extends JsonSerializable
+{
+    /**
+     * Returns the claim name
+     *
+     * @return string
+     */
+    public function getName();
+
+    /**
+     * Returns the claim value
+     *
+     * @return mixed
+     */
+    public function getValue();
+
+    /**
+     * Returns the string representation of the claim
+     *
+     * @return string
+     */
+    public function __toString();
+}

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

@@ -0,0 +1,75 @@
+<?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\Claim;
+
+/**
+ * The default claim
+ *
+ * @deprecated This class will be removed on v4
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.0.0
+ */
+class Basic implements Claim
+{
+    /**
+     * @var string
+     */
+    private $name;
+
+    /**
+     * @var mixed
+     */
+    private $value;
+
+    /**
+     * Initializes the claim
+     *
+     * @param string $name
+     * @param mixed $value
+     */
+    public function __construct($name, $value)
+    {
+        $this->name = $name;
+        $this->value = $value;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getValue()
+    {
+        return $this->value;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function jsonSerialize()
+    {
+        return $this->value;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function __toString()
+    {
+        return (string) $this->value;
+    }
+}

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

@@ -0,0 +1,34 @@
+<?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\Claim;
+use Lcobucci\JWT\ValidationData;
+
+/**
+ * Validatable claim that checks if value is strictly equals to the given data
+ *
+ * @deprecated This class will be removed on v4
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.0.0
+ */
+class EqualsTo extends Basic implements Claim, Validatable
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function validate(ValidationData $data)
+    {
+        if ($data->has($this->getName())) {
+            return $this->getValue() === $data->get($this->getName());
+        }
+
+        return true;
+    }
+}

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

@@ -0,0 +1,131 @@
+<?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 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
+ *
+ * @deprecated This class will be removed on v4
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.0.0
+ */
+class Factory
+{
+    /**
+     * The list of claim callbacks
+     *
+     * @var array
+     */
+    private $callbacks;
+
+    /**
+     * Initializes the factory, registering the default callbacks
+     *
+     * @param array $callbacks
+     */
+    public function __construct(array $callbacks = [])
+    {
+        $this->callbacks = array_merge(
+            [
+                'iat' => [$this, 'createLesserOrEqualsTo'],
+                'nbf' => [$this, 'createLesserOrEqualsTo'],
+                'exp' => [$this, 'createGreaterOrEqualsTo'],
+                'iss' => [$this, 'createEqualsTo'],
+                'aud' => [$this, 'createEqualsTo'],
+                'sub' => [$this, 'createEqualsTo'],
+                'jti' => [$this, 'createEqualsTo']
+            ],
+            $callbacks
+        );
+    }
+
+    /**
+     * Create a new claim
+     *
+     * @param string $name
+     * @param mixed $value
+     *
+     * @return Claim
+     */
+    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);
+        }
+
+        return $this->createBasic($name, $value);
+    }
+
+    /**
+     * Creates a claim that can be compared (greator or equals)
+     *
+     * @param string $name
+     * @param mixed $value
+     *
+     * @return GreaterOrEqualsTo
+     */
+    private function createGreaterOrEqualsTo($name, $value)
+    {
+        return new GreaterOrEqualsTo($name, $value);
+    }
+
+    /**
+     * Creates a claim that can be compared (greator or equals)
+     *
+     * @param string $name
+     * @param mixed $value
+     *
+     * @return LesserOrEqualsTo
+     */
+    private function createLesserOrEqualsTo($name, $value)
+    {
+        return new LesserOrEqualsTo($name, $value);
+    }
+
+    /**
+     * Creates a claim that can be compared (equals)
+     *
+     * @param string $name
+     * @param mixed $value
+     *
+     * @return EqualsTo
+     */
+    private function createEqualsTo($name, $value)
+    {
+        return new EqualsTo($name, $value);
+    }
+
+    /**
+     * Creates a basic claim
+     *
+     * @param string $name
+     * @param mixed $value
+     *
+     * @return Basic
+     */
+    private function createBasic($name, $value)
+    {
+        return new Basic($name, $value);
+    }
+}

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

@@ -0,0 +1,34 @@
+<?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\Claim;
+use Lcobucci\JWT\ValidationData;
+
+/**
+ * Validatable claim that checks if value is greater or equals the given data
+ *
+ * @deprecated This class will be removed on v4
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.0.0
+ */
+class GreaterOrEqualsTo extends Basic implements Claim, Validatable
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function validate(ValidationData $data)
+    {
+        if ($data->has($this->getName())) {
+            return $this->getValue() >= $data->get($this->getName());
+        }
+
+        return true;
+    }
+}

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

@@ -0,0 +1,34 @@
+<?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\Claim;
+use Lcobucci\JWT\ValidationData;
+
+/**
+ * Validatable claim that checks if value is lesser or equals to the given data
+ *
+ * @deprecated This class will be removed on v4
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.0.0
+ */
+class LesserOrEqualsTo extends Basic implements Claim, Validatable
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function validate(ValidationData $data)
+    {
+        if ($data->has($this->getName())) {
+            return $this->getValue() <= $data->get($this->getName());
+        }
+
+        return true;
+    }
+}

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

@@ -0,0 +1,30 @@
+<?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;
+
+/**
+ * Basic interface for validatable token claims
+ *
+ * @deprecated This interface will be removed on v4
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.0.0
+ */
+interface Validatable
+{
+    /**
+     * Returns if claim is valid according with given data
+     *
+     * @param ValidationData $data
+     *
+     * @return boolean
+     */
+    public function validate(ValidationData $data);
+}

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

@@ -0,0 +1,178 @@
+<?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;
+    }
+}

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

@@ -0,0 +1,26 @@
+<?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');
+    }
+}

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

@@ -0,0 +1,20 @@
+<?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);
+    }
+}

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

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

+ 175 - 0
vendor/lcobucci/jwt/src/Parser.php

@@ -0,0 +1,175 @@
+<?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 DateTimeImmutable;
+use InvalidArgumentException;
+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
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ */
+class Parser
+{
+    /**
+     * The data decoder
+     *
+     * @var Decoder
+     */
+    private $decoder;
+
+    /**
+     * Initializes the object
+     *
+     * @param Decoder $decoder
+     */
+    public function __construct(Decoder $decoder = null)
+    {
+        $this->decoder = $decoder ?: new Decoder();
+    }
+
+    /**
+     * Parses the JWT and returns a token
+     *
+     * @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)
+    {
+        $data = $this->splitJwt($jwt);
+        $header = $this->parseHeader($data[0]);
+        $claims = $this->parseClaims($data[1]);
+        $signature = $this->parseSignature($header, $data[2]);
+
+        foreach ($claims as $name => $value) {
+            if (isset($header[$name])) {
+                $header[$name] = $value;
+            }
+        }
+
+        return new Token(
+            new DataSet($header, $data[0]),
+            new DataSet($claims, $data[1]),
+            $signature,
+            ['', '']
+        );
+    }
+
+    /**
+     * Splits the JWT string into an array
+     *
+     * @param string $jwt
+     *
+     * @return array
+     *
+     * @throws InvalidArgumentException When JWT is not a string or is invalid
+     */
+    protected function splitJwt($jwt)
+    {
+        if (!is_string($jwt)) {
+            throw InvalidTokenStructure::missingOrNotEnoughSeparators();
+        }
+
+        $data = explode('.', $jwt);
+
+        if (count($data) != 3) {
+            throw InvalidTokenStructure::missingOrNotEnoughSeparators();
+        }
+
+        return $data;
+    }
+
+    /**
+     * Parses the header from a string
+     *
+     * @param string $data
+     *
+     * @return array
+     *
+     * @throws UnsupportedHeaderFound 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();
+        }
+
+        return $this->convertItems($header);
+    }
+
+    /**
+     * Parses the claim set from a string
+     *
+     * @param string $data
+     *
+     * @return array
+     */
+    protected function parseClaims($data)
+    {
+        $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]];
+        }
+
+        return $items;
+    }
+
+    /**
+     * Returns the signature from given data
+     *
+     * @param array $header
+     * @param string $data
+     *
+     * @return Signature
+     */
+    protected function parseSignature(array $header, $data)
+    {
+        if ($data == '' || !isset($header['alg']) || $header['alg'] == 'none') {
+            return Signature::fromEmptyData();
+        }
+
+        $hash = $this->decoder->base64UrlDecode($data);
+
+        return new Signature($hash, $data);
+    }
+}

+ 70 - 0
vendor/lcobucci/jwt/src/Parsing/Decoder.php

@@ -0,0 +1,70 @@
+<?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;
+
+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
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ *
+ * @link http://tools.ietf.org/html/rfc4648#section-5
+ */
+class Decoder
+{
+    /**
+     * Decodes from JSON, validating the errors (will return an associative array
+     * instead of objects)
+     *
+     * @param string $json
+     * @return mixed
+     *
+     * @throws RuntimeException When something goes wrong while decoding
+     */
+    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()));
+            }
+
+            return $data;
+        }
+
+        try {
+            return json_decode($json, false, 512, JSON_THROW_ON_ERROR);
+        } catch (JsonException $exception) {
+            throw CannotDecodeContent::jsonIssues($exception);
+        }
+    }
+
+    /**
+     * Decodes from base64url
+     *
+     * @param string $data
+     * @return string
+     */
+    public function base64UrlDecode($data)
+    {
+        if ($remainder = strlen($data) % 4) {
+            $data .= str_repeat('=', 4 - $remainder);
+        }
+
+        return base64_decode(strtr($data, '-_', '+/'));
+    }
+}

+ 65 - 0
vendor/lcobucci/jwt/src/Parsing/Encoder.php

@@ -0,0 +1,65 @@
+<?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;
+
+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
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ *
+ * @link http://tools.ietf.org/html/rfc4648#section-5
+ */
+class Encoder
+{
+    /**
+     * Encodes to JSON, validating the errors
+     *
+     * @param mixed $data
+     * @return string
+     *
+     * @throws RuntimeException When something goes wrong while encoding
+     */
+    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()));
+            }
+
+            return $json;
+        }
+
+        try {
+            return json_encode($data, JSON_THROW_ON_ERROR);
+        } catch (JsonException $exception) {
+            throw CannotEncodeContent::jsonIssues($exception);
+        }
+    }
+
+    /**
+     * Encodes to base64url
+     *
+     * @param string $data
+     * @return string
+     */
+    public function base64UrlEncode($data)
+    {
+        return str_replace('=', '', strtr(base64_encode($data), '+/', '-_'));
+    }
+}

+ 87 - 0
vendor/lcobucci/jwt/src/Signature.php

@@ -0,0 +1,87 @@
+<?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\Signer\Key;
+
+/**
+ * This class represents a token signature
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ */
+class Signature
+{
+    /**
+     * The resultant hash
+     *
+     * @var string
+     */
+    protected $hash;
+
+    /** @var string */
+    private $encoded;
+
+    /**
+     * Initializes the object
+     *
+     * @param string $hash
+     * @param string $encoded
+     */
+    public function __construct($hash, $encoded = '')
+    {
+        $this->hash    = $hash;
+        $this->encoded = $encoded;
+    }
+
+    /** @return self */
+    public static function fromEmptyData()
+    {
+        return new self('', '');
+    }
+
+    /**
+     * Verifies if the current hash matches with with the result of the creation of
+     * a new signature with given data
+     *
+     * @param Signer $signer
+     * @param string $payload
+     * @param Key|string $key
+     *
+     * @return boolean
+     */
+    public function verify(Signer $signer, $payload, $key)
+    {
+        return $signer->verify($this->hash, $payload, $key);
+    }
+
+    /**
+     * 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;
+    }
+}

+ 59 - 0
vendor/lcobucci/jwt/src/Signer.php

@@ -0,0 +1,59 @@
+<?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 InvalidArgumentException;
+use Lcobucci\JWT\Signer\Key;
+
+/**
+ * Basic interface for token signers
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ */
+interface Signer
+{
+    /**
+     * Returns the algorithm id
+     *
+     * @return string
+     */
+    public function getAlgorithmId();
+
+    /**
+     * Apply changes on headers according with algorithm
+     *
+     * @param array $headers
+     */
+    public function modifyHeader(array &$headers);
+
+    /**
+     * Returns a signature for given data
+     *
+     * @param string $payload
+     * @param Key|string $key
+     *
+     * @return Signature
+     *
+     * @throws InvalidArgumentException When given key is invalid
+     */
+    public function sign($payload, $key);
+
+    /**
+     * Returns if the expected hash matches with the data and key
+     *
+     * @param string $expected
+     * @param string $payload
+     * @param Key|string $key
+     *
+     * @return boolean
+     *
+     * @throws InvalidArgumentException When given key is invalid
+     */
+    public function verify($expected, $payload, $key);
+}

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

@@ -0,0 +1,89 @@
+<?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;
+use Lcobucci\JWT\Signer;
+use function trigger_error;
+use const E_USER_DEPRECATED;
+
+/**
+ * Base class for signers
+ *
+ * @deprecated This class will be removed on v4
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ */
+abstract class BaseSigner implements Signer
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function modifyHeader(array &$headers)
+    {
+        $headers['alg'] = $this->getAlgorithmId();
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function sign($payload, $key)
+    {
+        return new Signature($this->createHash($payload, $this->getKey($key)));
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function verify($expected, $payload, $key)
+    {
+        return $this->doVerify($expected, $payload, $this->getKey($key));
+    }
+
+    /**
+     * @param Key|string $key
+     *
+     * @return Key
+     */
+    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);
+        }
+
+        return $key;
+    }
+
+    /**
+     * Creates a hash with the given data
+     *
+     * @internal
+     *
+     * @param string $payload
+     * @param Key $key
+     *
+     * @return string
+     */
+    abstract public function createHash($payload, Key $key);
+
+    /**
+     * Performs the signature verification
+     *
+     * @internal
+     *
+     * @param string $expected
+     * @param string $payload
+     * @param Key $key
+     *
+     * @return boolean
+     */
+    abstract public function doVerify($expected, $payload, Key $key);
+}

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

@@ -0,0 +1,19 @@
+<?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);
+    }
+}

+ 69 - 0
vendor/lcobucci/jwt/src/Signer/Ecdsa.php

@@ -0,0 +1,69 @@
+<?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\Signer\Ecdsa\MultibyteStringConverter;
+use Lcobucci\JWT\Signer\Ecdsa\SignatureConverter;
+use const OPENSSL_KEYTYPE_EC;
+
+/**
+ * Base class for ECDSA signers
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.1.0
+ */
+abstract class Ecdsa extends OpenSSL
+{
+    /**
+     * @var SignatureConverter
+     */
+    private $converter;
+
+    public function __construct(SignatureConverter $converter = null)
+    {
+        $this->converter = $converter ?: new MultibyteStringConverter();
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function createHash($payload, Key $key)
+    {
+        return $this->converter->fromAsn1(
+            parent::createHash($payload, $key),
+            $this->getKeyLength()
+        );
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function doVerify($expected, $payload, Key $key)
+    {
+        return parent::doVerify(
+            $this->converter->toAsn1($expected, $this->getKeyLength()),
+            $payload,
+            $key
+        );
+    }
+
+    /**
+     * Returns the length of each point in the signature, so that we can calculate and verify R and S points properly
+     *
+     * @internal
+     */
+    abstract public function getKeyLength();
+
+    /**
+     * {@inheritdoc}
+     */
+    final public function getKeyType()
+    {
+        return OPENSSL_KEYTYPE_EC;
+    }
+}

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

@@ -0,0 +1,27 @@
+<?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.');
+    }
+}

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

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

+ 43 - 0
vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha256.php

@@ -0,0 +1,43 @@
+<?php
+/**
+ * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
+ *
+ * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
+ */
+
+namespace Lcobucci\JWT\Signer\Ecdsa;
+
+use Lcobucci\JWT\Signer\Ecdsa;
+
+/**
+ * Signer for ECDSA SHA-256
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.1.0
+ */
+class Sha256 extends Ecdsa
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function getAlgorithmId()
+    {
+        return 'ES256';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getAlgorithm()
+    {
+        return 'sha256';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getKeyLength()
+    {
+        return 64;
+    }
+}

+ 43 - 0
vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha384.php

@@ -0,0 +1,43 @@
+<?php
+/**
+ * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
+ *
+ * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
+ */
+
+namespace Lcobucci\JWT\Signer\Ecdsa;
+
+use Lcobucci\JWT\Signer\Ecdsa;
+
+/**
+ * Signer for ECDSA SHA-384
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.1.0
+ */
+class Sha384 extends Ecdsa
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function getAlgorithmId()
+    {
+        return 'ES384';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getAlgorithm()
+    {
+        return 'sha384';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getKeyLength()
+    {
+        return 96;
+    }
+}

+ 43 - 0
vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha512.php

@@ -0,0 +1,43 @@
+<?php
+/**
+ * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
+ *
+ * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
+ */
+
+namespace Lcobucci\JWT\Signer\Ecdsa;
+
+use Lcobucci\JWT\Signer\Ecdsa;
+
+/**
+ * Signer for ECDSA SHA-512
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.1.0
+ */
+class Sha512 extends Ecdsa
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function getAlgorithmId()
+    {
+        return 'ES512';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getAlgorithm()
+    {
+        return 'sha512';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getKeyLength()
+    {
+        return 132;
+    }
+}

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

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

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

@@ -0,0 +1,46 @@
+<?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;
+
+/**
+ * Base class for hmac signers
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ */
+abstract class Hmac extends BaseSigner
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function createHash($payload, Key $key)
+    {
+        return hash_hmac($this->getAlgorithm(), $payload, $key->getContent(), true);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function doVerify($expected, $payload, Key $key)
+    {
+        if (!is_string($expected)) {
+            return false;
+        }
+
+        return hash_equals($expected, $this->createHash($payload, $key));
+    }
+
+    /**
+     * Returns the algorithm name
+     *
+     * @internal
+     *
+     * @return string
+     */
+    abstract public function getAlgorithm();
+}

+ 35 - 0
vendor/lcobucci/jwt/src/Signer/Hmac/Sha256.php

@@ -0,0 +1,35 @@
+<?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;
+
+use Lcobucci\JWT\Signer\Hmac;
+
+/**
+ * Signer for HMAC SHA-256
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ */
+class Sha256 extends Hmac
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function getAlgorithmId()
+    {
+        return 'HS256';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getAlgorithm()
+    {
+        return 'sha256';
+    }
+}

+ 35 - 0
vendor/lcobucci/jwt/src/Signer/Hmac/Sha384.php

@@ -0,0 +1,35 @@
+<?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;
+
+use Lcobucci\JWT\Signer\Hmac;
+
+/**
+ * Signer for HMAC SHA-384
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ */
+class Sha384 extends Hmac
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function getAlgorithmId()
+    {
+        return 'HS384';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getAlgorithm()
+    {
+        return 'sha384';
+    }
+}

+ 35 - 0
vendor/lcobucci/jwt/src/Signer/Hmac/Sha512.php

@@ -0,0 +1,35 @@
+<?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;
+
+use Lcobucci\JWT\Signer\Hmac;
+
+/**
+ * Signer for HMAC SHA-512
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ */
+class Sha512 extends Hmac
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function getAlgorithmId()
+    {
+        return 'HS512';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getAlgorithm()
+    {
+        return 'sha512';
+    }
+}

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

@@ -0,0 +1,25 @@
+<?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');
+    }
+}

+ 117 - 0
vendor/lcobucci/jwt/src/Signer/Key.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 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
+{
+    /**
+     * @var string
+     */
+    protected $content;
+
+    /**
+     * @var string
+     */
+    private $passphrase;
+
+    /**
+     * @param string $content
+     * @param string $passphrase
+     */
+    public function __construct($content, $passphrase = '')
+    {
+        $this->setContent($content);
+        $this->passphrase = $passphrase;
+    }
+
+    /**
+     * @param string $content
+     *
+     * @throws InvalidArgumentException
+     */
+    private function setContent($content)
+    {
+        if (strpos($content, 'file://') === 0) {
+            $content = $this->readFile($content);
+        }
+
+        $this->content = $content;
+    }
+
+    /**
+     * @param string $content
+     *
+     * @return string
+     *
+     * @throws InvalidArgumentException
+     */
+    private function readFile($content)
+    {
+        $path = substr($content, 7);
+
+        try {
+            $file = new SplFileObject($path);
+        } catch (Exception $exception) {
+            throw FileCouldNotBeRead::onPath($path, $exception);
+        }
+
+        $content = '';
+
+        while (! $file->eof()) {
+            $content .= $file->fgets();
+        }
+
+        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()
+    {
+        return $this->content;
+    }
+
+    /**
+     * @deprecated This method is no longer part of the public interface
+     * @see Key::passphrase()
+     *
+     * @return string
+     */
+    public function getPassphrase()
+    {
+        return $this->passphrase;
+    }
+}

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

@@ -0,0 +1,39 @@
+<?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
+            );
+        }
+    }
+}

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

@@ -0,0 +1,52 @@
+<?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);
+    }
+}

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

@@ -0,0 +1,32 @@
+<?php
+
+namespace Lcobucci\JWT\Signer\Key;
+
+use Lcobucci\JWT\Signer\Key;
+
+use function file_exists;
+use function strpos;
+use function substr;
+
+/** @deprecated Use \Lcobucci\JWT\Signer\Key\InMemory::file() instead */
+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);
+        }
+
+        return new self(self::PATH_PREFIX . $path, $passphrase);
+    }
+}

+ 44 - 0
vendor/lcobucci/jwt/src/Signer/Keychain.php

@@ -0,0 +1,44 @@
+<?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;
+
+/**
+ * A utilitarian class that encapsulates the retrieval of public and private keys
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.1.0
+ *
+ * @deprecated Since we've removed OpenSSL from ECDSA there's no reason to use this class
+ */
+class Keychain
+{
+    /**
+     * Returns a private key from file path or content
+     *
+     * @param string $key
+     * @param string $passphrase
+     *
+     * @return Key
+     */
+    public function getPrivateKey($key, $passphrase = null)
+    {
+        return new Key($key, $passphrase);
+    }
+
+    /**
+     * Returns a public key from file path or content
+     *
+     * @param string $certificate
+     *
+     * @return Key
+     */
+    public function getPublicKey($certificate)
+    {
+        return new Key($certificate);
+    }
+}

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

@@ -0,0 +1,21 @@
+<?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 === '';
+    }
+}

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

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

+ 24 - 0
vendor/lcobucci/jwt/src/Signer/Rsa.php

@@ -0,0 +1,24 @@
+<?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 const OPENSSL_KEYTYPE_RSA;
+
+/**
+ * Base class for RSASSA-PKCS1 signers
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.1.0
+ */
+abstract class Rsa extends OpenSSL
+{
+    final public function getKeyType()
+    {
+        return OPENSSL_KEYTYPE_RSA;
+    }
+}

+ 35 - 0
vendor/lcobucci/jwt/src/Signer/Rsa/Sha256.php

@@ -0,0 +1,35 @@
+<?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;
+
+use Lcobucci\JWT\Signer\Rsa;
+
+/**
+ * Signer for RSA SHA-256
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.1.0
+ */
+class Sha256 extends Rsa
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function getAlgorithmId()
+    {
+        return 'RS256';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getAlgorithm()
+    {
+        return OPENSSL_ALGO_SHA256;
+    }
+}

+ 35 - 0
vendor/lcobucci/jwt/src/Signer/Rsa/Sha384.php

@@ -0,0 +1,35 @@
+<?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;
+
+use Lcobucci\JWT\Signer\Rsa;
+
+/**
+ * Signer for RSA SHA-384
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.1.0
+ */
+class Sha384 extends Rsa
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function getAlgorithmId()
+    {
+        return 'RS384';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getAlgorithm()
+    {
+        return OPENSSL_ALGO_SHA384;
+    }
+}

+ 35 - 0
vendor/lcobucci/jwt/src/Signer/Rsa/Sha512.php

@@ -0,0 +1,35 @@
+<?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;
+
+use Lcobucci\JWT\Signer\Rsa;
+
+/**
+ * Signer for RSA SHA-512
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 2.1.0
+ */
+class Sha512 extends Rsa
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function getAlgorithmId()
+    {
+        return 'RS512';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getAlgorithm()
+    {
+        return OPENSSL_ALGO_SHA512;
+    }
+}

+ 430 - 0
vendor/lcobucci/jwt/src/Token.php

@@ -0,0 +1,430 @@
+<?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 DateTimeImmutable;
+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
+ *
+ * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
+ * @since 0.1.0
+ */
+class Token
+{
+    /**
+     * The token headers
+     *
+     * @var DataSet
+     */
+    private $headers;
+
+    /**
+     * The token claim set
+     *
+     * @var DataSet
+     */
+    private $claims;
+
+    /**
+     * The token signature
+     *
+     * @var Signature
+     */
+    private $signature;
+
+    /**
+     * @internal This serves just as compatibility layer
+     *
+     * @var Factory
+     */
+    private $claimFactory;
+
+    /**
+     * Initializes the object
+     *
+     * @param array|DataSet $headers
+     * @param array|DataSet $claims
+     * @param Signature|null $signature
+     * @param array $payload
+     * @param Factory|null $claimFactory
+     */
+    public function __construct(
+        $headers = ['alg' => 'none'],
+        $claims = [],
+        Signature $signature = null,
+        array $payload = ['', ''],
+        Factory $claimFactory = null
+    ) {
+        $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;
+    }
+
+    /**
+     * 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;
+    }
+
+    /**
+     * 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);
+    }
+
+    /**
+     * 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
+     *
+     * @return mixed
+     *
+     * @throws OutOfBoundsException
+     */
+    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));
+        }
+
+        return $this->headers->get($name, $default);
+    }
+
+    /** @return DataSet */
+    public function claims()
+    {
+        return $this->claims;
+    }
+
+    /**
+     * 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;
+    }
+
+    /**
+     * 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);
+    }
+
+    /**
+     * 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
+     *
+     * @return mixed
+     *
+     * @throws OutOfBoundsException
+     */
+    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));
+        }
+
+        $value = $this->claims->get($name, $default);
+
+        if ($value instanceof DateTimeImmutable && in_array($name, RegisteredClaims::DATE_CLAIMS, true)) {
+            return $value->getTimestamp();
+        }
+
+        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;
+    }
+
+    /**
+     * 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
+     *
+     * @return boolean
+     */
+    public function verify(Signer $signer, $key)
+    {
+        if ($this->headers->get('alg') !== $signer->getAlgorithmId()) {
+            return false;
+        }
+
+        return $this->signature->verify($signer, $this->getPayload(), $key);
+    }
+
+    /**
+     * 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
+     */
+    public function validate(ValidationData $data)
+    {
+        foreach ($this->getValidatableClaims() as $claim) {
+            if (!$claim->validate($data)) {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    /**
+     * Determine if the token is expired.
+     *
+     * @param DateTimeInterface|null $now Defaults to the current time.
+     *
+     * @return bool
+     */
+    public function isExpired(DateTimeInterface $now = null)
+    {
+        if (! $this->claims->has('exp')) {
+            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 DateTimeImmutable();
+
+        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);
+    }
+
+    /**
+     * Yields the validatable claims
+     *
+     * @return Generator
+     */
+    private function getValidatableClaims()
+    {
+        foreach ($this->getClaims() as $claim) {
+            if ($claim instanceof Validatable) {
+                yield $claim;
+            }
+        }
+    }
+
+    /**
+     * 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;
+    }
+
+    /**
+     * 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();
+    }
+
+    /** @return string */
+    public function toString()
+    {
+        return $this->headers->toString() . '.'
+             . $this->claims->toString() . '.'
+             . $this->signature->toString();
+    }
+}

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

@@ -0,0 +1,56 @@
+<?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;
+    }
+}

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

@@ -0,0 +1,35 @@
+<?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);
+    }
+}

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

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

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

@@ -0,0 +1,24 @@
+<?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));
+    }
+}

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

@@ -0,0 +1,76 @@
+<?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';
+}

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

@@ -0,0 +1,8 @@
+<?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);

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

@@ -0,0 +1,15 @@
+<?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');
+    }
+}

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

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

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

@@ -0,0 +1,28 @@
+<?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'
+            );
+        }
+    }
+}

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

@@ -0,0 +1,28 @@
+<?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'
+            );
+        }
+    }
+}

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

@@ -0,0 +1,15 @@
+<?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');
+    }
+}

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

@@ -0,0 +1,27 @@
+<?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'
+            );
+        }
+    }
+}

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

@@ -0,0 +1,27 @@
+<?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'
+            );
+        }
+    }
+}

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

@@ -0,0 +1,34 @@
+<?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');
+        }
+    }
+}

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

@@ -0,0 +1,72 @@
+<?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');
+        }
+    }
+}

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

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

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

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

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

@@ -0,0 +1,53 @@
+<?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 - 0
vendor/lcobucci/jwt/src/Validation/Validator.php


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