The Python SDK now supports reading test configurations from environment variables, reducing the need for hardcoded values in the SDK test setup.
How It Works
Test configurations can now be set dynamically using environment variables. The variable names follow the pattern {SDK_Name}_{Client_Configuration_Name}
and may vary based on the API specification file. Examples include:
- PAYMENTS_API_ENVIRONMENT: Specifies the environment for the Payments API (e.g.,
sandbox
,production
). - PAYMENTS_API_PORT: Defines the port on which the Payments API runs.
- PAYMENTS_API_TOKEN: Defines the auth token for the Payments API.
Benefits
- Enhanced Security: Prevents exposure of sensitive configuration data in source code.
- Easier Test Configuration: No need to hardcode test settings.
- Flexible Environment Management: Quickly switch between different test environments.
- Seamless Integration: Works out of the box with CI/CD and local testing setups.
By leveraging environment variables, this update improves security while making test configuration more flexible and manageable.