Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create client from URL #71

Merged
merged 4 commits into from
Oct 10, 2019

Conversation

orsinium
Copy link
Contributor

@orsinium orsinium commented Oct 8, 2019

Allow passing url into create_client to fill in other params from it. It could be helpful for easier application configuration through env vars, for example. See dj-database-url for more info about the motivation.

Close #13

@orsinium
Copy link
Contributor Author

orsinium commented Oct 8, 2019

Ugh, 2.7, that's your last days.

@@ -20,13 +21,24 @@ def create_client(host=None, port=None, discovery_path=None, use_https=False,
:param int port: TAXII server port
:param str discovery_path: Discovery Service relative path
:param bool use_https: if HTTPS should be used
:param string url: URL to infer host, port, discovery_path, and use_https
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you're infering discovery path from it, maybe it's better to call it discovery_url instead of generic url?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Fixed 👍

@traut traut merged commit 20ee61c into eclecticiq:master Oct 10, 2019
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.

use url in create_client() factory function
2 participants