SameerMesiah97 opened a new pull request, #62641:
URL: https://github.com/apache/airflow/pull/62641

   
   **Description**
   
   Fix incorrect handling of the `use_tls` connection extra in `VaultHook`. 
Previously, protocol selection used `bool(use_tls)`, causing string values like 
`"false"` to be treated as truthy and incorrectly select HTTPS. This could lead 
to SSL handshake failures when connections were provisioned with string-based 
extras.
   
   The fix preserves native boolean values and applies `to_boolean()` only when 
needed, ensuring correct handling of both boolean and string representations.
   
   **Rationale**
   
   The Vault connection documentation defines `use_tls` as an extra JSON 
parameter (please refer to [this 
link](https://airflow.apache.org/docs/apache-airflow-providers-hashicorp/stable/connections/vault.html).)
 Since connections may be provisioned via environment variables, Helm, 
Terraform, or other systems that serialize values as strings, the hook must 
defensively interpret string booleans. This change ensures consistent protocol 
resolution regardless of how the connection is configured.
   
   **Tests**
   
   Extended the existing `test_protocol_via_use_tls` parametrized test to 
include `"true"` and `"false"` string inputs.
   
   **Backwards Compatibility**
   
   No behavior changes for valid boolean inputs i.e `True` or `False`. The fix 
only corrects handling of string-based `use_tls` values.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to