Skip to content

feat(auth): implement basic jwt auth and password hashing#4

Merged
codewithme-py merged 1 commit intomainfrom
feat/Auth-security-layer
Feb 19, 2026
Merged

feat(auth): implement basic jwt auth and password hashing#4
codewithme-py merged 1 commit intomainfrom
feat/Auth-security-layer

Conversation

@codewithme-py
Copy link
Owner

Implemented bcrypt hashing using passlib.
Note: Forced bcrypt version 3.2.2 and passlib 1.7.4 to resolve compatibility issues with passlib on Python 3.11+.
JWT Authentication: Added

create_access_token
utility (HS256) with configurable expiration.
Dependencies: Created

get_current_user
dependency for securing API endpoints using OAuth2PasswordBearer.
User Service:
Refactored UserService.create_user to handle password hashing.
Added UserService.authenticate_user for login logic.
API Endpoints:
POST /api/v1/users: Registration (returns 201).
POST /api/v1/auth/token: Login (returns JWT).
GET /api/v1/users/me: Protected profile endpoint.
Infrastructure:
Fixed Docker Compose container names to match

.env
hostnames (removed fairdrop- prefix).
Configured Swagger UI to Authorization URL correctly (/api/v1/auth/token).

@codewithme-py codewithme-py merged commit ccad5d4 into main Feb 19, 2026
1 check 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