identity-plan-kit 1.0.2__tar.gz → 1.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. identity_plan_kit-1.2.0/.serena/project.yml +189 -0
  2. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/PKG-INFO +7 -7
  3. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/README.md +1 -1
  4. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/pyproject.toml +6 -6
  5. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/admin/views.py +19 -27
  6. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/cache/auth_cache.py +11 -9
  7. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/services/oauth_service.py +15 -15
  8. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/config.py +5 -3
  9. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/cache/plan_cache.py +12 -17
  10. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/repositories/plan_repo.py +24 -9
  11. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/services/plan_service.py +22 -0
  12. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/rbac/cache/permission_cache.py +11 -9
  13. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/rbac/dependencies.py +9 -7
  14. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/constants.py +1 -1
  15. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/security.py +15 -4
  16. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/auth/test_oauth_service_resilience.py +6 -6
  17. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/auth/test_redis_auth_cache_lua.py +24 -7
  18. identity_plan_kit-1.2.0/tests/integration/test_admin_permissions.py +126 -0
  19. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/integration/test_e2e_endpoints.py +1 -1
  20. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/plans/test_redis_plan_cache_set_all.py +22 -5
  21. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/shared/test_config_validation.py +14 -3
  22. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/uv.lock +1546 -1479
  23. identity_plan_kit-1.0.2/.serena/cache/python/document_symbols.pkl +0 -0
  24. identity_plan_kit-1.0.2/.serena/cache/python/raw_document_symbols.pkl +0 -0
  25. identity_plan_kit-1.0.2/.serena/memories/memory_maintenance.md +0 -33
  26. identity_plan_kit-1.0.2/.serena/project.yml +0 -133
  27. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/CLAUDE.MD +0 -0
  28. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/agents/Architect.md +0 -0
  29. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/agents/Reviewer.md +0 -0
  30. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/rules/cache-standards.md +0 -0
  31. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/rules/crud-operations.md +0 -0
  32. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/rules/database-patterns.md +0 -0
  33. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/rules/error-handling.md +0 -0
  34. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/rules/feature-structure.md +0 -0
  35. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/rules/layer-standards.md +0 -0
  36. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/rules/no-speculative-changes.md +0 -0
  37. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/rules/serena-tool-selection.md +0 -0
  38. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/settings.local.json +0 -0
  39. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/skills/architect-review/SKILL.MD +0 -0
  40. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/skills/code-review/SKILL.MD +0 -0
  41. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/skills/pattern-review/SKILL.MD +0 -0
  42. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/skills/production-readiness-review/SKILL.MD +0 -0
  43. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/skills/real-optimization-test/SKILL.md +0 -0
  44. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/skills/security-review/SKILL.MD +0 -0
  45. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/skills/system-design/SKILL.MD +0 -0
  46. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/skills/task-creator/SKILL.MD +0 -0
  47. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.claude/skills/testing-review/SKILL.md +0 -0
  48. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.gitignore +0 -0
  49. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.mcp.json +0 -0
  50. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.serena/.gitignore +0 -0
  51. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/.serena/project.local.yml +0 -0
  52. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/AUDIT_REPORT.md +0 -0
  53. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/Makefile +0 -0
  54. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/alembic/env.py +0 -0
  55. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/alembic/script.py.mako +0 -0
  56. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/alembic/versions/20250124_000000_initial_schema.py +0 -0
  57. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/alembic/versions/20250127_000000_add_password_hash.py +0 -0
  58. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/alembic/versions/20250130_000000_add_display_name_picture.py +0 -0
  59. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/alembic/versions/20250214_000000_add_user_metadata.py +0 -0
  60. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/alembic/versions/20260506_000000_add_plan_timestamps.py +0 -0
  61. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/alembic/versions/20260515_000000_add_auth_timestamps.py +0 -0
  62. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/alembic/versions/20260610_000000_add_rbac_timestamps.py +0 -0
  63. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/alembic.ini +0 -0
  64. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/examples/extending_models.py +0 -0
  65. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/examples/integration/__init__.py +0 -0
  66. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/examples/integration/fastapi_integration.py +0 -0
  67. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/examples/integration/sample_alembic_env.py +0 -0
  68. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/examples/integration/webhook_integration.py +0 -0
  69. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/examples/playing/admin_usage.py +0 -0
  70. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/examples/playing/basic_usage.py +0 -0
  71. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/examples/playing/custom_error_formats.py +0 -0
  72. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/examples/playing/user_metadata.py +0 -0
  73. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/examples/prod/.env.production.example +0 -0
  74. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/examples/prod/Dockerfile +0 -0
  75. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/examples/prod/docker-compose.yml +0 -0
  76. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/examples/prod/nginx.conf +0 -0
  77. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/examples/prod/production_setup.py +0 -0
  78. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/examples/prod/prometheus.yml +0 -0
  79. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/loadtests/README.md +0 -0
  80. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/loadtests/__init__.py +0 -0
  81. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/loadtests/config.py +0 -0
  82. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/loadtests/locustfile.py +0 -0
  83. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/loadtests/test_auth.py +0 -0
  84. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/loadtests/test_database_stress.py +0 -0
  85. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/loadtests/test_mixed_scenarios.py +0 -0
  86. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/loadtests/test_plans_quota.py +0 -0
  87. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/loadtests/test_quota_direct.py +0 -0
  88. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/loadtests/test_rbac_cache.py +0 -0
  89. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/loadtests/utils.py +0 -0
  90. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/pyrightconfig.json +0 -0
  91. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/__init__.py +0 -0
  92. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/admin/__init__.py +0 -0
  93. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/admin/auth.py +0 -0
  94. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/__init__.py +0 -0
  95. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/cache/__init__.py +0 -0
  96. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/dependencies.py +0 -0
  97. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/domain/__init__.py +0 -0
  98. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/domain/entities.py +0 -0
  99. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/domain/exceptions.py +0 -0
  100. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/dto/__init__.py +0 -0
  101. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/dto/requests.py +0 -0
  102. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/dto/responses.py +0 -0
  103. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/handlers/__init__.py +0 -0
  104. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/handlers/oauth_routes.py +0 -0
  105. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/models/__init__.py +0 -0
  106. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/models/refresh_token.py +0 -0
  107. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/models/user.py +0 -0
  108. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/models/user_provider.py +0 -0
  109. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/repositories/__init__.py +0 -0
  110. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/repositories/token_repo.py +0 -0
  111. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/repositories/user_repo.py +0 -0
  112. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/services/__init__.py +0 -0
  113. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/services/auth_service.py +0 -0
  114. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/auth/uow.py +0 -0
  115. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/cli.py +0 -0
  116. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/exception_handlers.py +0 -0
  117. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/kit.py +0 -0
  118. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/migrations.py +0 -0
  119. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/__init__.py +0 -0
  120. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/cache/__init__.py +0 -0
  121. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/cache/exceptions.py +0 -0
  122. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/cache/serializers.py +0 -0
  123. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/cache/user_plan_cache.py +0 -0
  124. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/dependencies.py +0 -0
  125. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/domain/__init__.py +0 -0
  126. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/domain/entities.py +0 -0
  127. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/domain/exceptions.py +0 -0
  128. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/dto/__init__.py +0 -0
  129. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/dto/responses.py +0 -0
  130. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/dto/usage.py +0 -0
  131. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/handlers/__init__.py +0 -0
  132. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/handlers/plan_routes.py +0 -0
  133. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/models/__init__.py +0 -0
  134. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/models/feature.py +0 -0
  135. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/models/feature_usage.py +0 -0
  136. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/models/plan.py +0 -0
  137. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/models/plan_limit.py +0 -0
  138. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/models/plan_permission.py +0 -0
  139. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/models/user_plan.py +0 -0
  140. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/repositories/__init__.py +0 -0
  141. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/repositories/usage_repo.py +0 -0
  142. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/services/__init__.py +0 -0
  143. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/plans/uow.py +0 -0
  144. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/py.typed +0 -0
  145. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/rbac/__init__.py +0 -0
  146. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/rbac/cache/__init__.py +0 -0
  147. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/rbac/domain/__init__.py +0 -0
  148. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/rbac/domain/entities.py +0 -0
  149. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/rbac/domain/exceptions.py +0 -0
  150. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/rbac/models/__init__.py +0 -0
  151. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/rbac/models/permission.py +0 -0
  152. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/rbac/models/role.py +0 -0
  153. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/rbac/models/role_permission.py +0 -0
  154. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/rbac/repositories/__init__.py +0 -0
  155. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/rbac/repositories/rbac_repo.py +0 -0
  156. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/rbac/services/__init__.py +0 -0
  157. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/rbac/services/rbac_service.py +0 -0
  158. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/rbac/uow.py +0 -0
  159. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/registry.py +0 -0
  160. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/README.md +0 -0
  161. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/__init__.py +0 -0
  162. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/audit.py +0 -0
  163. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/circuit_breaker.py +0 -0
  164. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/cleanup_scheduler.py +0 -0
  165. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/database.py +0 -0
  166. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/error_formatter.py +0 -0
  167. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/exception_handlers.py +0 -0
  168. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/exceptions.py +0 -0
  169. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/graceful_shutdown.py +0 -0
  170. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/health.py +0 -0
  171. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/http_utils.py +0 -0
  172. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/lockout.py +0 -0
  173. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/logging.py +0 -0
  174. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/metrics.py +0 -0
  175. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/models.py +0 -0
  176. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/protocols.py +0 -0
  177. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/rate_limiter.py +0 -0
  178. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/registry.py +0 -0
  179. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/repository.py +0 -0
  180. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/request_id.py +0 -0
  181. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/schemas.py +0 -0
  182. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/state_store.py +0 -0
  183. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/uow.py +0 -0
  184. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/src/identity_plan_kit/shared/uuid7.py +0 -0
  185. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/test_app.py +0 -0
  186. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/__init__.py +0 -0
  187. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/admin/__init__.py +0 -0
  188. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/auth/__init__.py +0 -0
  189. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/auth/test_audit_regressions_2026_06.py +0 -0
  190. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/auth/test_auth_cache.py +0 -0
  191. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/auth/test_auth_cache_concurrent.py +0 -0
  192. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/auth/test_auth_service.py +0 -0
  193. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/auth/test_circuit_breaker.py +0 -0
  194. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/auth/test_csrf_state.py +0 -0
  195. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/auth/test_dependencies.py +0 -0
  196. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/auth/test_domain_entities.py +0 -0
  197. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/auth/test_http_utils.py +0 -0
  198. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/auth/test_lockout.py +0 -0
  199. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/auth/test_lockout_concurrent.py +0 -0
  200. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/auth/test_oauth_semaphore_timeout.py +0 -0
  201. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/auth/test_review_regressions_2026_05.py +0 -0
  202. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/auth/test_security_comprehensive.py +0 -0
  203. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/auth/test_token_security.py +0 -0
  204. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/conftest.py +0 -0
  205. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/extension/__init__.py +0 -0
  206. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/extension/conftest.py +0 -0
  207. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/extension/test_model_extension.py +0 -0
  208. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/integration/__init__.py +0 -0
  209. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/integration/conftest.py +0 -0
  210. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/integration/test_concurrent_limit_merge.py +0 -0
  211. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/integration/test_concurrent_plan_operations.py +0 -0
  212. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/integration/test_concurrent_service_races.py +0 -0
  213. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/integration/test_concurrent_token_operations.py +0 -0
  214. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/integration/test_concurrent_user_creation.py +0 -0
  215. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/integration/test_concurrent_user_deactivation.py +0 -0
  216. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/integration/test_limit_boundaries.py +0 -0
  217. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/integration/test_plan_cache_race.py +0 -0
  218. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/integration/test_quota_concurrency.py +0 -0
  219. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/integration/test_redis_stale_write_prevention.py +0 -0
  220. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/integration/test_token_cleanup.py +0 -0
  221. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/integration/test_token_repository.py +0 -0
  222. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/integration/test_usage_periods.py +0 -0
  223. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/integration/test_user_repository.py +0 -0
  224. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/plans/__init__.py +0 -0
  225. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/plans/test_circuit_breaker_behavior.py +0 -0
  226. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/plans/test_dependencies.py +0 -0
  227. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/plans/test_domain_entities.py +0 -0
  228. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/plans/test_period_edge_cases.py +0 -0
  229. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/plans/test_plan_cache_bounded_invalidation.py +0 -0
  230. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/plans/test_plan_cache_concurrent.py +0 -0
  231. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/plans/test_plan_cache_interleave.py +0 -0
  232. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/plans/test_plan_service.py +0 -0
  233. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/plans/test_plan_service_cache_ordering.py +0 -0
  234. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/plans/test_plan_service_stampede.py +0 -0
  235. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/plans/test_quota_idempotency_concurrent.py +0 -0
  236. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/plans/test_review_regression_2026_05.py +0 -0
  237. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/plans/test_review_regression_2026_05_06.py +0 -0
  238. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/plans/test_user_plan_cache_concurrent.py +0 -0
  239. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/rbac/__init__.py +0 -0
  240. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/rbac/test_permission_cache.py +0 -0
  241. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/rbac/test_permission_cache_concurrent.py +0 -0
  242. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/rbac/test_rbac_cache_stampede.py +0 -0
  243. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/rbac/test_rbac_service.py +0 -0
  244. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/rbac/test_rbac_service_stampede_real.py +0 -0
  245. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/rbac/test_review_2026_05_06_regressions.py +0 -0
  246. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/rbac/test_review_regressions.py +0 -0
  247. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/shared/test_audit_pii_masking.py +0 -0
  248. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/shared/test_circuit_breaker_concurrent.py +0 -0
  249. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/shared/test_cleanup_scheduler_concurrent.py +0 -0
  250. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/shared/test_constants.py +0 -0
  251. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/shared/test_exception_handlers.py +0 -0
  252. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/shared/test_http_utils_security.py +0 -0
  253. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/shared/test_rate_limiter.py +0 -0
  254. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/shared/test_rate_limiter_concurrent.py +0 -0
  255. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/shared/test_review_regressions.py +0 -0
  256. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/shared/test_state_store_concurrent.py +0 -0
  257. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/shared/test_state_store_resilience.py +0 -0
  258. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/shared/test_uow.py +0 -0
  259. {identity_plan_kit-1.0.2 → identity_plan_kit-1.2.0}/tests/test_kit_wiring.py +0 -0
