AgrI-Mitra / bff

0 stars 3 forks source link

feat: add geoip based request blocking #17

Closed techsavvyash closed 8 months ago

techsavvyash commented 8 months ago

Description

This PR adds the functionality to block requests based on geoip locations, initially we only allow requests from India and block all other requests. The geolocation service used right now is the one we have deployed at https://geoip.samagra.io/.

Changes

A new interceptor has been implemented in the file src/interceptors/geoip.interceptor.ts and this interceptor has been registered in the main.ts file as a global interceptor. Further a new package named @nestjs/axios has been added in the service.

How to test

Try sending requests from various IP address via IP spoofing.

Please consider using the closing keyword if the pull request is proposed to fix an issue already created in the repository (https://help.github.com/articles/closing-issues-using-keywords/)