# `config.py` ## Overview This file serves as the central configuration registry for the EMI Checkout backend application. It loads environment variables dynamically using `dotenv` and sets up variables, API endpoints, credentials, and business logic mappings used across the services. ## Key Sections ### 1. Environment & Secrets - **App & Security Keys**: Extracts `SECRET_KEY`, `HASH_KEY`, and encryption keys (`AES256_IV`, `AES256_KEY`). - **Network / CORS**: Defines allowed origin domains (`domain`) for `CORS` setup. - **Route Authorization Mappings**: - `BASIC_AUTH_ROUTES`: Defines which endpoints require Basic Auth middleware. - `JWT_AUTH_ROUTES`: Defines endpoints that require JWT authentication. ### 2. External Service Endpoints & Credentials - **Internal Microservices**: URLs for `CF_ENDPOINT`, `BUREAU_ENDPOINT`, and `EMI_CHECKOUT_BE_ENDPOINT`. - **Exotel**: Tokens and keys for sending SMS messages. - **AWS Services**: S3 credentials (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_BUCKET`) and Cloudwatch logging parameters. - **Digio (VKYC/eSign)**: Client secrets and workflow templates mapped out for different lenders (e.g., CF vs. P2P). - **Other Vendors**: Keys for Karza, Pirimid, and Mailgun. ### 3. Application Mappings - **Document Paths (`DOC_PATH`)**: A dictionary mapping common document terms (e.g., `PAN`, `SALARY_SLIP`) to their expected database/S3 prefixes. - **Document Formats (`DOC_FORMAT`)**: Array of acceptable upload file extensions (e.g., `pdf`, `jpg`, `png`). - **Karza Mappings**: - `KARZA_ELECTRICTY_PROVIDER`: Dictionary mapping full electricity board names to Karza's shortcodes (e.g., `TATA_DL`). - `KARZA_UP_DISTRICT`: Hardcoded list of Uttar Pradesh districts. ### 4. Database Setup - Extracts the primary MySQL connection parameters (`HOST`, `NAME`, `USER`, `PASSWORD`) used by the core app container.