{"id":16728531,"url":"https://github.com/gregurco/guzzlebundlewsseplugin","last_synced_at":"2025-04-10T11:07:18.569Z","repository":{"id":62512615,"uuid":"107051994","full_name":"gregurco/GuzzleBundleWssePlugin","owner":"gregurco","description":"WSSE Plugin for EightPointsGuzzleBundle","archived":false,"fork":false,"pushed_at":"2018-05-09T11:48:49.000Z","size":25,"stargazers_count":5,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T09:17:03.211Z","etag":null,"topics":["bundle","guzzle","guzzle-bundle-plugin","guzzle-middleware","php","symfony","symfony-bundle","wss"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gregurco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-15T21:54:39.000Z","updated_at":"2019-10-19T08:14:56.000Z","dependencies_parsed_at":"2022-11-02T13:15:31.754Z","dependency_job_id":null,"html_url":"https://github.com/gregurco/GuzzleBundleWssePlugin","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregurco%2FGuzzleBundleWssePlugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregurco%2FGuzzleBundleWssePlugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregurco%2FGuzzleBundleWssePlugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregurco%2FGuzzleBundleWssePlugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gregurco","download_url":"https://codeload.github.com/gregurco/GuzzleBundleWssePlugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239223683,"owners_count":19602835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bundle","guzzle","guzzle-bundle-plugin","guzzle-middleware","php","symfony","symfony-bundle","wss"],"created_at":"2024-10-12T23:10:41.101Z","updated_at":"2025-02-17T02:31:46.423Z","avatar_url":"https://github.com/gregurco.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Guzzle Bundle WSSE Plugin\n\n[![Build Status](https://travis-ci.org/gregurco/GuzzleBundleWssePlugin.svg?branch=master)](https://travis-ci.org/gregurco/GuzzleBundleWssePlugin)\n[![Coverage Status](https://coveralls.io/repos/gregurco/GuzzleBundleWssePlugin/badge.svg?branch=master)](https://coveralls.io/r/gregurco/GuzzleBundleWssePlugin)\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/537660c3-913a-4ce2-876a-4abb73f642f2/mini.png)](https://insight.sensiolabs.com/projects/537660c3-913a-4ce2-876a-4abb73f642f2)\n\nThis plugin integrates [WSSE][1] functionality into Guzzle Bundle, a bundle for building RESTful web service clients.\n\n\n## Requirements\n - PHP 7.0 or above\n - [Guzzle Bundle][2]\n\n \n### Installation\nUsing [composer][3]:\n\n##### composer.json\n``` json\n{\n    \"require\": {\n        \"gregurco/guzzle-bundle-wsse-plugin\": \"dev-master\"\n    }\n}\n```\n\n##### command line\n``` bash\n$ composer require gregurco/guzzle-bundle-wsse-plugin\n```\n\n## Usage\n### Enable bundle\n\n#### Symfony 2.x and 3.x\nPlugin will be activated/connected through bundle constructor in `app/AppKernel.php`, like this:\n\n``` php \nnew EightPoints\\Bundle\\GuzzleBundle\\EightPointsGuzzleBundle([\n    new Gregurco\\Bundle\\GuzzleBundleWssePlugin\\GuzzleBundleWssePlugin(),\n])\n```\n\n#### Symfony 4\nThe registration of bundles was changed in Symfony 4 and now you have to change `src/Kernel.php` to achieve the same functionality.  \nFind next lines:\n\n```php\nforeach ($contents as $class =\u003e $envs) {\n    if (isset($envs['all']) || isset($envs[$this-\u003eenvironment])) {\n        yield new $class();\n    }\n}\n```\n\nand replace them by:\n\n```php\nforeach ($contents as $class =\u003e $envs) {\n    if (isset($envs['all']) || isset($envs[$this-\u003eenvironment])) {\n        if ($class === \\EightPoints\\Bundle\\GuzzleBundle\\EightPointsGuzzleBundle::class) {\n            yield new $class([\n                new \\Gregurco\\Bundle\\GuzzleBundleWssePlugin\\GuzzleBundleWssePlugin(),\n            ]);\n        } else {\n            yield new $class();\n        }\n    }\n}\n```\n\n### Basic configuration\n``` yaml\n# app/config/config.yml\n\neight_points_guzzle:\n    clients:\n        api_payment:\n            base_url: \"http://api.domain.tld\"\n\n            # define headers, options\n\n            # plugin settings\n            plugin:\n                wsse:\n                    username:   \"acme\"\n                    password:   \"pa55w0rd\"\n                    created_at: \"-10 seconds\" # optional\n```\n\n## Usage with guzzle\n``` php\n\u003c?php \n# Optional: Set third parameter by a expression (if not, current time will be used automatically)\n# http://php.net/manual/en/datetime.formats.relative.php\n# Useful if there is a small difference of time between client and server\n# DateTime object will be regenerated for every request\n$wsse = new \\Gregurco\\Bundle\\GuzzleBundleWssePlugin\\Middleware\\WsseAuthMiddleware($username, $password);\n\n$stack = \\GuzzleHttp\\HandlerStack::create();\n\n// Add the wsse middleware to the handler stack.\n$stack-\u003epush($wsse-\u003eattach());\n\n$client   = new \\GuzzleHttp\\Client(['handler' =\u003e $stack]);\n$response = $client-\u003eget('http://www.8points.de');\n```\n\n## License\nThis middleware is licensed under the MIT License - see the LICENSE file for details\n\n[1]: http://www.xml.com/pub/a/2003/12/17/dive.html\n[2]: https://github.com/8p/EightPointsGuzzleBundle\n[3]: https://getcomposer.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregurco%2Fguzzlebundlewsseplugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgregurco%2Fguzzlebundlewsseplugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregurco%2Fguzzlebundlewsseplugin/lists"}