@@ -0,0 +1,189 @@
1
+ # the name by which the project can be referenced within Serena/when chatting with the LLM.
2
+ project_name: "identity-plan-kit"
3
+
4
+ # list of language servers to start when using the LSP backend; choose from:
5
+ # ada al angular ansible astro
6
+ # bash bsl clojure cpp cpp_ccls
7
+ # crystal csharp csharp_omnisharp cue dart
8
+ # deno elixir elm erlang fortran
9
+ # fsharp gdscript gleam go groovy
10
+ # haskell haxe hlsl html java
11
+ # json julia julia_fatou kotlin latex
12
+ # lean4 lua lua_emmylua luau markdown
13
+ # matlab msl nextflow nix ocaml
14
+ # pascal perl php php_devsense php_phpactor
15
+ # php_phpantom powershell python python_basedpyright python_jedi
16
+ # python_pyrefly python_ty qml r rego
17
+ # ruby ruby_solargraph rust scala scss
18
+ # solidity svelte swift systemverilog terraform
19
+ # toml typescript typescript_tsgo typescript_vts vue
20
+ # vbnet wolfram yaml zig
21
+ # (This list may be outdated; generated with scripts/print_language_list.py;
22
+ # For the current list, see values of the LanguageServerId enum here:
23
+ # https://github.com/oraios/serena/blob/main/src/solidlsp/ls_config.py)
24
+ # For some languages, there are several alternative language servers, e.g. csharp_omnisharp, ruby_solargraph.)
25
+ # Note:
26
+ # - For C, use cpp
27
+ # - For JavaScript, use typescript
28
+ # - For Angular projects, use angular (subsumes typescript+html; requires `npm install` in the project root)
29
+ # - For Astro projects, use astro (subsumes typescript/javascript for .astro projects; requires npm)
30
+ # - For Svelte projects, use svelte (subsumes typescript/javascript for .svelte projects; requires npm)
31
+ # - For Deno projects, use deno (serves the same .ts/.js files as typescript; requires the deno CLI on PATH)
32
+ # - For SCSS / Sass / plain CSS, use scss (some-sass-language-server handles all three)
33
+ # - For Free Pascal/Lazarus, use pascal
34
+ # - External Python adapters may add further registered IDs; install the adapter package first
35
+ # and then use its ID here, for example: example
36
+ # Special requirements:
37
+ # Some language servers require additional setup/installations.
38
+ # See here for details: https://oraios.github.io/serena/01-about/020_programming-languages.html#language-servers
39
+ # When using multiple language servers, the first language server that supports a given file will be used for that file.
40
+ # The first language server is the default language and the respective language server will be used as a fallback.
41
+ # Note that when using the JetBrains backend, language servers are not used and this list is correspondingly ignored.
42
+ language_servers:
43
+ - python
44
+
45
+ # the encoding used by text files in the project
46
+ # For a list of possible encodings, see https://docs.python.org/3.11/library/codecs.html#standard-encodings
47
+ encoding: "utf-8"
48
+
49
+ # optional shell command to run before the language backend (LSP or JetBrains) is initialised.
50
+ # the command runs in the project root directory and is only executed if the project is trusted
51
+ # (see trusted_project_path_patterns in the global configuration).
52
+ # serena waits for the command to exit: a non-zero exit code is logged as an error but does not
53
+ # abort activation. a per-project timeout (activation_command_timeout, default 180s) is the safety
54
+ # backstop for non-terminating commands; on expiry the process is killed and activation continues.
55
+ # example: activation_command: "npx nx run-many -t build"
56
+ activation_command:
57
+
58
+ # maximum time in seconds to wait for activation_command to complete before killing it (default 180s).
59
+ # must be a positive number.
60
+ activation_command_timeout: 180.0
61
+
62
+ # line ending convention to use when writing source files.
63
+ # Possible values: unset (use global setting), "lf", "crlf", or "native" (platform default)
64
+ # This does not affect Serena's own files (e.g. memories and configuration files), which always use native line endings.
65
+ line_ending:
66
+
67
+ # The language backend to use for this project.
68
+ # If not set, the global setting from serena_config.yml is used.
69
+ # Valid values: LSP, JetBrains
70
+ # Note: the backend is fixed at startup. If a project with a different backend
71
+ # is activated post-init, an error will be returned.
72
+ language_backend:
73
+
74
+ # The interface through which the agent (LLM) accesses Serena's functionality (overrides the global setting).
75
+ # Valid values: tools, REPL (see the global configuration for details); leave empty to use the global setting.
76
+ # Note: the interface is fixed at startup. If a project is activated post-init, its setting is not applied.
77
+ agent_interface:
78
+
79
+ # whether to use project's .gitignore files to ignore files
80
+ ignore_all_files_in_gitignore: true
81
+
82
+ # advanced configuration option allowing to configure language server-specific options.
83
+ # Maps the language key to the options.
84
+ # The settings are considered only if the project is trusted (see global configuration to define trusted projects).
85
+ # See https://oraios.github.io/serena/02-usage/050_configuration.html#language-server-specific-settings
86
+ ls_specific_settings: {}
87
+
88
+ # list of workspace folder paths (LSP backend only).
89
+ # These folders will be used to build up Serena's symbol index.
90
+ # Paths must be within the project root and should thus be relative to the project root.
91
+ # Furthermore, the paths should not be filtered by ignore settings.
92
+ # Default setting: The entire project root folder (".") is considered.
93
+ # In (large) monorepos, this can be used to index only subfolders of the project root, e.g.
94
+ # ls_workspace_folders:
95
+ # - "./subproject1"
96
+ # - "./subproject2"
97
+ ls_workspace_folders:
98
+ - "."
99
+
100
+ # list of additional workspace folder paths for cross-package reference support.
101
+ # Paths can be absolute or relative to the project root.
102
+ # Each folder is registered as an LSP workspace folder, enabling language servers to discover
103
+ # symbols and references across package boundaries, but these folders are not indexed by Serena,
104
+ # i.e. the respective symbols will not be found using Serena's symbol search tools.
105
+ # Example:
106
+ # additional_workspace_folders:
107
+ # - ../sibling-package
108
+ # - ../shared-lib
109
+ ls_additional_workspace_folders: []
110
+
111
+ # list of additional paths to ignore in this project.
112
+ # Same syntax as gitignore, so you can use * and **.
113
+ # Important: quote patterns that start with `*`, otherwise YAML treats them as aliases.
114
+ # Example:
115
+ # ignored_paths:
116
+ # - "examples/**"
117
+ # - ".worktrees/**"
118
+ # - "**/bin/**"
119
+ # - "**/obj/**"
120
+ # Note: global ignored_paths from serena_config.yml are also applied additively.
121
+ ignored_paths: []
122
+
123
+ # whether the project is in read-only mode
124
+ # If set to true, all editing tools will be disabled and attempts to use them will result in an error
125
+ # Added on 2025-04-18
126
+ read_only: false
127
+
128
+ # list of tool names (and tool markers) to exclude.
129
+ # This extends the existing exclusions (e.g. from the global configuration)
130
+ # Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html
131
+ excluded_tools: []
132
+
133
+ # list of tools (and tool markers) to include that would otherwise be disabled (particularly optional tools
134
+ # that are disabled by default).
135
+ # This extends the existing inclusions (e.g. from the global configuration).
136
+ # Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html
137
+ included_optional_tools: []
138
+
139
+ # fixed set of tools to use as the base tool set (if non-empty), replacing Serena's default set of tools.
140
+ # This cannot be combined with non-empty excluded_tools or included_optional_tools.
141
+ # Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html
142
+ fixed_tools: []
143
+
144
+ # list of APIs (facades or facade methods, e.g. "lsp" or "lsp.find_symbol") to exclude from the REPL.
145
+ # Add "marker:editing" to exclude all editing functions.
146
+ # This extends the existing exclusions (e.g. from the global configuration).
147
+ excluded_apis: []
148
+
149
+ # list of APIs (facades or facade methods, e.g. "lsp" or "lsp.get_diagnostics_for_symbol") to include in the REPL
150
+ # that would otherwise be disabled (particularly optional methods, which are disabled by default).
151
+ # This extends the existing inclusions (e.g. from the global configuration).
152
+ included_apis: []
153
+
154
+ # list of mode names that are to be activated by default, overriding the setting in the global configuration.
155
+ # The full set of modes to be activated is base_modes (from global config) + default_modes + added_modes.
156
+ # If the setting is undefined/empty, the default_modes from the global configuration (serena_config.yml) apply.
157
+ # Otherwise, this overrides the setting from the global configuration (serena_config.yml).
158
+ # Therefore, you can set this to [] if you do not want the default modes defined in the global config to apply
159
+ # for this project.
160
+ # This setting can, in turn, be overridden by CLI parameters (--mode).
161
+ # See https://oraios.github.io/serena/02-usage/050_configuration.html#modes
162
+ default_modes:
163
+
164
+ # list of mode names to be activated additionally for this project, e.g. ["query-projects"]
165
+ # The full set of modes to be activated is base_modes (from global config) + default_modes + added_modes.
166
+ # See https://oraios.github.io/serena/02-usage/050_configuration.html#modes
167
+ added_modes:
168
+
169
+ # initial prompt for the project. It will always be given to the LLM upon activating the project
170
+ # (contrary to the memories, which are loaded on demand).
171
+ initial_prompt: ""
172
+
173
+ # time budget (seconds) per tool call for the retrieval of additional symbol information
174
+ # such as docstrings or parameter information.
175
+ # This overrides the corresponding setting in the global configuration; see the documentation there.
176
+ # If null or missing, use the setting from the global configuration.
177
+ symbol_info_budget:
178
+
179
+ # list of regex patterns which, when matched, mark a memory entry as read‑only.
180
+ # Extends the list from the global configuration, merging the two lists.
181
+ read_only_memory_patterns: []
182
+
183
+ # list of regex patterns for memories to completely ignore.
184
+ # Matching memories will not appear in list_memories or activate_project output
185
+ # and cannot be accessed via read_memory or write_memory.
186
+ # To access ignored memory files, use the read_file tool on the raw file path.
187
+ # Extends the list from the global configuration, merging the two lists.
188
+ # Example: ["_archive/.*", "_episodes/.*"]
189
+ ignored_memory_patterns: []
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: identity-plan-kit
3
- Version: 1.0.2
3
+ Version: 1.2.0
4
4
  Summary: Modern FastAPI library for authentication, RBAC, subscription plans, and usage tracking
