acupedia-api/app/features/access
Amit Salunke c76e56f3e4 Added nutrition data 2026-09-10 17:48:32 +05:30
..
README.md Init Api 2026-09-05 19:29:21 +05:30
__init__.py Init Api 2026-09-05 19:29:21 +05:30
api.py Init Api 2026-09-05 19:29:21 +05:30
deps.py Added nutrition data 2026-09-10 17:48:32 +05:30
domain.py Init Api 2026-09-05 19:29:21 +05:30
errors.py Init Api 2026-09-05 19:29:21 +05:30
repository.py initial commit 2026-09-06 21:07:37 +05:30
schema.py Init Api 2026-09-05 19:29:21 +05:30
service.py Init Api 2026-09-05 19:29:21 +05:30

README.md

AccuPedia Access Feature

Effective product-access read facade separated from authentication.

Route

  • GET /access/me

Authentication

The bearer JWT is validated using the canonical auth token decoder:

from app.features.auth.security import decode_access_token

The sub claim supplies user_id.

The access package does not query auth.app_users.

Persistence reads

Commerce:

  • commerce.user_subscriptions
  • commerce.access_plans
  • commerce.user_entitlements

Content:

  • content.modules

Existing access semantics preserved

Effective unlocked modules are:

  1. modules from active user_entitlements; plus
  2. every active module when an active subscription has plan code LIFETIME_ALL or LIFETIME_ALL_USD.

No new plan-to-module derivation rule is introduced in this refactor.

Response

/access/me returns:

  • active subscriptions
  • active entitlements
  • unlocked module codes
  • unlocked module slugs