Skip to content

feat: Refactor core logic and enhance security #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 9, 2025
Merged

Conversation

RandomProgramm3r
Copy link
Owner

This commit introduces a major refactoring of core application logic to improve modularity, performance, and security.

Key changes include:

  • Centralized Core Utilities:

    • A new core application has been updated to house shared utilities.
    • CustomLimitOffsetPagination is now centralized in core.pagination.
    • A generic bump_token_version utility in core.utils.auth now handles token versioning for both User and Company models and includes cache invalidation.
  • Performance and Security Enhancements:

  • Implemented a caching layer for the authentication process. Authenticated user and company instances are now cached to reduce database queries.

  • Strengthened password security by setting Argon2 as the default password hasher.

  • Code Simplification:

    • Removed custom email validators in favor of relying on database integrity constraints (try...except IntegrityError), making the validation logic more robust and reducing boilerplate code.
  • Other changes:

    • Remove unused imports from tests

This commit introduces a major refactoring of core application logic to improve modularity, performance, and security.

Key changes include:

- **Centralized Core Utilities:**
  - A new `core` application has been updated to house shared utilities.
  - `CustomLimitOffsetPagination` is now centralized in `core.pagination`.
  - A generic `bump_token_version` utility in `core.utils.auth` now handles token versioning for both User and Company models and includes cache invalidation.

 - **Performance and Security Enhancements:**
  - Implemented a caching layer for the authentication process. Authenticated user and company instances are now cached to reduce database queries.
  - Strengthened password security by setting Argon2 as the default password hasher.
- **Code Simplification:**
  - Removed custom email validators in favor of relying on database integrity constraints (`try...except IntegrityError`), making the validation logic more robust and reducing boilerplate code.
@RandomProgramm3r RandomProgramm3r merged commit c9bd58f into main Jul 9, 2025
2 checks passed
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.

1 participant