Skip to content

Mobile bringup phase 1 backend auth and Schoology flow#4

Open
AdamEXu wants to merge 4 commits intomainfrom
mobile-bringup-v1-phase-1-backend
Open

Mobile bringup phase 1 backend auth and Schoology flow#4
AdamEXu wants to merge 4 commits intomainfrom
mobile-bringup-v1-phase-1-backend

Conversation

@AdamEXu
Copy link
Member

@AdamEXu AdamEXu commented Feb 26, 2026

Summary

  • harden mobile auth flow
  • add mobile Schoology OAuth flow support

Testing

  • not run

Copilot AI review requested due to automatic review settings February 26, 2026 18:28
Copy link

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

This PR implements mobile authentication and Schoology OAuth flow support for the mobile app, introducing a comprehensive backend API for mobile clients with token-based authentication, PKCE flow support, and rate limiting.

Changes:

  • Added mobile API endpoints for Google/Schoology OAuth flows with PKCE verification
  • Implemented mobile-specific JWT tokens, refresh token rotation, and device management
  • Added rate limiting infrastructure using Flask-Limiter

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/mobile/test_mobile_api.py Comprehensive test suite for mobile auth flows, token exchange, and device management
tests/mobile/init.py Package marker for mobile tests
tests/init.py Package marker for tests
schoology_service Updated subproject commit reference
requirements.txt Added Flask-Limiter dependency
mobile/service.py Core service layer implementing mobile auth flows, token management, and PKCE validation
mobile/routes.py REST API endpoints for mobile authentication and session management
mobile/init.py Package marker for mobile module
extensions.py Flask-Limiter configuration for rate limiting
docs/mobile_auth_contract_v1.md API documentation for mobile authentication contract
db/mobile.py Database operations for mobile tokens, devices, and OAuth requests
db/init.py Database schema initialization for mobile tables
config.py Configuration for mobile token TTLs, redirect URIs, and rate limiting
auth/mobile_middleware.py Bearer token authentication middleware for mobile endpoints
auth/jwt_utils.py JWT utility functions supporting multiple audiences (mobile_api, convex)
app.py Integration of mobile blueprint and rate limiting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

else:
expires_in_seconds = Config.MOBILE_ACCESS_TOKEN_TTL_SECONDS

now = datetime.now(timezone.utc)
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

The function uses datetime.now(timezone.utc) while other parts of the codebase use mobile_db.utcnow() which returns datetime.now(timezone.utc). Consider using the centralized mobile_db.utcnow() helper for consistency, or create a shared utility function to avoid duplicating this pattern.

Copilot uses AI. Check for mistakes.
Comment on lines +55 to +56
def now_utc():
return mobile_db.utcnow()
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

This function is a simple wrapper around mobile_db.utcnow() without adding functionality. Consider directly using mobile_db.utcnow() throughout this module to reduce unnecessary indirection and improve code clarity.

Copilot uses AI. Check for mistakes.
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.

2 participants