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

   **Description**
   
   This change refactors OAuth token handling in `SnowflakeHook` by extracting 
token lifecycle responsibilities into a dedicated `_SnowflakeOAuthManager` 
helper.
   
   OAuth-specific functionality previously implemented directly in 
`SnowflakeHook`, including grant type validation, token retrieval, token 
caching, and token expiration tracking, has been moved into the new helper 
class. `SnowflakeHook` continues to expose the existing `get_oauth_token()` 
interface, but now delegates OAuth token management to the helper.
   
   **Rationale**
   
   `SnowflakeHook` previously mixed connection management responsibilities with 
OAuth-specific concerns. Extracting OAuth token lifecycle management into 
`_SnowflakeOAuthManager` establishes a clearer separation of concerns and 
provides a dedicated owner for token acquisition, refresh, validation, and 
cache management.
   
   This reduces the amount of authentication-specific state maintained by 
`SnowflakeHook`, simplifies the hook implementation, and makes OAuth 
functionality easier to reason about and maintain independently.
   
   **Tests**
   
   * Updated OAuth-related tests to reflect the new ownership boundaries where 
appropriate.
   
   **Notes**
   
   * Updated the `_get_static_conn_params()` docstring to reflect the new 
ownership boundaries introduced by `_SnowflakeOAuthManager`.
   
   **Backwards Compatibility**
   
   This change is a refactor only and does not modify public APIs or runtime 
behavior. `SnowflakeHook` continues to expose the existing `get_oauth_token()` 
interface, and existing authentication flows remain unchanged.


-- 
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