-
Notifications
You must be signed in to change notification settings - Fork 203
Add optional ssl config flag #1802
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -73,6 +73,7 @@ def __init__( | |||||||||
| env: str = DEFAULT_ENV, | ||||||||||
| run_dbt_deps_if_needed: Optional[bool] = None, | ||||||||||
| project_name: Optional[str] = None, | ||||||||||
| use_system_ca_files: bool = True, | ||||||||||
| ): | ||||||||||
|
Comment on lines
+76
to
77
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restore Line 76 flips the default to - use_system_ca_files: bool = True,
+ use_system_ca_files: bool = False,📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| self.config_dir = config_dir | ||||||||||
| self.profiles_dir = profiles_dir | ||||||||||
|
|
@@ -204,6 +205,8 @@ def __init__( | |||||||||
| "disable_elementary_version_check", False | ||||||||||
| ) | ||||||||||
|
|
||||||||||
| self.use_system_ca_files = use_system_ca_files | ||||||||||
|
|
||||||||||
| def _load_configuration(self) -> dict: | ||||||||||
| if not os.path.exists(self.config_dir): | ||||||||||
| os.makedirs(self.config_dir) | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -73,6 +73,11 @@ def decorator(func): | |||||||||||||||||||||
| default=None, | ||||||||||||||||||||||
| help="The Slack token for your workspace.", | ||||||||||||||||||||||
| )(func) | ||||||||||||||||||||||
| func = click.option( | ||||||||||||||||||||||
| "--use-system-ca-files/--no-use-system-ca-files", | ||||||||||||||||||||||
| default=True, | ||||||||||||||||||||||
| help="Whether to use the system CA files for SSL connections or the ones provided by certify (see https://pypi.org/project/certifi).", | ||||||||||||||||||||||
| )(func) | ||||||||||||||||||||||
|
Comment on lines
+76
to
+80
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep the CLI flag default aligned with legacy behavior The new - func = click.option(
- "--use-system-ca-files/--no-use-system-ca-files",
- default=True,
+ func = click.option(
+ "--use-system-ca-files/--no-use-system-ca-files",
+ default=False,📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| if cmd in (Command.REPORT, Command.SEND_REPORT): | ||||||||||||||||||||||
| func = click.option( | ||||||||||||||||||||||
| "--exclude-elementary-models", | ||||||||||||||||||||||
|
|
@@ -304,6 +309,7 @@ def monitor( | |||||||||||||||||||||
| report_url, | ||||||||||||||||||||||
| filters, | ||||||||||||||||||||||
| teams_webhook, | ||||||||||||||||||||||
| use_system_ca_files, | ||||||||||||||||||||||
| ): | ||||||||||||||||||||||
| """ | ||||||||||||||||||||||
| Get alerts on failures in dbt jobs. | ||||||||||||||||||||||
|
|
@@ -335,6 +341,7 @@ def monitor( | |||||||||||||||||||||
| slack_group_alerts_by=group_by, | ||||||||||||||||||||||
| report_url=report_url, | ||||||||||||||||||||||
| teams_webhook=teams_webhook, | ||||||||||||||||||||||
| use_system_ca_files=use_system_ca_files, | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| anonymous_tracking = AnonymousCommandLineTracking(config) | ||||||||||||||||||||||
| anonymous_tracking.set_env("use_select", bool(select)) | ||||||||||||||||||||||
|
|
@@ -652,6 +659,7 @@ def send_report( | |||||||||||||||||||||
| disable, | ||||||||||||||||||||||
| include, | ||||||||||||||||||||||
| target_path, | ||||||||||||||||||||||
| use_system_ca_files, | ||||||||||||||||||||||
| ): | ||||||||||||||||||||||
| """ | ||||||||||||||||||||||
| Generate and send the report to an external platform. | ||||||||||||||||||||||
|
|
@@ -693,6 +701,7 @@ def send_report( | |||||||||||||||||||||
| report_url=report_url, | ||||||||||||||||||||||
| env=env, | ||||||||||||||||||||||
| project_name=project_name, | ||||||||||||||||||||||
| use_system_ca_files=use_system_ca_files, | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| anonymous_tracking = AnonymousCommandLineTracking(config) | ||||||||||||||||||||||
| anonymous_tracking.set_env("use_select", bool(select)) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create an explicit system CA
SSLContextWhen
use_system_ca_filesisTrue,ssl_contextis set toNone, which leaves the Slack SDK on its certifi-backed default. The flag never enables system trust roots. Instead, build a context withssl.create_default_context()for the system store, and keep the certifi override only when the flag isFalse.📝 Committable suggestion