Skip to content

Commit de671af

Browse files
authored
Merge pull request #140 from ChannelFinder/allow-pass-cf-client-var-config
Allow passing cf client config
2 parents 30d0d28 + 2d7b7e9 commit de671af

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

server/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ classifiers = [
2424
"Programming Language :: Python :: 3.14",
2525
]
2626
dependencies = [
27-
"channelfinder @ https://github.com/ChannelFinder/pyCFClient/archive/refs/tags/v3.0.0.zip",
27+
"channelfinder @ https://github.com/ChannelFinder/pyCFClient/archive/refs/tags/v3.2.0.zip",
2828
"dataclasses; python_version<'3.7'",
2929
"requests",
3030
"twisted",

server/recceiver/cfstore.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ class CFConfig:
5454
recceiver_id: str = RECCEIVERID_DEFAULT
5555
timezone: Optional[str] = None
5656
cf_query_limit: int = DEFAULT_QUERY_LIMIT
57+
base_url: Optional[str] = None
58+
cf_username: Optional[str] = None
59+
cf_password: Optional[str] = None
60+
verify_ssl: Optional[bool] = None
5761

5862
@classmethod
5963
def loads(cls, conf: ConfigAdapter) -> "CFConfig":
@@ -75,6 +79,10 @@ def loads(cls, conf: ConfigAdapter) -> "CFConfig":
7579
recceiver_id=conf.get("recceiverId", RECCEIVERID_DEFAULT),
7680
timezone=conf.get("timezone", ""),
7781
cf_query_limit=conf.get("findSizeLimit", DEFAULT_QUERY_LIMIT),
82+
base_url=conf.get("baseUrl"),
83+
cf_username=conf.get("cfUsername"),
84+
cf_password=conf.get("cfPassword"),
85+
verify_ssl=conf.get("verifySSL"),
7886
)
7987

8088

@@ -286,7 +294,12 @@ def _start_service_with_lock(self):
286294
_log.info("CF_START with configuration: %s", self.cf_config)
287295

288296
if self.client is None: # For setting up mock test client
289-
self.client = ChannelFinderClient()
297+
self.client = ChannelFinderClient(
298+
BaseURL=self.cf_config.base_url,
299+
username=self.cf_config.cf_username,
300+
password=self.cf_config.cf_password,
301+
verify_ssl=self.cf_config.verify_ssl,
302+
)
290303
try:
291304
cf_properties = {cf_property["name"] for cf_property in self.client.getAllProperties()}
292305
required_properties = {

0 commit comments

Comments
 (0)