Skip to content

Enforce email validation for Shared Access apis #347

@nndn

Description

@nndn

Proposed Changes:

Email Validation Functionality:
    Create a utility function to validate email addresses. This function should check for proper formatting and potentially check if the domain exists.
    Utilize the existing email_helper.py utility module, or create a new module if necessary.

Integration with Sharing Logic:
    Modify the sharing functionality within the ShareChatService class located in app/modules/conversations/access/access_service.py to incorporate the email validation functionality before attempting to share the chat.
    If the email fails validation, provide appropriate error messages to the user.

Update API Documentation:
    Ensure any API routes related to sharing chats document the requirement for email validation, including expected error messages for invalid inputs.

Create Unit Tests:
    Add unit tests to verify that the email validation works as intended.
    Tests should cover various scenarios, including valid and invalid email formats.

Potential Challenges:
    Consider potential edge cases in email formats.
    Ensure that validation does not significantly impact performance during high-concurrency situations.

Code Consistency:
    Follow existing styles and patterns used in the project.
    Comment code appropriately, especially the parts handling error messages for validation failures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions