Skip to content

Allow passing cf client config#140

Merged
jacomago merged 1 commit intomasterfrom
allow-pass-cf-client-var-config
Mar 25, 2026
Merged

Allow passing cf client config#140
jacomago merged 1 commit intomasterfrom
allow-pass-cf-client-var-config

Conversation

@jacomago
Copy link
Contributor

Can set the baseurl, username, password and verify_ssl via the config

Requires ChannelFinder/pyCFClient#40 to be merged

@jacomago jacomago self-assigned this Mar 20, 2026
Can set the baseurl, username, password and verify_ssl via the config
@jacomago jacomago force-pushed the allow-pass-cf-client-var-config branch from 6192f85 to 2d7b7e9 Compare March 24, 2026 09:35
@sonarqubecloud
Copy link

@tynanford
Copy link
Contributor

so after this is merged then recsync requires pyCFClient >= 3.2. Should we make the code default back to the old ChannelFinderClient signature if this fails? Something like this or a version check?

try:
    self.client = ChannelFinderClient(
        BaseURL=self.cf_config.base_url,
        username=self.cf_config.cf_username,
        password=self.cf_config.cf_password,
        verify_ssl=self.cf_config.verify_ssl,
    )
except TypeError:
    self.client = ChannelFinderClient(
        BaseURL=self.cf_config.base_url,
        username=self.cf_config.cf_username,
        password=self.cf_config.cf_password,
    )

@jacomago
Copy link
Contributor Author

so after this is merged then recsync requires pyCFClient >= 3.2. Should we make the code default back to the old ChannelFinderClient signature if this fails? Something like this or a version check?

try:
    self.client = ChannelFinderClient(
        BaseURL=self.cf_config.base_url,
        username=self.cf_config.cf_username,
        password=self.cf_config.cf_password,
        verify_ssl=self.cf_config.verify_ssl,
    )
except TypeError:
    self.client = ChannelFinderClient(
        BaseURL=self.cf_config.base_url,
        username=self.cf_config.cf_username,
        password=self.cf_config.cf_password,
    )

I think this works anyway. Since the defaults for all the parameters are None?

@jacomago jacomago merged commit de671af into master Mar 25, 2026
22 of 24 checks passed
@jacomago jacomago deleted the allow-pass-cf-client-var-config branch March 25, 2026 14:49
@tynanford
Copy link
Contributor

tynanford commented Mar 25, 2026

$ git checkout 2d601bba65b2cc6b22db695f5bc6a65fc665e171
HEAD is now at 2d601bb Merge pull request #35 from ChannelFinder/pre-commit-ruff
$ python3
Python 3.14.3 (main, Feb  4 2026, 00:00:00) [GCC 15.2.1 20260123 (Red Hat 15.2.1-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import channelfinder
>>> client = channelfinder.ChannelFinderClient(BaseURL="test", username="test", password="test")
>>> client = channelfinder.ChannelFinderClient(BaseURL="test", username="test", password="test", verify_ssl=False)
Traceback (most recent call last):
  File "<python-input-3>", line 1, in <module>
    client = channelfinder.ChannelFinderClient(BaseURL="test", username="test", password="test", verify_ssl=False)
TypeError: ChannelFinderClient.__init__() got an unexpected keyword argument 'verify_ssl'

edit: sorry should have use None

>>> client = channelfinder.ChannelFinderClient(BaseURL="test", username="test", password="test", verify_ssl=None)
Traceback (most recent call last):
  File "<python-input-1>", line 1, in <module>
    client = channelfinder.ChannelFinderClient(BaseURL="test", username="test", password="test", verify_ssl=None)
TypeError: ChannelFinderClient.__init__() got an unexpected keyword argument 'verify_ssl'

@jacomago
Copy link
Contributor Author

$ git checkout 2d601bba65b2cc6b22db695f5bc6a65fc665e171
HEAD is now at 2d601bb Merge pull request #35 from ChannelFinder/pre-commit-ruff
$ python3
Python 3.14.3 (main, Feb  4 2026, 00:00:00) [GCC 15.2.1 20260123 (Red Hat 15.2.1-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import channelfinder
>>> client = channelfinder.ChannelFinderClient(BaseURL="test", username="test", password="test")
>>> client = channelfinder.ChannelFinderClient(BaseURL="test", username="test", password="test", verify_ssl=False)
Traceback (most recent call last):
  File "<python-input-3>", line 1, in <module>
    client = channelfinder.ChannelFinderClient(BaseURL="test", username="test", password="test", verify_ssl=False)
TypeError: ChannelFinderClient.__init__() got an unexpected keyword argument 'verify_ssl'

edit: sorry should have use None

>>> client = channelfinder.ChannelFinderClient(BaseURL="test", username="test", password="test", verify_ssl=None)
Traceback (most recent call last):
  File "<python-input-1>", line 1, in <module>
    client = channelfinder.ChannelFinderClient(BaseURL="test", username="test", password="test", verify_ssl=None)
TypeError: ChannelFinderClient.__init__() got an unexpected keyword argument 'verify_ssl'

Oh, I was wrong.
Do we want to support older version of ChannelFinderClient though?

@jacomago
Copy link
Contributor Author

Oh, I was wrong. Do we want to support older version of ChannelFinderClient though?

Just seems a bit strange to put in a dependency and then not actually have it as a dependency.

@tynanford
Copy link
Contributor

It was more just a question. Anyone not using the pyproject.toml file to deploy will quickly realize what is up when it crashes after the update so that is fine too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants