fix: expose ca_cert_file_path and insecure_skip_verify in init_from_api_key - #1438
Open
cosmicBboy wants to merge 1 commit into
Open
fix: expose ca_cert_file_path and insecure_skip_verify in init_from_api_key#1438cosmicBboy wants to merge 1 commit into
cosmicBboy wants to merge 1 commit into
Conversation
…pi_key Users behind TLS-intercepting corporate proxies hit `SSL: CERTIFICATE_VERIFY_FAILED` on the OAuth token refresh when authenticating with `flyte.init_from_api_key()`, because the function hardcoded `insecure_skip_verify=False` and offered no way to supply a custom CA bundle. `flyte.init()` already supports both options, so thread them through from `init_from_api_key` as well. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Users behind corporate TLS-intercepting proxies (MITM proxies that re-sign traffic with a private corporate CA) get:
when authenticating via
flyte.init_from_api_key()and then making any remote call (the failure surfaces on the OAuth token refresh POST).flyte.init()already supportsinsecure_skip_verifyandca_cert_file_path, butinit_from_api_keyhardcodedinsecure_skip_verify=Falseand exposed neither parameter — so API-key users had no way to supply a corporate CA bundle.Fix
Add
insecure_skip_verify: bool = Falseandca_cert_file_path: str | None = Nonetoinit_from_api_keyand forward them to the underlyinginit.aio(...)call (insecureremains hardcoded toFalse). Defaults are unchanged, so existing behavior is preserved.The docstring notes that if both options are set,
insecure_skip_verifytakes precedence (matching the behavior of_resolve_tls_ca_certandget_async_authenticator, which checkinsecure_skip_verifyfirst).Tests
tests/flyte/test_init_from_api_key.py: new tests asserting the TLS defaults (insecure_skip_verify=False,ca_cert_file_path=None) and that explicitly passed values are forwarded toinit.aio, withinsecurestillFalse.tests/user_api/test_init_api_key.py: async (.aio) equivalents of the same assertions.tests/flyte/test_init_from_api_key.py,tests/user_api/test_init_api_key.py, andtests/cli/test_api_key_with_config.py: 20 passed.ruff check/ruff format, mypy, and ty all pass.🤖 Generated with Claude Code