bunq / sdk_php

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

bunq-install cli doesn't accept wildcards for permitted ips #207

Closed hurnell closed 3 years ago

hurnell commented 3 years ago

Steps to reproduce:

  1. run ./vendor/bin/bunq-install
  2. When prompted to "Provide a list of comma-separated IPs" 3 enter xxx.xxx.xxx.x,*

What should happen:

  1. Should allow all ips (including wildcards) as per api documentation: https://doc.bunq.com/#/authentication => Device registration => IP addresses

You can also programatically switch to a Wildcard API Key by passing your current ip and a (asterisk) in the permitted_ips field of the device-server POST call. E.g: ["1.2.3.4", ""].

What happens:

  1. Error Invalid ip address "*"

SDK version and environment

Extra info:

Quick fix

src/Util/InstallationUtil.php line 213 if (preg_match(self::REGEX_IP, $ip) === self::PREG_MATCH_SUCCESS || '*' === $ip)

hurnell commented 3 years ago

duplicate