5
5
  Author-email: harut <harut.avetisyan2002@gmail.com>
6
6
  License: MIT
@@ -19,10 +19,10 @@ Classifier: Typing :: Typed
19
19
  Requires-Python: >=3.11
20
20
  Requires-Dist: alembic>=1.14.0
21
21
  Requires-Dist: asyncpg>=0.30.0
22
- Requires-Dist: authlib>=1.4.0
22
+ Requires-Dist: authlib>=1.9.10
23
23
  Requires-Dist: bcrypt<5.0.0,>=4.0.0
24
24
  Requires-Dist: fastapi>=0.115.0
25
- Requires-Dist: httpx>=0.28.0
25
+ Requires-Dist: httpx2>=2.16.2
26
26
  Requires-Dist: itsdangerous>=2.2.0
27
27
  Requires-Dist: orjson>=3.10.0
28
28
  Requires-Dist: passlib[bcrypt]>=1.7.4
@@ -38,12 +38,12 @@ Requires-Dist: tenacity>=9.0.0
38
38
  Requires-Dist: typer>=0.12.0
39
39
  Requires-Dist: uuid-utils>=0.10.0
40
40
  Provides-Extra: admin
41
- Requires-Dist: sqladmin>=0.20.0; extra == 'admin'
41
+ Requires-Dist: sqladmin>=0.32.0; extra == 'admin'
42
42
  Provides-Extra: cli
