-
Notifications
You must be signed in to change notification settings - Fork 7
Cleanup : Removing hardcoded strings #222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
| return bool(self.SMTP_HOST and self.EMAILS_FROM_EMAIL) | ||
|
|
||
| EMAIL_TEST_USER: EmailStr = "test@example.com" | ||
| EMAIL_TEST_USER: EmailStr |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
backend/app/core/config.py
Outdated
| # 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 |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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
Summary
Target issue is #209
Notes on changes made
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.
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".
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.
Eliminated CORS middleware setup in both the configuration file and
app/main.pyas the service will not have a frontend in the near future.Additional Explanation: