Open ElteHupkes opened 4 years ago
Removing the error would be as simple as making REGEX_IP
(found here) accept *
, however I am not sure whether that would cause any problems elsewhere in the code.
It seems this issue is still not resolved, is there any update on this?
Steps to reproduce:
ApiContext::create(...)
where$permittedIps = ['*'];
What should happen:
*
is a valid IP according to the API, the SDK should accept it and create a context with a wildcard IP-address.What happens:
BunqException('Invalid ip address "*"')
is thrown. Upon callingApiContext::create()
the list of IP addresses is checked withInstallationUtil::assetAllIpIsValid()
, which only accepts actual IP addresses, not a wildcard.Traceback
SDK version and environment
Response id
Extra info:
I'm assuming the API will also validate the list of IPs so I see no reason for the SDK to do this as well. I have checked other SDKs to see if not allowing a wildcard is an intended "feature", but in the Java and C# SDK I do not see such a check. It might be a remnant of when wildcard IPs were not allowed. I do not currently have a workaround that doesn't involve reimplementing
ApiContext
entirely, because a lot of the required functionality is in either static methods or private methods that my hacky hands can't get to.