Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 4108

REST API: Avoid Library Global Initialization Scope (Google Earth Engine Python API)

$
0
0

I’m building a REST API backend that fetches authenticated URLs for map tiles from private image asset collections in Google Earth Engine (GEE). Each user of the API has a unique Google Service Account (SA) linked to their requests. The backend uses these SA credentials to authenticate and execute operations through the GEE Python API.

The challenge is that the GEE Python API requires global initialization using the credentials, which creates problems for Isolation - Ensuring that one user’s credentials and operations are not accessible to other concurrent requests.

My Approach and ConcernsOne approach I’ve considered is spawning a new process for each request and initializing the GEE API with the specific user’s service account credentials in that process. However initializing a new GEE instance for each request introduces overhead, especially under high traffic.

What I’m Looking ForIdeally, I want to:

  • Authenticate each user’s service account once to receive a token.
  • Use that token to securely execute GEE operations without re-initializing the API globally for every request.

Is there a way to securely initialize the GEE API per user without global state?


Viewing all articles
Browse latest Browse all 4108

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>