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

   Extra request parameters for the external Identity Provider flow (OAuth2 
Client Credentials Grant) never reach the IdP, for two independent reasons:
   
   - the connection form saves the field as `idp_extra_parameters`, but 
`GoogleBaseHook` reads `idp_extra_params`, so a value entered in the UI is 
never parsed
   - even when parsed, `_CredentialProvider` stores `idp_extra_params_dict` and 
never passes it on, although `ClientCredentialsGrantFlowTokenSupplier` already 
accepts `**extra_params_kwargs` and sends them in the token request payload
   
   This reads the field under the name the form saves (keeping 
`idp_extra_params` as a fallback for extras written by hand) and forwards the 
parsed dict to the token supplier.
   
   **Changes**
   
   - 
`providers/google/src/airflow/providers/google/common/hooks/base_google.py`: 
read `idp_extra_parameters`, fall back to `idp_extra_params`
   - 
`providers/google/src/airflow/providers/google/cloud/utils/credentials_provider.py`:
 pass `idp_extra_params_dict` to `ClientCredentialsGrantFlowTokenSupplier`
   - tests: 
`test_get_credentials_using_identity_provider_passes_extra_params_to_token_supplier`
 (credentials provider, with and without extras) and 
`test_get_credentials_and_project_id_passes_idp_extra_params` / 
`test_get_credentials_and_project_id_rejects_invalid_idp_extra_params` (hook, 
both field names and the invalid-JSON path)
   
   **Testing**
   
   - `providers/google`: 
`tests/unit/google/cloud/utils/test_credentials_provider.py` and 
`tests/unit/google/common/hooks/test_base_google.py` (140 tests)
   - mypy on the changed modules, prek hooks on the changed files
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Code (Claude Fable 5.1) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions).
 I reviewed and understand all changes; the tests were run locally as listed 
above.
   
   ---
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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