43
43
  Requires-Dist: python-dotenv>=1.0.0; extra == 'cli'
44
44
  Provides-Extra: dev
45
45
  Requires-Dist: bump-my-version>=0.26.0; extra == 'dev'
46
- Requires-Dist: httpx>=0.28.0; extra == 'dev'
46
+ Requires-Dist: httpx2>=2.16.2; extra == 'dev'
47
47
  Requires-Dist: pre-commit>=4.0.0; extra == 'dev'
48
48
  Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
49
49
  Requires-Dist: pytest-cov>=6.0.0; extra == 'dev'
@@ -624,7 +624,7 @@ All configuration is via environment variables or `IdentityPlanKitConfig`:
624
624
  | `IPK_ENABLE_AUTO_CLEANUP` | Auto cleanup expired tokens | `true` |
625
625
  | `IPK_CLEANUP_INTERVAL_HOURS` | Cleanup interval in hours | `6.0` |
626
626
  | `IPK_DATABASE_STATEMENT_TIMEOUT_MS` | PostgreSQL statement timeout | `30000` |
627
- | `IPK_TOKEN_REFRESH_IDEMPOTENCY_TTL_SECONDS` | Token refresh idempotency window | `30` |
627
+ | `IPK_TOKEN_REFRESH_IDEMPOTENCY_TTL_SECONDS` | Token refresh idempotency / reuse-detection grace window (5-600) | `300` |
628
628
  | `IPK_QUOTA_IDEMPOTENCY_TTL_SECONDS` | Quota consumption idempotency window | `60` |
