2017 © Pedro Peláez
 

library guzzle-bundle-wsse-plugin

WSSE Plugin for Guzzle Bundle, a PHP HTTP client library and framework for building RESTful web service clients

image

gregurco/guzzle-bundle-wsse-plugin

WSSE Plugin for Guzzle Bundle, a PHP HTTP client library and framework for building RESTful web service clients

  • Wednesday, May 9, 2018
  • by gregurco
  • Repository
  • 2 Watchers
  • 4 Stars
  • 2,195 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 79 % Grown

The README.md

Guzzle Bundle WSSE Plugin

Build Status Coverage Status SensioLabsInsight, (*1)

This plugin integrates WSSE functionality into Guzzle Bundle, a bundle for building RESTful web service clients., (*2)

Requirements

Installation

Using [composer][3]:, (*3)

composer.json

``` json { "require": { "gregurco/guzzle-bundle-wsse-plugin": "dev-master" } }, (*4)


##### command line ``` bash $ composer require gregurco/guzzle-bundle-wsse-plugin

Usage

Enable bundle

Symfony 2.x and 3.x

Plugin will be activated/connected through bundle constructor in app/AppKernel.php, like this:, (*5)

``` php new EightPoints\Bundle\GuzzleBundle\EightPointsGuzzleBundle([ new Gregurco\Bundle\GuzzleBundleWssePlugin\GuzzleBundleWssePlugin(), ]), (*6)


#### Symfony 4 The registration of bundles was changed in Symfony 4 and now you have to change `src/Kernel.php` to achieve the same functionality. Find next lines: ```php foreach ($contents as $class => $envs) { if (isset($envs['all']) || isset($envs[$this->environment])) { yield new $class(); } }

and replace them by:, (*7)

foreach ($contents as $class => $envs) {
    if (isset($envs['all']) || isset($envs[$this->environment])) {
        if ($class === \EightPoints\Bundle\GuzzleBundle\EightPointsGuzzleBundle::class) {
            yield new $class([
                new \Gregurco\Bundle\GuzzleBundleWssePlugin\GuzzleBundleWssePlugin(),
            ]);
        } else {
            yield new $class();
        }
    }
}

Basic configuration

``` yaml, (*8)

app/config/config.yml

eight_points_guzzle: clients: api_payment: base_url: "http://api.domain.tld", (*9)

        # define headers, options

        # plugin settings
        plugin:
            wsse:
                username:   "acme"
                password:   "pa55w0rd"
                created_at: "-10 seconds" # optional

## Usage with guzzle ``` php <?php # Optional: Set third parameter by a expression (if not, current time will be used automatically) # http://php.net/manual/en/datetime.formats.relative.php # Useful if there is a small difference of time between client and server # DateTime object will be regenerated for every request $wsse = new \Gregurco\Bundle\GuzzleBundleWssePlugin\Middleware\WsseAuthMiddleware($username, $password); $stack = \GuzzleHttp\HandlerStack::create(); // Add the wsse middleware to the handler stack. $stack->push($wsse->attach()); $client = new \GuzzleHttp\Client(['handler' => $stack]); $response = $client->get('http://www.8points.de');

License

This middleware is licensed under the MIT License - see the LICENSE file for details, (*10)

The Versions

09/05 2018

dev-master

9999999-dev https://github.com/gregurco/GuzzleBundleWssePlugin

WSSE Plugin for Guzzle Bundle, a PHP HTTP client library and framework for building RESTful web service clients

  Sources   Download

MIT

The Requires

 

The Development Requires

plugin middleware curl framework rest http client web service http client wsse

09/05 2018

dev-doc_sf4

dev-doc_sf4 https://github.com/gregurco/GuzzleBundleWssePlugin

WSSE Plugin for Guzzle Bundle, a PHP HTTP client library and framework for building RESTful web service clients

  Sources   Download

MIT

The Requires

 

The Development Requires

plugin middleware curl framework rest http client web service http client wsse

16/11 2017

v1.0.2

1.0.2.0 https://github.com/gregurco/GuzzleBundleWssePlugin

WSSE Plugin for Guzzle Bundle, a PHP HTTP client library and framework for building RESTful web service clients

  Sources   Download

MIT

The Requires

 

The Development Requires

plugin middleware curl framework rest http client web service http client wsse

06/11 2017

v1.0.1

1.0.1.0 https://github.com/gregurco/GuzzleBundleWssePlugin

WSSE Plugin for Guzzle Bundle, a PHP HTTP client library and framework for building RESTful web service clients

  Sources   Download

MIT

The Requires

 

The Development Requires

plugin middleware curl framework rest http client web service http client wsse

26/10 2017

v1.0.0

1.0.0.0 https://github.com/gregurco/GuzzleBundleWssePlugin

WSSE Plugin for Guzzle Bundle, a PHP HTTP client library and framework for building RESTful web service clients

  Sources   Download

MIT

The Requires

 

The Development Requires

plugin middleware curl framework rest http client web service http client wsse