appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
34.64k stars 3.74k forks source link

[Feature] Expose the user local IP address #5237

Open hetunandu opened 3 years ago

hetunandu commented 3 years ago

Summary

Exposing local IP address of a user inside appsmith to enable apps that need logic to give access based on their LAN

Motivation

Screenshot 2021-06-17 at 11 43 49 PM
felix-appsmith commented 1 year ago

This is another request related to this.

The user wants to obtain the IP address of their end users through Server/Proxy to create a whitelist in their API. This would significantly improve the security of the user's API. Currently, this is not possible with Appsmith, so this request would be of great help to our users by increasing the security of their APIs.

For now, I provided a workaround to the user, but it does not work very well for them because the IP address can be manipulated.

export default {
 async GetIP() {
 const response = await fetch('[https://api.ipify.org?format=json](https://api.ipify.org/?format=json)');
 const data = await response.json();
 const userIP = data.ip;
 return userIP;
 }
 }

The workaround for the user is very simple:

  1. Create a new JS object
  2. Copy the provided code
  3. Now when this code is executed, it will retrieve the user's IP, and it can be modified to save it in store.value().