(20250704) - Created Oauth Authentication for google places api with all files
This commit is contained in:
+26
@@ -62,6 +62,9 @@ from utils_v2.api.async_quart import (
|
||||
# GMail-related utils:
|
||||
from utils_v2.goog.controllers.gmail.gmail_client import AsyncGmailClient
|
||||
|
||||
# Google Places Utils
|
||||
from utils_v2.goog.controllers.places.places_client import AsyncPlacesClient
|
||||
|
||||
# Chat clients:
|
||||
from utils_v2.whatsapp.nimbus.controllers.async_nimbus_whatsapp import AsyncNimbusWhatsapp
|
||||
|
||||
@@ -86,6 +89,7 @@ from controllers_v2.message.sms.savvy_bulk_sms_kenya import SavvyBulkSMSKenyaCon
|
||||
# ---
|
||||
from controllers_v2.message.mail.all_mail import AllMailController
|
||||
from controllers_v2.message.mail.gmail import GmailController
|
||||
from controllers_v2.software.google_places.google_places import PlacesController
|
||||
# ---
|
||||
from controllers_v2.message.chat.all_chat import AllChatController
|
||||
from controllers_v2.message.chat.whatsapp_nimbus import WhatsAppNimbusController
|
||||
@@ -136,6 +140,8 @@ from api.blueprints.message.chat.tags import chat_update_tags_bp
|
||||
|
||||
# Software Blueprints:
|
||||
from api.blueprints.software.auth import sw_auth_bp
|
||||
from api.blueprints.software.oauth.request_v2 import places_oauth_request_bp
|
||||
from api.blueprints.software.oauth.callback_v2 import places_oauth_callback_bp
|
||||
|
||||
# Finstitutions / Payment Blueprints:
|
||||
from api.blueprints.finstitutions.payments.auth_v2 import pg_auth_bp
|
||||
@@ -216,6 +222,8 @@ app.register_blueprint(chat_update_tags_bp, url_prefix = f"/{MODULE_BASE}/chat")
|
||||
|
||||
# Software Blueprints:
|
||||
app.register_blueprint(sw_auth_bp, url_prefix = f"/{MODULE_BASE}/software")
|
||||
app.register_blueprint(places_oauth_request_bp, url_prefix = f"/{MODULE_BASE}/software")
|
||||
app.register_blueprint(places_oauth_callback_bp, url_prefix = f"/{MODULE_BASE}/software")
|
||||
|
||||
# Finstitutions / Payment Blueprints:
|
||||
app.register_blueprint(pg_auth_bp, url_prefix = f"/{MODULE_BASE}/finstitutions/payments")
|
||||
@@ -519,6 +527,14 @@ async def app_startup(**kwargs):
|
||||
)
|
||||
current_app.printer("Message/Mail (C) ready.")
|
||||
|
||||
current_app.places_controller = PlacesController(
|
||||
cache=current_app.module_cache,
|
||||
http_client=current_app.http_client,
|
||||
alert_url=current_app.script_data["alerts"]["url"],
|
||||
debug=enable_debugging
|
||||
)
|
||||
current_app.printer("GooglePlaces (C) ready.")
|
||||
|
||||
# Messages / Chat Controllers:
|
||||
current_app.chat_controller = AllChatController(
|
||||
cache = current_app.module_cache,
|
||||
@@ -635,6 +651,16 @@ async def app_startup(**kwargs):
|
||||
debug_only_errors = False
|
||||
)
|
||||
|
||||
current_app.google_places_client = AsyncPlacesClient(
|
||||
service_name = "googlePlacesApi",
|
||||
oauth_json = script_cred["google"]["oauth"]["places"],
|
||||
http_client = current_app.http_client,
|
||||
redirect_url = r"https://api.thecaoffice.com/converse/software/callback/googleplaces",
|
||||
debug = enable_debugging,
|
||||
debug_prefix = "Google Places (C) | ",
|
||||
debug_only_errors = False
|
||||
)
|
||||
|
||||
current_app.printer("Connectors and Clients ready.")
|
||||
|
||||
# ┏┓┳ ┳┳┓ •
|
||||
|
||||
Reference in New Issue
Block a user