629
629
  | `IPK_REQUIRE_REDIS` | Fail if Redis unavailable | Auto (true in prod) |
630
630
 
@@ -560,7 +560,7 @@ All configuration is via environment variables or `IdentityPlanKitConfig`:
560
560
  | `IPK_ENABLE_AUTO_CLEANUP` | Auto cleanup expired tokens | `true` |
561
561
  | `IPK_CLEANUP_INTERVAL_HOURS` | Cleanup interval in hours | `6.0` |
562
562
  | `IPK_DATABASE_STATEMENT_TIMEOUT_MS` | PostgreSQL statement timeout | `30000` |
563
- | `IPK_TOKEN_REFRESH_IDEMPOTENCY_TTL_SECONDS` | Token refresh idempotency window | `30` |
563
+ | `IPK_TOKEN_REFRESH_IDEMPOTENCY_TTL_SECONDS` | Token refresh idempotency / reuse-detection grace window (5-600) | `300` |
564
564
  | `IPK_QUOTA_IDEMPOTENCY_TTL_SECONDS` | Quota consumption idempotency window | `60` |
565
565
  | `IPK_REQUIRE_REDIS` | Fail if Redis unavailable | Auto (true in prod) |
566
566
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "identity-plan-kit"
3
- version = "1.0.2"
3
+ version = "1.2.0"
4
4
  description = "Modern FastAPI library for authentication, RBAC, subscription plans, and usage tracking"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -30,8 +30,8 @@ dependencies = [
30
30
  "sqlalchemy[asyncio]>=2.0.0",
31
31
  "asyncpg>=0.30.0",
32
32
  "alembic>=1.14.0",
33
- "httpx>=0.28.0",
34
- "authlib>=1.4.0",
33
+ "httpx2>=2.16.2",
34
+ "authlib>=1.9.10",
35
35
  "passlib[bcrypt]>=1.7.4",
36
36
  "bcrypt>=4.0.0,<5.0.0", # Pin bcrypt <5 for passlib compatibility
37
37
  "uuid-utils>=0.10.0",
@@ -51,7 +51,7 @@ dev = [
51
51
  "pytest>=8.0.0",
52
52
  "pytest-asyncio>=0.24.0",
53
53
  "pytest-cov>=6.0.0",
54
- "httpx>=0.28.0",
54
+ "httpx2>=2.16.2",
55
55
  "ruff>=0.8.0",
56
56
  "ty>=0.0.47",
57
57
  "pre-commit>=4.0.0",
@@ -69,7 +69,7 @@ metrics = [
69
69
  "prometheus-client>=0.20.0",
70
70
  ]
71
71
  admin = [
72
- "sqladmin>=0.20.0",
72
+ "sqladmin>=0.32.0",
73
73
  ]
74
74
  redis = [
75
75
  "redis[hiredis]>=5.0.0",
@@ -158,7 +158,7 @@ testpaths = ["tests"]
158
158
  addopts = "-v --tb=short"
159
159
 
160
160
  [tool.bumpversion]
161
- current_version = "1.0.2"
161
+ current_version = "1.2.0"
162
162
  parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
163
163
  serialize = ["{major}.{minor}.{patch}"]
164
164
  tag = true
@@ -10,11 +10,11 @@ Provides pre-configured admin views for all models:
10
10
  from __future__ import annotations
11
11
 
12
12
  import os
13
- from pathlib import Path
14
13
  from typing import TYPE_CHECKING, Any
15
14
  from uuid import UUID
16
15
 
17
16
  from sqladmin import Admin, ModelView
17
+ from sqladmin.authorization import Action
18
18
  from sqlalchemy.exc import IntegrityError
19
19
  from starlette.requests import Request
20
20
  from wtforms import validators
@@ -38,6 +38,9 @@ from identity_plan_kit.shared.logging import get_logger
38
38
 
39
39
  logger = get_logger(__name__)
40
40
 
41
+ # SQLAdmin actions restricted to superadmin; list/details/export stay open to admins.
42
+ _WRITE_ACTIONS = frozenset({Action.CREATE, Action.EDIT, Action.DELETE, Action.IMPORT})
43
+
41
44
  if TYPE_CHECKING:
42
45
  from fastapi import FastAPI
43
46
  from sqlalchemy.ext.asyncio import AsyncEngine
@@ -117,8 +120,9 @@ class BaseAdminView(ModelView):
117
120
  The permission checking uses the AdminAuthBackend from the request's
118
121
  app state when available.
119
122
 
120
- Note: UI button visibility is controlled via custom templates that check
121
- request.session['admin_role']. This is thread-safe because SQLAdmin
123
+ UI button visibility is controlled per request via ``has_permission``,
124
+ which SQLAdmin consults for every create/edit/delete/import button and
125
+ route. It reads the session on each call, so it is safe even though
122
126
  ModelView instances are singletons shared across requests.
123
127
  """
124
128
 
@@ -159,11 +163,17 @@ class BaseAdminView(ModelView):
159
163
 
160
164
  Requires an authenticated session. Both superadmin and admin can view;
161
165
  write actions are gated by insert_model/update_model/delete_model
162
- which call _is_superadmin directly. Templates additionally hide write
163
- buttons via is_superadmin_user(request).
166
+ which call _is_superadmin directly. has_permission additionally hides
167
+ write buttons and blocks write routes for non-superadmins.
164
168
  """
165
169
  return bool(request.session.get("admin_authenticated"))
166
170
 
171
+ def has_permission(self, request: Request, action: str, obj: Any | None = None) -> bool:
172
+ """Only superadmin may create, edit, delete, or import records."""
173
+ if action in _WRITE_ACTIONS and not self._is_superadmin(request):
174
+ return False
175
+ return super().has_permission(request, action, obj)
176
+
167
177
  async def on_model_change(
168
178
  self, data: dict[str, Any], model: Any, is_created: bool, request: Request
169
179
  ) -> None:
@@ -1130,19 +1140,16 @@ def setup_admin(
1130
1140
  base_url=base_url,
1131
1141
  )
1132
1142
 
1133
- # Use bundled templates for role-based permission UI if no custom templates_dir provided.
1134
- # These templates check is_superadmin_user(request) to hide edit/delete buttons for non-superadmin.
1135
- if templates_dir is None:
1136
- templates_dir = str(Path(__file__).parent / "templates")
1137
-
1138
- # Build kwargs
1143
+ # Build kwargs. Role-based button visibility comes from
1144
+ # BaseAdminView.has_permission, so SQLAdmin's stock templates suffice.
1139
1145
  admin_kwargs: dict[str, Any] = {
1140
1146
  "app": app,
1141
1147
  "engine": engine,
1142
1148
  "title": title,
1143
1149
  "base_url": base_url,
1144
- "templates_dir": templates_dir,
1145
1150
  }
1151
+ if templates_dir is not None:
1152
+ admin_kwargs["templates_dir"] = templates_dir
1146
1153
  if authentication_backend is not None:
1147
1154
  admin_kwargs["authentication_backend"] = authentication_backend
1148
1155
 
@@ -1164,21 +1171,6 @@ def setup_admin(
1164
1171
  "user_plan": user_plan_cache,
1165
1172
  }
1166
1173
 
1167
- # Add Jinja2 global function for role-based permission checking in templates.
1168
- # This is thread-safe because it checks request.session on each call,
1169
- # unlike modifying ModelView instance attributes which are shared.
1170
- def is_superadmin_user(request: Request) -> bool:
1171
- """Check if current user is superadmin (for use in templates)."""
1172
- if authentication_backend and hasattr(authentication_backend, "is_superadmin"):
1173
- return authentication_backend.is_superadmin(request)
1174
- # SECURITY: Deny by default when no auth backend is configured
1175
- return False
1176
-
1177
- # Jinja2's Environment.globals is an untyped dict; widen so the checker
1178
- # accepts adding our template helper.
1179
- template_globals: dict[str, Any] = admin.templates.env.globals
1180
- template_globals["is_superadmin_user"] = is_superadmin_user
1181
-
1182
1174
  for view in get_all_admin_views():
1183
1175
  admin.add_view(view)
1184
1176
 
@@ -672,16 +672,18 @@ class RedisAuthCache(AbstractAuthCache):
672
672
  # Wall clock (time.time()) — comparable across processes/hosts.
673
673
  timestamp = time.time()
674
674
  inv_key = self._make_invalidation_key(user_id)
675
- await self._execute_with_retry(
676
- "setex",
677
- self._client.setex,
678
- inv_key,
679
- self._ttl_seconds * 2,
680
- str(timestamp),
681
- )
682
-
683
675
  key = self._make_key(user_id)
684
- await self._execute_with_retry("delete", self._client.delete, key)
676
+ client = self._client
677
+
678
+ async def _invalidate_pipe() -> None:
679
+ # setex (stale-write stamp) + delete (cached value) in one
680
+ # round-trip. Pipeline preserves order, so the stamp lands first.
681
+ async with client.pipeline(transaction=False) as pipe:
682
+ pipe.setex(inv_key, self._ttl_seconds * 2, str(timestamp))
683
+ pipe.delete(key)
684
+ await pipe.execute()
685
+
686
+ await self._execute_with_retry("invalidate", _invalidate_pipe)
685
687
  logger.debug("auth_cache_invalidated", user_id=str(user_id))
686
688
 
687
689
  async def invalidate_all(self) -> None:
@@ -5,7 +5,7 @@ import secrets
5
5
  from dataclasses import dataclass
6
6
  from typing import Any, cast
7
7
 
8
- import httpx
8
+ import httpx2
9
9
  from authlib.integrations.httpx_client import AsyncOAuth2Client
10
10
  from tenacity import (
11
11
  before_sleep_log,
@@ -34,7 +34,7 @@ GOOGLE_USERINFO_URL = "https://www.googleapis.com/oauth2/v3/userinfo"
34
34
 
35
35
  # HTTP timeout configuration. Connect/pool kept tight; read/write longer to
36
36
  # accommodate occasional Google latency on userinfo.
37
- HTTP_TIMEOUT = httpx.Timeout(
37
+ HTTP_TIMEOUT = httpx2.Timeout(
38
38
  connect=5.0,
39
39
  read=10.0,
40
40
  write=10.0,
@@ -43,11 +43,11 @@ HTTP_TIMEOUT = httpx.Timeout(
43
43
 
44
44
  # Retry only on transient network errors. HTTP 4xx (bad request) is never retried.
45
45
  RETRYABLE_EXCEPTIONS = (
46
- httpx.ConnectError,
47
- httpx.ConnectTimeout,
48
- httpx.ReadTimeout,
49
- httpx.WriteTimeout,
50
- httpx.PoolTimeout,
46
+ httpx2.ConnectError,
47
+ httpx2.ConnectTimeout,
48
+ httpx2.ReadTimeout,
49
+ httpx2.WriteTimeout,
50
+ httpx2.PoolTimeout,
51
51
  OSError,
52
52
  ConnectionError,
53
53
  )
@@ -259,7 +259,7 @@ class GoogleOAuthService:
259
259
  try:
260
260
  await self._acquire_semaphore()
261
261
  acquired = True
262
- # authlib's AsyncOAuth2Client subclasses httpx.AsyncClient (a real
262
+ # authlib's AsyncOAuth2Client subclasses httpx2.AsyncClient (a real
263
263
  # async context manager), but its stubs omit __aenter__/__aexit__,
264
264
  # so type checkers misread the `async with` form — manage the
265
265
  # client lifecycle explicitly instead.
@@ -277,13 +277,13 @@ class GoogleOAuthService:
277
277
  )
278
278
  logger.debug("oauth_code_exchanged", provider="google")
279
279
  return dict(token)
280
- except httpx.TimeoutException:
280
+ except httpx2.TimeoutException:
281
281
  logger.warning(
282
282
  "oauth_code_exchange_timeout",
283
283
  provider="google",
284
284
  )
285
285
  raise
286
- except httpx.HTTPStatusError as e:
286
+ except httpx2.HTTPStatusError as e:
287
287
  if HTTP_CLIENT_ERROR_MIN <= e.response.status_code < HTTP_CLIENT_ERROR_MAX:
288
288
  logger.exception(
289
289
  "oauth_code_exchange_client_error",
@@ -311,9 +311,9 @@ class GoogleOAuthService:
311
311
  provider="google",
312
312
  ) from e
313
313
  finally:
314
- # cast: authlib's stubs omit the httpx.AsyncClient base
314
+ # cast: authlib's stubs omit the httpx2.AsyncClient base
315
315
  # surface entirely (aclose, __aenter__, ...).
316
- await cast("httpx.AsyncClient", client).aclose()
316
+ await cast("httpx2.AsyncClient", client).aclose()
317
317
  finally:
318
318
  if acquired:
319
319
  self._semaphore.release()
@@ -372,7 +372,7 @@ class GoogleOAuthService:
372
372
  try:
373
373
  await self._acquire_semaphore()
374
374
  acquired = True
375
- async with httpx.AsyncClient(timeout=HTTP_TIMEOUT) as client:
375
+ async with httpx2.AsyncClient(timeout=HTTP_TIMEOUT) as client:
376
376
  try:
377
377
  response = await client.get(
378
378
  GOOGLE_USERINFO_URL,
@@ -396,14 +396,14 @@ class GoogleOAuthService:
396
396
  family_name=data.get("family_name"),
397
397
  picture=data.get("picture"),
398
398
  )
399
- except httpx.TimeoutException:
399
+ except httpx2.TimeoutException:
400
400
  logger.warning(
401
401
  "oauth_user_info_timeout",
402
402
  provider="google",
403
403
  )
404
404
  # Re-raise for retry
405
405
  raise
406
- except httpx.HTTPStatusError as e:
406
+ except httpx2.HTTPStatusError as e:
407
407
  # HTTP errors - don't retry 4xx
408
408
  if HTTP_CLIENT_ERROR_MIN <= e.response.status_code < HTTP_CLIENT_ERROR_MAX:
409
409
  logger.exception(
@@ -442,11 +442,13 @@ class IdentityPlanKitConfig(BaseSettings):
442
442
 
443
443
  # Token refresh idempotency
444
444
  token_refresh_idempotency_ttl_seconds: int = Field(
445
- default=30,
445
+ default=300,
446
446
  ge=5,
447
- le=120,
447
+ le=600,
448
448
  description="TTL for token refresh idempotency cache in seconds. "
449
- "Allows clients to safely retry refresh requests within this window.",
449
+ "Allows clients to safely retry refresh requests within this window; "
450
+ "a rotated refresh token replayed within it is rejected without "
451
+ "triggering reuse detection (session revoke + account deactivation).",
450
452
  )
451
453
 
452
454
  # Quota consumption idempotency
@@ -805,25 +805,20 @@ class RedisPlanCache(AbstractPlanCache):
805
805
  timestamp = time.time()
806
806
  inv_key = self._make_invalidation_key(plan_code)
807
807
  all_inv_key = self._make_invalidation_key(ALL_PLANS_KEY)
808
- await self._execute_with_retry(
809
- "setex",
810
- self._client.setex,
811
- inv_key,
812
- self._ttl_seconds * 2,
813
- str(timestamp),
814
- )
815
- await self._execute_with_retry(
816
- "setex",
817
- self._client.setex,
818
- all_inv_key,
819
- self._ttl_seconds * 2,
820
- str(timestamp),
821
- )
822
-
823
- # Delete cached plan and all plans list
824
808
  key = self._make_key(plan_code)
825
809
  all_key = self._make_key(ALL_PLANS_KEY)
826
- await self._execute_with_retry("delete", self._client.delete, key, all_key)
810
+ client = self._client
811
+
812
+ async def _invalidate_pipe() -> None:
813
+ # Two stale-write stamps + delete of both cached keys in one
814
+ # round-trip. Pipeline preserves order: stamps land before deletes.
815
+ async with client.pipeline(transaction=False) as pipe:
816
+ pipe.setex(inv_key, self._ttl_seconds * 2, str(timestamp))
817
+ pipe.setex(all_inv_key, self._ttl_seconds * 2, str(timestamp))
818
+ pipe.delete(key, all_key)
819
+ await pipe.execute()
820
+
821
+ await self._execute_with_retry("invalidate", _invalidate_pipe)
827
822
 
828
823
  logger.debug("plan_cache_invalidated", plan_code=plan_code)
829
824
 
@@ -434,6 +434,7 @@ class PlanRepository(BaseRepository[PlanModel, Plan]):
434
434
  started_at: date | None = None,
435
435
  ends_at: date | None = None,
436
436
  custom_limits: dict[str, Any] | None = None,
437
+ plan_code: str | None = None,
437
438
  ) -> UserPlan:
438
439
  """
439
440
  Create a user plan assignment.
@@ -513,9 +514,29 @@ class PlanRepository(BaseRepository[PlanModel, Plan]):
513
514
  plan_id=str(plan_id),
514
515
  ) from e
515
516
 
516
- # Reload with relationships. ``session.refresh(model, ["plan"])`` is
517
- # a no-op under ``lazy="noload"`` (the strategy refuses to load), so
518
- # we re-fetch with explicit ``selectinload``.
517
+ logger.info(
518
+ "user_plan_created",
519
+ user_id=str(user_id),
520
+ plan_id=str(plan_id),
521
+ )
522
+
523
+ # The entity only needs the plan's ``code``. When the caller already
524
+ # has the plan loaded it passes ``plan_code``, letting us build the
525
+ # entity in-memory and skip the reload round-trip.
526
+ if plan_code is not None:
527
+ return UserPlan(
528
+ id=model.id,
529
+ user_id=model.user_id,
530
+ plan_id=model.plan_id,
531
+ plan_code=plan_code,
532
+ started_at=model.started_at,
533
+ ends_at=model.ends_at,
534
+ custom_limits=model.custom_limits or {},
535
+ )
536
+
537
+ # Fallback: reload with relationships. ``session.refresh(model,
538
+ # ["plan"])`` is a no-op under ``lazy="noload"`` (the strategy refuses
539
+ # to load), so we re-fetch with explicit ``selectinload``.
519
540
  stmt = (
520
541
  select(UserPlanModel)
521
542
  .options(selectinload(UserPlanModel.plan))
@@ -524,12 +545,6 @@ class PlanRepository(BaseRepository[PlanModel, Plan]):
524
545
  result = await self._session.execute(stmt)
525
546
  reloaded = result.scalar_one()
526
547
 
527
- logger.info(
528
- "user_plan_created",
529
- user_id=str(user_id),
530
- plan_id=str(plan_id),
531
- )
532
-
533
548
  return self._user_plan_to_entity(reloaded)
534
549
 
535
550
  async def get_user_plan_by_id(self, user_plan_id: UUID) -> UserPlan | None: