codeforUV / codeforUV/ruralnetv2

Move IP getting to backend once we have address selection component?

Open
#8 1 comment 0 reactions 0 assignees View on GitHub
enhancement needs discussion
Dominant language
JavaScript
Stars
4
Forks
3
PR merge metrics
No merged PRs in 30d

Description

So one less that ideal issue right now is that we're using the [Abstract API](https://app.abstractapi.com/api/ip-geolocation) to get a client's IP address and initial approximate location (before we try to refine it with the browser API). Since we're doing this all on the client-side we're exposing our API key, so a bad actor could run up the free limit of 20k req/month; no billing or other info is tied to the API key.

Alternatively, the speedtest itself has an [option](https://github.com/codeforUV/ruralnetv2/blob/main/src/lib/classes.js#L114) to hit a custom end-point to get a user's IP once we start a test. While we have full control over what this end-point does, we don't get easy access to its response (it's used directly by the speedtest library and we'd have to dive it to see how it's handled). I have that switched off on the `main` branch right now since it's redundant with us getting the client IP via the Abstract API and we have more flexibility on using it on the front-end.

However, I can see a case for moving this logic to the backend where we'd hide our API key too. It might make most sense to move this over whenever we finish building out our address selection component, as that's where we'll make use of the response from that end-point.

Leaving this here now to revisit this at that time

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.