Sign inSign up

pak00329/zoho-api-key

By pak00329

•Updated over 1 year ago

Returns latest API key

Image
0

848

pak00329/zoho-api-key repository overview

⁠Zoho API Key Manager 🚀

This Docker image provides an API to manage OAuth2 API keys for Zoho services. It ensures that API keys are stored and reused efficiently, only generating a new key when the existing one expires. The application can run on Google Cloud Run or locally for testing.


⁠🛠 Features
  • Retrieves and validates stored API keys.
  • Automatically refreshes expired API keys.
  • Stores key data in Google Cloud Storage (GCS) when deployed.
  • Supports local storage for testing.
  • FastAPI-powered REST API with /get_api_key endpoint.

⁠📌 How It Works
  1. On a GET request, checks if a valid API key is stored.
  2. If the key is still valid, it returns the existing key.
  3. If the key is expired, it requests a new one and stores it.

⁠⚙️ Environment Variables
VariableDescription
GCS_BUCKET_NAMEGoogle Cloud Storage bucket name (GCP only)
URLOAuth2 token endpoint
REFRESH_TOKENOAuth2 refresh token
CLIENT_IDOAuth2 client ID
CLIENT_SECRETOAuth2 client secret
REDIRECT_URLOAuth2 redirect URL
ENVIRONMENTSet to local for local storage

⁠🚀 Deployment on Google Cloud Run

This container is optimized for Google Cloud Run and can be deployed using GitHub Actions.


⁠🛠 Running Locally
  1. Install dependencies:

    pip install -r requirements.txt
    
  2. Set up environment variables (.env file recommended).

  3. Run the server:

    uvicorn main:app --host 127.0.0.1 --port 8000 --reload
    
  4. Access the API at http://127.0.0.1:8000/docs.

⁠📦 Pull Image from Docker Hub
docker pull pak00329/zoho-api-key:latest

Tag summary

Content type

Image

Digest

sha256:8b637bbfc…

Size

54.8 MB

Last updated

over 1 year ago

docker pull pak00329/zoho-api-key