Skip to content

Conversation

@amrit110
Copy link
Member

@amrit110 amrit110 commented Nov 2, 2025

This pull request introduces a new Firebase Token Generation Service designed to run on Google Cloud Run. The service enables secure generation of Firebase custom tokens for workspace service accounts, facilitating controlled access to Firestore. The implementation includes the service code, a Dockerfile for containerization, dependency management, deployment automation, and best practices for security and maintainability.

The most important changes are:

Service Implementation and Security:

  • Added main.py implementing a Flask-based web service that authenticates requests from workspace service accounts, verifies participant existence in Firestore, and generates Firebase custom tokens with proper claims. Includes /health and /generate-token endpoints, robust logging, and error handling.
  • Service authenticates callers using Google-provided identity tokens, ensuring only authorized service accounts can request tokens.

Containerization and Deployment:

  • Added a secure Dockerfile that uses a non-root user, installs dependencies, and runs the service with Gunicorn for production readiness.
  • Added a .dockerignore file to exclude unnecessary files from the container build context, improving build performance and security.
  • Introduced a deployment script (deploy_token_service.sh) to automate building, deploying, and configuring the service on Cloud Run, including IAM permissions and environment setup.

Dependency Management:

  • Added a requirements.txt specifying all Python dependencies with pinned versions for reproducible builds.

@amrit110 amrit110 self-assigned this Nov 2, 2025
@amrit110 amrit110 added the enhancement New feature or request label Nov 2, 2025
@amrit110 amrit110 merged commit d8c8a4d into main Nov 2, 2025
3 checks passed
@amrit110 amrit110 deleted the add_firestore_token_service branch November 2, 2025 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants