mirror of
https://github.com/AJaySi/ALwrity.git
synced 2026-04-26 09:25:55 +03:00
[PR #323] [MERGED] Migrate OAuth token storage to PostgreSQL #628
Labels
No labels
AI Content Agents
AI Content Strategy
AI Content planning
AI Marketing Tools
AI SEO
AI personalization
AI writer
ALwrity Copi-lot
Alwrity web search
Anthropic
DeepSeek
Gemini AI
Integration
LLM
OnBoarding
OnBoarding
RAG knowledgebase Memory
bug
documentation
enhancement
good first issue
help wanted
invalid
openai
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ALwrity#628
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/AJaySi/ALwrity/pull/323
Author: @AJaySi
Created: 2/9/2026
Status: ✅ Merged
Merged: 2/9/2026
Merged by: @AJaySi
Base:
main← Head:codex/migrate-oauth-token-storage-to-postgresql📝 Commits (1)
6dc7d2bMigrate OAuth tokens to PostgreSQL📊 Changes
14 files changed (+1355 additions, -1035 deletions)
View changed files
📝
backend/api/wix_routes.py(+1 -2)➕
backend/models/oauth_token_models.py(+150 -0)📝
backend/routers/bing_oauth.py(+31 -29)📝
backend/routers/gsc_auth.py(+14 -12)📝
backend/services/database.py(+6 -0)📝
backend/services/gsc_service.py(+183 -158)📝
backend/services/integrations/bing_oauth.py(+264 -222)📝
backend/services/integrations/wix_oauth.py(+182 -157)📝
backend/services/integrations/wordpress_oauth.py(+180 -163)📝
backend/services/integrations/wordpress_publisher.py(+111 -88)📝
backend/services/integrations/wordpress_service.py(+141 -131)📝
backend/services/oauth_token_monitoring_service.py(+16 -14)📝
backend/services/scheduler/executors/gsc_insights_executor.py(+23 -37)📝
backend/services/scheduler/executors/oauth_token_monitoring_executor.py(+53 -22)📄 Description
Motivation
alwrity.db/sqlite3reads and writes with SQLAlchemy models and sessions so monitoring and onboarding use the same platform DB.Description
backend/models/oauth_token_models.pycontaining GSC, Bing, WordPress, Wix token/state models plus WordPresswordpress_sites/wordpress_postsmodels and caching rows.OAuthTokenBaseinbackend/services/database.pyand creating platform tables via SQLAlchemy metadata.GSCService,BingOAuthService,WordPressOAuthService,WixOAuthService,WordPressService, andWordPressPublishernow accept an optionaldb_sessionand useget_platform_db_session()and the new models for reads/writes, with session cleanup when the service created its own session.get_connected_platformsinbackend/services/oauth_token_monitoring_service.py,oauth_token_monitoring_executor.py, andgsc_insights_executor.pynow rely on SQLAlchemy-backed lookups andGscDataCachewhere applicable, and routers (backend/routers/gsc_auth.py,backend/routers/bing_oauth.py,backend/api/wix_routes.py) were adjusted to stop referencingalwrity.db.Testing
Codex Task
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.