Skip to content

Added an API to send google configs to frontend#746

Closed
yugesh-ganipudi wants to merge 1 commit intojuspay:releasefrom
yugesh-ganipudi:BZ-2781-support-to-send-google-config-to-frontend
Closed

Added an API to send google configs to frontend#746
yugesh-ganipudi wants to merge 1 commit intojuspay:releasefrom
yugesh-ganipudi:BZ-2781-support-to-send-google-config-to-frontend

Conversation

@yugesh-ganipudi
Copy link
Copy Markdown
Contributor

@yugesh-ganipudi yugesh-ganipudi commented May 6, 2026

Added an API to send google configs to frontend

Summary by CodeRabbit

Release Notes

  • New Features
    • Added a public configuration endpoint that exposes the Google Client ID for frontend authentication integration.

Copilot AI review requested due to automatic review settings May 6, 2026 13:12
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Walkthrough

A new public configuration endpoint is added to expose the Google Client ID. The change introduces a Pydantic response model and a GET /config route that returns the configured Google client ID value.

Changes

Public Config Endpoint

Layer / File(s) Summary
Imports
app/api/routers/breeze_buddy/signup/__init__.py
Adds BaseModel from Pydantic and GOOGLE_CLIENT_ID from config module.
Data Shape
app/api/routers/breeze_buddy/signup/__init__.py
Introduces PublicConfigResponse Pydantic model with google_client_id: str field.
Route Handler
app/api/routers/breeze_buddy/signup/__init__.py
Adds GET /config endpoint via get_public_config() function that returns PublicConfigResponse containing the Google Client ID.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A little endpoint hops into view,
With config so public and bright and new,
Google's ID now exposed to the world,
One simple model, one route unfurled! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding an API endpoint to expose Google configuration to the frontend, which matches the file changes showing a new /config GET endpoint.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a public Breeze Buddy API endpoint to expose frontend-consumable Google SSO configuration (currently the Google OAuth client ID) so clients can initialize Google Identity Services without hardcoding env-specific values.

Changes:

  • Introduces GET /config on the Breeze Buddy signup router to return a google_client_id.
  • Adds a small response model (PublicConfigResponse) and wires it to the new endpoint.

Comment on lines +129 to +130
async def get_public_config() -> PublicConfigResponse:
return PublicConfigResponse(google_client_id=GOOGLE_CLIENT_ID)
Comment on lines +119 to +121
class PublicConfigResponse(BaseModel):
google_client_id: str

@router.get(
"/config",
response_model=PublicConfigResponse,
summary="Public client configuration (Google Client ID, etc.)",
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/api/routers/breeze_buddy/signup/__init__.py`:
- Around line 129-130: get_public_config currently returns an empty
google_client_id when GOOGLE_CLIENT_ID is unset; update get_public_config to
check GOOGLE_CLIENT_ID and, if it's falsy/empty, raise an HTTP 503 (e.g., via
fastapi.HTTPException) with a clear message mirroring the behavior in
_verify_google_id_token in handlers.py so clients can detect the
misconfiguration early; otherwise return
PublicConfigResponse(google_client_id=GOOGLE_CLIENT_ID) as before.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ca8fba2e-ac62-4b8e-bba4-ea01b512c0f3

📥 Commits

Reviewing files that changed from the base of the PR and between 7bd7f0f and fe9c987.

📒 Files selected for processing (1)
  • app/api/routers/breeze_buddy/signup/__init__.py

Comment on lines +129 to +130
async def get_public_config() -> PublicConfigResponse:
return PublicConfigResponse(google_client_id=GOOGLE_CLIENT_ID)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Return a 503 when GOOGLE_CLIENT_ID is unconfigured, consistent with handlers.py.

GOOGLE_CLIENT_ID defaults to "" when the env var is absent (see app/core/config/static.py:352). As written, this endpoint silently returns {"google_client_id": ""}, leaving the frontend to fail later with an opaque Google Sign-In error. _verify_google_id_token in handlers.py raises HTTP 503 in the exact same situation — the /config endpoint should mirror that behaviour so clients can detect and surface the misconfiguration early.

🛡️ Proposed fix
+from fastapi import APIRouter, Depends, HTTPException, status
...
 async def get_public_config() -> PublicConfigResponse:
+    if not GOOGLE_CLIENT_ID:
+        raise HTTPException(
+            status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
+            detail="Google SSO is not configured on this server.",
+        )
     return PublicConfigResponse(google_client_id=GOOGLE_CLIENT_ID)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/api/routers/breeze_buddy/signup/__init__.py` around lines 129 - 130,
get_public_config currently returns an empty google_client_id when
GOOGLE_CLIENT_ID is unset; update get_public_config to check GOOGLE_CLIENT_ID
and, if it's falsy/empty, raise an HTTP 503 (e.g., via fastapi.HTTPException)
with a clear message mirroring the behavior in _verify_google_id_token in
handlers.py so clients can detect the misconfiguration early; otherwise return
PublicConfigResponse(google_client_id=GOOGLE_CLIENT_ID) as before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants