Skip to content

Conversation

@nishika26
Copy link
Collaborator

@nishika26 nishika26 commented Jun 12, 2025

Summary

Target issue is #209

Notes on changes made

  1. Along with removing hardcoded strings (EMAIL TEST USER and FRONTEND_HOST) , The removal of the prefix for the AWS S3 bucket ("ai-platform-documents") was done in this pr as well , as it was hardcoded in config.py. Additionally, the variavle was moved to .env for it to fetch the prefix from there.

  2. Additionally, the ENVIRONMENT variable is not hardcoded in config.py. The code supports fetching it from the .env file, and if it's not provided, it defaults to "local".

  3. Removed all SMTP-related credentials and variables associated with frontend configurations. Removed test cases that were using SMTP credentials for sending recovery emails and related functionalities.

  4. Eliminated CORS middleware setup in both the configuration file and app/main.py as the service will not have a frontend in the near future.

Additional Explanation:

  • SMTP - Simple mail transfer protocol
  • CORS (Cross-Origin Resource Sharing) Middleware is typically used to handle cross-origin requests from a frontend application hosted on a different domain or port. This middleware is necessary when a backend service needs to accept requests from web pages running on different domains.

@codecov
Copy link

codecov bot commented Jun 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@nishika26 nishika26 marked this pull request as ready for review June 13, 2025 04:40
return bool(self.SMTP_HOST and self.EMAILS_FROM_EMAIL)

EMAIL_TEST_USER: EmailStr = "test@example.com"
EMAIL_TEST_USER: EmailStr
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea is also to check if we are using these variables and if not then remove it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is being used in test cases for user and login routes

# 60 minutes * 24 hours * 1 days = 1 days
ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 * 24 * 1
FRONTEND_HOST: str = "http://localhost:5173"
FRONTEND_HOST: str
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need FRONTEND_HOST ?

Copy link
Collaborator Author

@nishika26 nishika26 Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't, hence I have removed it from config.py and everything else related to frontend configuration

@nishika26 nishika26 requested review from vijay-T4D June 16, 2025 08:53
@nishika26 nishika26 self-assigned this Jun 16, 2025
@nishika26 nishika26 added enhancement New feature or request labels Jun 16, 2025
@nishika26 nishika26 moved this to In Progress in Kaapi-dev Jun 16, 2025
@nishika26 nishika26 linked an issue Jun 16, 2025 that may be closed by this pull request
@AkhileshNegi AkhileshNegi merged commit ea39ea6 into main Jun 18, 2025
2 checks passed
@AkhileshNegi AkhileshNegi deleted the cleanup/hardcoded_string branch June 18, 2025 06:38
@github-project-automation github-project-automation bot moved this from In Progress to Closed in Kaapi-dev Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

Remove Hardcoded Strings

4 participants