SameerMesiah97 opened a new pull request, #73815: URL: https://github.com/apache/airflow/pull/73815
**Description** This change adds key-pair authentication support to `SnowflakeCortexAgentHook`, alongside the existing OAuth authentication support. **Rationale** `SnowflakeCortexAgentHook` previously required an OAuth access token, preventing users with private-key-based Snowflake connections from calling Cortex Agent endpoints. Supporting key-pair authentication aligns the hook with the authentication methods already supported by Snowflake connections. **Tests** Added unit tests verifying that: - `test_get_auth_headers_uses_oauth` confirms OAuth authentication is used when an access token is available. - `test_get_auth_headers_uses_keypair_jwt` confirms key-pair credentials are used to generate a JWT. - `test_get_auth_headers_raises_when_credentials_missing` confirms an error is raised when neither authentication method is configured. - `test_get_auth_headers_raises_when_jwt_generation_fails` confirms an error is raised when JWT generation fails. **Backward Compatibility** This change is backward compatible. Existing OAuth connections continue to work as before, while key-pair authentication is available when no OAuth token is configured. ###### Was generative AI tooling used to co-author this PR? - [X] Yes (please specify the tool below) Generated-by: [GPT 5.6] following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- 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]
