承接 devianl2/service-logging 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

devianl2/service-logging

最新稳定版本:1.0.1

Composer 安装命令:

composer require devianl2/service-logging

包简介

Microservice logging

README 文档

README

Tenant auth is a laravel package that validate JWT token and its claim properties and set into request header

For each microservice development, you need to follow instruction below to ensure the application is standardize.

Step 1:

Install from composer

composer require devianl2/tenant-auth

Run the following command for public key config

php artisan vendor:publish --provider="Tenant\Auth\TenantAuthProvider"

Step 2:

To use this package, make sure any API request does have Authorization header and Web request does have Authorization key in cookie

Go to App\Http\Middleware\Kernel and add the following syntax

 protected $middleware = [
        // \App\Http\Middleware\TrustHosts::class,
        \App\Http\Middleware\TrustProxies::class,
        ...
        **\Tenant\Auth\Middleware\TenantAuthMiddleware::class**
    ];

Step 3 (Optional:

If you are using in $routeMiddleware and define the middleware group by your own, you may do the following action:

Go to App\Http\Kernel to add your own route middleware like following:

protected $routeMiddleware = [
        .....
        'tenant-auth'   =>  \Tenant\Auth\Middleware\TenantAuthMiddleware::class
    ];

Go to App\Http\Middleware\EncryptCookies and add Authorization into except array because Laravel Cookie has encrpytion for all values by default but the Authorization token encrpytion is not needed in this case since it was generated by gateway.

protected $except = [
        'Authorization'
    ];

Go to App\Http\Middleware\Kernel and add the following syntax

 protected $middleware = [
        // \App\Http\Middleware\TrustHosts::class,
        \App\Http\Middleware\TrustProxies::class,
        ...
        **\Tenant\Auth\Middleware\TenantAuthMiddleware::class**
    ];

Note:

This package will automatic extract the following information if JWT token is valid:

  • x-user-uuid (Current user's uuid)
  • x-tenant-uuid (Current user's tenant id)
  • x-tenant-url (Current user's tenant url)
  • x-scopes (Current user's permissions / json encoded)
  • x-roles (Current user's roles. E.g: admin/users. / Json encoded)
  • x-modules (Module that user could access / json encoded)

You may use $request to extract the information in controller E.g $request->header('x-user-uuid');

统计信息

  • 总下载量: 60
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-08-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固