moux2003/guzzle-bundle-sastoken-plugin
Composer 安装命令:
composer require moux2003/guzzle-bundle-sastoken-plugin
包简介
SAS Token Plugin for Guzzle Bundle, a PHP HTTP client library and framework for building RESTful web service clients
关键字:
README 文档
README
This plugin integrates SAS Token (Azure) functionality into Guzzle Bundle, a bundle for building RESTful web service clients.
Requirements
Installation
Using composer:
composer.json
{
"require": {
"moux2003/guzzle-bundle-sastoken-plugin": "~1.0"
}
}
command line
$ composer require moux2003/guzzle-bundle-sastoken-plugin
Usage
Enable bundle
# app/AppKernel.php new EightPoints\Bundle\GuzzleBundle\EightPointsGuzzleBundle([ new Moux2003\GuzzleBundleSasTokenPlugin\GuzzleBundleSasTokenPlugin(), ])
Basic configuration
# app/config/config.yml eight_points_guzzle: clients: api_azure: base_url: "https://namespace.windows.net" # define headers, options # plugin settings plugin: sasToken: connectionString: "Endpoint=scheme://namespace.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=HaShEdKey" expires: 60 # optional
Usage with guzzle
<?php $sasToken = new \Moux2003\GuzzleBundleSasTokenPlugin\Middleware\SasTokenAuthMiddleware($connectionString); $stack = \GuzzleHttp\HandlerStack::create(); // Add the sasToken middleware to the handler stack. $stack->push($sasToken->attach()); $client = new \GuzzleHttp\Client(['handler' => $stack]); $response = $client->post('https://namespace.windows.net/hubname/messages?api-version=2013-10');
License
This middleware is licensed under the MIT License - see the LICENSE file for details
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-02-19