{"overview":"# Config Service Overview\n\nThe `config` service within the Vivified platform provides a robust solution for managing configuration data with an emphasis on security and compliance. This service supports hierarchical configuration management, encryption for sensitive data, and comprehensive audit logging, making it suitable for HIPAA-compliant environments.\n\n!!! note\n This service is designed to ensure data integrity and confidentiality, crucial for environments that require strict compliance with regulations such as HIPAA.\n\n## Architecture\n\n```mermaid\ngraph LR\n A[Client] -- Request --> B[Config Service]\n B -- Fetch/Store --> C[(Database)]\n B -- Encrypt/Decrypt --> D[Encryption Module]\n```\n\n## Key Components\n\n- **Configuration Management**: Store and retrieve configuration settings.\n- **Encryption**: Encrypt/decrypt sensitive configuration values using Fernet symmetric encryption.\n- **Audit Logging**: Log configuration changes for auditing and compliance purposes.","api":"# Config Service API Reference\n\nThe Config Service API provides endpoints for managing configuration settings. Below are the available operations:\n\n!!! tip\n Use the API to programmatically manage configuration settings, ensuring automated processes can integrate with the config service.\n\n## Endpoints\n\nCurrently, there is no direct API documentation provided. Integration with this service occurs through the `ConfigService` class in the Python code.\n\n=== \"Python\"\n ```python\n from config_service import ConfigService\n \n service = ConfigService(db_session=my_session, encryption_key=my_key)\n ```\n\n=== \"curl\"\n ```bash\n # No direct HTTP API available, use Python client\n ```\n\nFor more detailed usage, refer to the `service.py` file and its class methods.","config":"# Configuration Guide\n\nThe configuration system supports various options and settings. Below is a data table listing the configuration options:\n\n| Option | Description | Type | Required | Default |\n|---------------|-------------------------------------------|----------|----------|------------|\n| `encryption_key` | Key for encrypting sensitive information | `string` | Yes | N/A |\n| `db_session` | Database session for persistence | `object` | Yes | N/A |\n\n!!! warning\n Ensure the `encryption_key` is securely stored and managed. Loss of the key will make it impossible to decrypt sensitive configuration data.\n\n## Security Considerations\n\n- **Encryption**: Sensitive data is encrypted using Fernet symmetric encryption. Ensure that the encryption key is rotated periodically and stored securely.\n- **Access Controls**: Limit access to configuration management to authorized personnel only.\n- **Audit Logging**: Enable logging to track access and changes to configuration data.","examples":"# Usage Examples\n\nBelow are examples of using the Config Service to manage configuration settings.\n\n=== \"Python\"\n ```python\n from config_service import ConfigService\n from sqlalchemy.ext.asyncio import AsyncSession\n\n # Initialize service\n session = AsyncSession()\n service = ConfigService(db_session=session, encryption_key=\"my_secure_key\")\n\n # Set a configuration item\n service.set_config(\"api_key\", \"12345\", is_sensitive=True)\n\n # Get a configuration item\n api_key = service.get_config(\"api_key\")\n print(api_key)\n ```\n\n=== \"curl\"\n ```bash\n # No direct curl example available\n # Use the Python client to interact with the service\n ```\n\n## Troubleshooting\n\n### Common Issues\n\n- **Unable to Decrypt Data**: Ensure that the correct encryption key is being used. Verify that the environment variable `CONFIG_ENC_KEY` is set correctly if using environment-based keys.\n- **Database Connectivity**: Check database connection settings and ensure the database is reachable.\n\n!!! tip\n Always verify that the encryption key and database credentials are correctly configured to prevent runtime issues."}