Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow creating an ApiContext with a wildcard IP #182

Open
2 tasks
ElteHupkes opened this issue Oct 29, 2019 · 2 comments
Open
2 tasks

Allow creating an ApiContext with a wildcard IP #182

ElteHupkes opened this issue Oct 29, 2019 · 2 comments

Comments

@ElteHupkes
Copy link

Steps to reproduce:

  1. Call ApiContext::create(...) where $permittedIps = ['*'];

What should happen:

  1. Since * is a valid IP according to the API, the SDK should accept it and create a context with a wildcard IP-address.

What happens:

  1. A BunqException('Invalid ip address "*"') is thrown. Upon calling ApiContext::create() the list of IP addresses is checked with InstallationUtil::assetAllIpIsValid(), which only accepts actual IP addresses, not a wildcard.

Traceback

SDK version and environment

  • Tested on 0.12.4
  • Sandbox
  • Production

Response id

  • 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.

@setpill
Copy link

setpill commented Sep 25, 2020

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.

@patrickkivits
Copy link

It seems this issue is still not resolved, is there any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants