import os from typing import Optional from defence360agent.application.determine_hosting_panel import GP_FILE class BaseConfig: @classmethod def exists(cls): return os.path.exists(cls._conf_path) @classmethod def to_dict(cls): from configparser import ConfigParser integration_conf = ConfigParser() integration_conf.read(cls._conf_path) return integration_conf @classmethod def get(cls, section: str, option: str) -> Optional[str]: """ Return *option* value in *section* in config if exist, None otherwise. """ try: return cls.to_dict()[section][option] except KeyError: return None class IntegrationConfig(BaseConfig): _conf_path = GP_FILE class ClIntegrationConfig(BaseConfig): _conf_path = "/opt/cpvendor/etc/integration.ini"
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__pycache__ | Folder | 0755 |
|
|
server | Folder | 0755 |
|
|
__init__.py | File | 0 B | 0644 |
|
health.py | File | 3.38 KB | 0644 |
|
inactivity.py | File | 1.49 KB | 0644 |
|
integration_conf.py | File | 884 B | 0644 |
|
jwt_issuer.py | File | 2.97 KB | 0644 |
|
newsfeed.py | File | 4.3 KB | 0644 |
|
pam_auth.py | File | 779 B | 0644 |
|