I'm trying to offer a service to users that allows them to write Python via pyodide or R code via webR in their browser against my own data. I've been thinking of ways to go about this and I'm curious if this is a stupid idea.
pyodide and webR are just web assembly versions of Python / R so a user can write code and ideally share it on the web or with other users. The code they will be writing will be accessing files hosted on AWS S3 which require an API key to access.
Due to all of this being done in the browser and ideally users sharing code their API Key will essentially become a public key. My thought process is I can use their IP as a private key for their access to the API. It will be annoying when a user changes networks / is away from their home network but I figure I can build a simple admin UI that allows them to quickly update their IP / secret key securely via a more traditional web app.
I think doing it this way will make code and the data much more accessible for users and be ideally less costly for me as I just need to manage a whitelist of IPs among other things. I feel like the logic of it makes sense, but is there a better-known way to go about doing this?