bunq / sdk_php

PHP SDK for bunq API
MIT License
84 stars 54 forks source link

Allow to configure Guzzle options / use a proxy to ensure static IP address #5

Closed holtkamp closed 7 years ago

holtkamp commented 7 years ago

The Bunq API expects requests to be initiated from a fixed / whitelisted IP address, which is difficult in a "cloud" environment, with ever changing IP addresses.

A proxy can circumvent this problem and ensure a fixed IP address is used. However the current initialisation of the Guzzle client does not allow to set the proxy option.

Also see this issue which discusses a similar situation: https://github.com/link0/bunq/issues/27

OGKevin commented 7 years ago

@holtkamp FYI

holtkamp commented 7 years ago

Nice! Minor doubt: why only "allow" a string? Guzzle itself also allows an array. Currently the type is not enforced, but the docs suggest it must be a string...

Also see: http://docs.guzzlephp.org/en/stable/request-options.html#proxy

qurben commented 7 years ago

@holtkamp, there is no use case for using an array at the moment. All requests will be to the same server and over https. So unless there is some hidden option in the proxy array it is useful for this SDK.

While it is true that setting a proxy to an array is allowed, it will break your context object.

holtkamp commented 7 years ago

ok, thanks for the explanation 👍