moux2003/guzzle-bundle-sastoken-plugin 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

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

Latest Version Software License

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-02-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固