WarySloth
WarySloth
RRunPod
Created by WarySloth on 2/20/2024 in #⚡|serverless
How do I expose my api key and use CORS instead?
Got it Justin, again, thanks so much. I'll go ahead and set up a proxy server
104 replies
RRunPod
Created by WarySloth on 2/20/2024 in #⚡|serverless
How do I expose my api key and use CORS instead?
Ok cool. I think I understand everything now and will also look more thoroughly through the serverless docs to understand better. Yeah, I was just interested in passing in some data but could just use a custom token as you said. I guess my general question is, is there any faster way to send a response straight from the client and get a response, other than to set up a proxy server? Or is that the only way to do it without having a true backend with environment variables
104 replies
RRunPod
Created by WarySloth on 2/20/2024 in #⚡|serverless
How do I expose my api key and use CORS instead?
ok okay. So basically, when I make, say, a curl request, it first goes to runpod auth, runpod verifies that the api key is authentic for someone trying to access the endpoint given in the POST request, and then only does runpod trigger the worker to complete the thing in the body?
104 replies
RRunPod
Created by WarySloth on 2/20/2024 in #⚡|serverless
How do I expose my api key and use CORS instead?
*it
104 replies
RRunPod
Created by WarySloth on 2/20/2024 in #⚡|serverless
How do I expose my api key and use CORS instead?
Ok I figured. But can I modify the api key in my worker handler or something before runpod authenticates is?
104 replies
RRunPod
Created by WarySloth on 2/20/2024 in #⚡|serverless
How do I expose my api key and use CORS instead?
I guess I'm more so asking where is the actual authentication completed? Like can I see the literal function that does the authentication and modify something/modify the key before I let it get authenticated?
104 replies
RRunPod
Created by WarySloth on 2/20/2024 in #⚡|serverless
How do I expose my api key and use CORS instead?
@justin nw, one more question if you have a second--I know in the request to my endpoint I'd typically send my runpod api key. Where is that api key authenticated? Like in a woker repo I could use for my own project (like the one from earlier https://github.com/blib-la/runpod-worker-comfy), is authentication with api key typically handled inside of that code? I looked at that code and couldn't see where it handles the runpod api auth
104 replies
RRunPod
Created by WarySloth on 2/20/2024 in #⚡|serverless
How do I expose my api key and use CORS instead?
and the client polls the flask server to understand when the image has been uploaded to firebase?
104 replies
RRunPod
Created by WarySloth on 2/20/2024 in #⚡|serverless
How do I expose my api key and use CORS instead?
does my client get the image directly from the endpoint or does it need to be piped through the flask server
104 replies
RRunPod
Created by WarySloth on 2/20/2024 in #⚡|serverless
How do I expose my api key and use CORS instead?
oh wait, let me also look at your most recent messages
104 replies
RRunPod
Created by WarySloth on 2/20/2024 in #⚡|serverless
How do I expose my api key and use CORS instead?
so flow looks like: client makes request; flask server receives and does some auth, rate limiting, etc then sends to serverless, serverless completes the job and gives flask back a job_id, flask server gives the job_id to client, and then the client can use the job_id since that's public to see the image?
104 replies
RRunPod
Created by WarySloth on 2/20/2024 in #⚡|serverless
How do I expose my api key and use CORS instead?
Or would the serverless endpoint return image to the flask server first, and then the flask server returns to the client
104 replies
RRunPod
Created by WarySloth on 2/20/2024 in #⚡|serverless
How do I expose my api key and use CORS instead?
?
104 replies
RRunPod
Created by WarySloth on 2/20/2024 in #⚡|serverless
How do I expose my api key and use CORS instead?
got it. Would I send a request from my client to the flask server, the flask server would send a request to my serverless endpoint with some sort of address of the client to send the image back to, and then the serverless endpoint would create the image and send it to the address the flask server gave it
104 replies
RRunPod
Created by WarySloth on 2/20/2024 in #⚡|serverless
How do I expose my api key and use CORS instead?
thank you so much btw, this is really helpful
104 replies
RRunPod
Created by WarySloth on 2/20/2024 in #⚡|serverless
How do I expose my api key and use CORS instead?
any pointers on where to look just for some basic information on proxy servers with runpod? like a guide or even just what search term you'd recommend
104 replies
RRunPod
Created by WarySloth on 2/20/2024 in #⚡|serverless
How do I expose my api key and use CORS instead?
makes more sense now
104 replies
RRunPod
Created by WarySloth on 2/20/2024 in #⚡|serverless
How do I expose my api key and use CORS instead?
oh okay got it
104 replies
RRunPod
Created by WarySloth on 2/20/2024 in #⚡|serverless
How do I expose my api key and use CORS instead?
that way I don't have to setup a proxy server
104 replies
RRunPod
Created by WarySloth on 2/20/2024 in #⚡|serverless
How do I expose my api key and use CORS instead?
why wouldn't you recommend trying to do that in the runpod handler itself? Like why not just add some python to restrict the handler.py file to only run if it's from a legit domain and theres a rate limit?
104 replies