IP Access Rules #3437

Closed
rodrigoabbas opened this Issue Feb 14, 2017 · 4 comments

Projects

None yet

2 participants

@rodrigoabbas

Hi guys! Excelent work!

I was wondered if there is a way to permit/deny certain IP adresses for access control?
I want to do a whitelist on my node server.

Thanks

@Marsup Marsup self-assigned this Feb 14, 2017
@Marsup
Member
Marsup commented Feb 14, 2017

Hi,

There doesn't seem to be any existing plugin doing that but it shouldn't be that hard, just filter the requests using onRequest.
Also, I don't mean to be rude, but the text you erased before posting your issue was specifically advising you to ask this type of question on the discuss repo, so next time please do.

@Marsup Marsup closed this Feb 14, 2017
@rodrigoabbas

I am really sorry @Marsup. I have been looking and googling this since 3 days, with no answer, and i wanted to post it as a last resource, so i barely read that text (really my bad!).
I am thankfull with your fast, polite and helpful response!
I will do that you suggest.
Regards!

@Marsup
Member
Marsup commented Feb 14, 2017

You can get inspiration from https://github.com/fs-opensource/hapi-geo-locate/blob/5f3f4461af3e69c4259ff3eb4f7dc4090d25d702/lib/index.js#L22-L29 as to how to get the IP. The method for rejecting IPs is yours to decide.

@rodrigoabbas

Excellent! Thank you very much for your help!! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment