Skip to content

Feat/security - #56

Merged
borhanst merged 13 commits into
mainfrom
feat/security
Sep 1, 2026
Merged

Feat/security#56
borhanst merged 13 commits into
mainfrom
feat/security

Conversation

@borhanst

@borhanst borhanst commented Sep 1, 2026

Copy link
Copy Markdown
Owner

No description provided.

borhanst and others added 13 commits August 21, 2026 11:09
- Updated installation requirements to include `fastapi-redis-sdk` for Redis support.
- Introduced `CacheConfig` for managing caching and rate limiting configurations.
- Implemented Redis-backed login rate limiting with graceful degradation to in-memory fallback.
- Added Redis caching for list and detail endpoints, including automatic cache headers.
- Enhanced documentation to cover new Redis features and usage.
- Created tests for Redis caching and rate limiting functionalities.
…gainst privilege escalation, and address XSS vulnerabilities in admin interface. Add regression tests for sensitive fields, stale JWTs, and mass assignment protections.
- Implement token validation to ensure tokens are not valid after a password change.
- Introduce access token TTL configuration and enforce limits on API token usage.
- Add privileged assignment fields to prevent unauthorized writes to sensitive user model fields.
- Improve file storage backend to enforce size limits and prevent path traversal vulnerabilities.
- Update JSON body parsing to ensure validation rules are consistently applied across API requests.
- Add regression tests for API validation bypass, token revocation, and storage traversal vulnerabilities.
- Introduced `get_client_ip` function to resolve client IPs behind reverse proxies, ensuring that `X-Forwarded-For` headers are only trusted when the immediate peer is a configured trusted proxy.
- Updated rate limiting logic in authentication endpoints to count failed attempts per (client IP, email) for token requests, and per client IP for refresh and logout requests.
- Refactored `RateLimiter` to be asyncio-safe, replacing threading locks with asyncio locks.
- Added configuration for trusted proxies in `AuthConfig`, allowing for flexible deployment scenarios.
- Enhanced middleware to utilize the new IP resolution logic for audit context.
- Updated tests to cover new rate limiting behavior and client IP resolution scenarios.
…port/import modules

- refactor password hashing to use bcrypt for backup codes, maintaining legacy SHA256 support
- enforce session security by requiring 'iat' claim in tokens and ensuring unique session IDs on login
- implement formula injection prevention in CSV/Excel exports
- restrict import fields to prevent sensitive data exposure and ensure proper permissions for export/import actions
- improve error handling with appropriate status codes for unauthorized access
- add tests for new security features and ensure legacy compatibility
- Updated materialization of user-related models to derive foreign key types from referenced models, ensuring consistency in primary key types.
- Introduced a new mapping for built-in schemas to facilitate foreign key type resolution.
- Refactored user schemas to use string types for user IDs, aligning with UUID and string-based implementations.
- Added tests to validate foreign key type derivation and ensure correct behavior with custom authentication models.
- Improved security documentation and added a TODO file for ongoing security remediation efforts.
- Updated documentation navigation to include a new guide on custom authentication models.
@borhanst
borhanst merged commit e5f18c3 into main Sep 1, 2026
3 checks passed
@borhanst
borhanst deleted the feat/security branch September 1, 2026 09:54
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