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

   ## Summary
   
   OSSHook._get_client now reads `extra.endpoint` from the connection config, 
enabling VPC internal endpoints (e.g. `oss-cn-hangzhou-internal.aliyuncs.com`) 
instead of being limited to public endpoints.
   
   ## Motivation
   
   When Airflow pods run in the same VPC as Alibaba Cloud OSS, using the public 
endpoint incurs unnecessary public traffic. For clusters in the same region, 
the VPC internal endpoint (`oss-{region}-internal.aliyuncs.com`) provides lower 
latency and no egress charges.
   
   ## Changes
   
   - **oss.py**: `_get_client` now checks for `extra.endpoint` before falling 
back to the default public endpoint
   - **test_oss.py**: Added `test_get_client_default_endpoint` and 
`test_get_client_custom_endpoint`
   - **oss_mock.py**: Updated `mock_oss_hook_default_project_id` to accept 
optional `endpoint` parameter
   
   ## How to use
   
   Set `endpoint` in the `extra` field of the OSS connection:
   
   ```json
   {
     "auth_type": "AK",
     "access_key_id": "...",
     "access_key_secret": "...",
     "region": "cn-hangzhou",
     "endpoint": "oss-cn-hangzhou-internal.aliyuncs.com"
   }
   ```
   
   Co-Authored-By: Claude Sonnet 4.6 <[email protected]>


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