Skip to content

Implement User Authentication and Authorization #1

Description

@YanCotta

Description: The application currently lacks user authentication and authorization. This is a critical feature for any production application. The goal is to implement a complete authentication system using JWT, including user registration, login, and role-based access control.

Tasks:

Implement the logic in UserService and AuthService to handle user creation, password hashing, and token generation.

Create API endpoints for user registration, login, and token refresh.

Secure the existing endpoints using the get_current_active_user and has_required_roles dependencies.

Define user roles (e.g., user, admin, analyst) and implement the logic to check for these roles.

Relevant Files:

src/climate_risk/interfaces/api/dependencies.py

src/climate_risk/application/services/user_service.py (to be created)

src/climate_risk/application/services/auth_service.py (to be created)

src/climate_risk/domain/entities/user.py (to be created)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions