Download the PHP package mitoop/laravel-signature-guard without Composer

On this page you can find all versions of the php package mitoop/laravel-signature-guard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-signature-guard

Laravel Request Guard

系统间接口调用是开发中经常遇到的场景, 安全, 客户端发起请求方便, 服务端处理请求方便, 灵活的配置等都是设计时候考量的因素.

安全 :

系统间接口交互通常都是基于 HMAC (消息认证码)的方式来保证安全, HMAC 有哈希, 有密匙, 密匙保存在服务端, 所以很适合系统间接口的安全验证.

Laravel Request Guard 使用 sha256 哈希函数, sha256目前足够安全(相对于sha1 md5) 快速(相对于sha3).

Laravel Request Guard 使用 nonce + timestamp 来防止重放攻击.

请求 :

Laravel Request Guard 依赖并使用 guzzle/guzzle 来完成请求发起, 参数设置和 guzzle/guzzle 保持一致, 同时在使用上运用了 Laravel Manager 的语法糖, 构建请求方便灵活, 详情看下方 请求 部分.

响应 :

每次请求总会返回 \Mitoop\ApiSignature\SignatureResponse 对象(即使服务端发生了异常), 该对象提供了简洁有力的方法来告别try catch. 详情看下方 响应 部分.

配置 :

配置支持多客户端, 并且支持同时充当客户端和服务端.

须知 :

只支持 Laravel.

安装 Install

composer require mitoop/laravel-signature-guard

要求 Require

配置 Config

1 . 安装过后运行 php artisan vendor:publish --provider="Mitoop\Signature\ServiceProvider",会生成 config/api-clients.php 配置文件.

2 . 如果需要使用 Facade

3 . api-clients.php 配置说明

请求 Request

请求支持 get, post, put, delete 四种方法. 下面以 post 方法为例. 假如设置了aliasClient

向其他客户端发起请求 这个时候需要指定 connect 的客户端

响应 Response

每次请求总会返回 \Mitoop\Signature\SignatureResponse 对象(即使服务端发生了异常), 该对象提供了简洁有力的方法来告别try catch.

更多使用方法参考 这里

事件 Events

requesting 和 requested 是请求前和请求后的事件,可以方便地对请求进行额外的处理.

作为服务端

Laravel Request Guard 使用 Laravel 本身提供的 guard 机制来完成身份验证.

首先需要配置一个 guard :

其次定义路由中间件, Laravel Request Guard 本身提供了一个中间件 \Mitoop\Signature\Middleware\RequestGuardAuth 假如你使用该中间件 那么在 \App\Http\Kernel$routeMiddleware 上配置 :

\Mitoop\Signature\Middleware\RequestGuardAuth 中间件非常简单, 你也可以自己定义一个中间件.

最后在路由里使用 auth.signature:server-api 中间件就可以了

其他可用的 Auth 方法

Contributor

zhuzhichao


All versions of laravel-signature-guard with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.3
ext-json Version *
guzzlehttp/guzzle Version ^6.3
illuminate/support Version 5.8.*
moontoast/math Version ^1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mitoop/laravel-signature-guard contains the following files

Loading the files please wait ....