Repository navigation
Conversation
|
Thanks for the review, @VladaZakharova. Pushed: reserved names in the extras ( Looking at the supplier for your second point, I also found that its token cache key used the extra parameters' names but not their values, so two connections that differ only in |
e7c39da to
be55ad3
Compare
shahar1
left a comment
There was a problem hiding this comment.
The fix is right: the connection form saves idp_extra_parameters while main reads idp_extra_params, so the field never reached the IdP, and the new guards (reserved names, JSON-object check, mask_secret, value-aware cache key) each have tests. I checked that mask_secret on a dict masks only values under sensitive key names, and that the extras reach only the form payload of the POST to the IdP URL, not a client-library constructor, so the "connection extras must not be forwarded blindly" rule in providers/AGENTS.md is not engaged. One optional nit inline. VladaZakharova's three threads are answered and resolved; a re-review from her would clear the standing change request.
Smaller observations
- See inline comments on
providers/google/src/airflow/providers/google/cloud/utils/credentials_provider.py:402.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Airflow maintainer. The findings
below are observations, not blockers; an Apache Airflow
maintainer — a real person — will take the next look at the
PR. If you think a finding is mis-applied, please reply on
the PR and a maintainer will weigh in.More on how Apache Airflow handles maintainer review:
Contributing guide.
|
@VladaZakharova, your three threads are answered and resolved, and 12a9bbc adds the |
|
@bingqin2 Thanks for fixing, could you please resolve conflicts? |
Since apache#76161 the IdP extra request parameters of a Google Cloud connection reach the token request. Extras that would replace grant_type, client_id or client_secret, or collide with the supplier's oidc_issuer_url argument, now fail with a clear ValueError; the field must hold a JSON object; and values under sensitive key names are masked in task logs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
12a9bbc to
d1db7fe
Compare
|
@shahar1 Rebased onto current main. In the meantime, #76161 merged the core of the original fix: the field name, passing the extras to the supplier, and a value-aware cache key. I kept main's version of those, so this PR now only adds the guards on top: rejecting reserved names (including |
#76161 made the "IdP Extra Request Parameters" of a Google Cloud connection reach the identity provider's token request. Now that these user-supplied values are sent, this PR adds three guards:
grant_type,client_id,client_secretoroidc_issuer_urlwith a clearValueError, before the token supplier is built.grant_typeextra could replaceclient_credentials.TypeError: got multiple values for keyword argument.grant_typeitself, for code that builds it directly.audienceandscopestay allowed, since IdPs such as Auth0 and Entra ID require them.mask_secret, the same rule connection extras follow.TypeErrorwhen the value is unpacked.This PR originally also fixed the field name, the passing of the extras to the supplier and the cache key. #76161 fixed those in the meantime, so the rebase keeps main's version of them.
Changes
providers/google/src/airflow/providers/google/cloud/utils/external_token_supplier.py: addsRESERVED_TOKEN_REQUEST_FIELDSand checks it inClientCredentialsGrantFlowTokenSupplier.__init__.providers/google/src/airflow/providers/google/cloud/utils/credentials_provider.py: rejects reserved names andoidc_issuer_urlbefore building the supplier.providers/google/src/airflow/providers/google/common/hooks/base_google.py: requires a JSON object and callsmask_secreton the parsed dict.mask_secretcomes fromairflow.providers.common.compat.sdk, which exports it since common-compat 1.23.0, the provider's minimum.oidc_issuer_urlare rejected.grant_typeis rejected; the request payload keeps the supplier's own fields next to the extras.Testing
providers/google:tests/unit/google/cloud/utils/test_credentials_provider.py,tests/unit/google/cloud/utils/test_external_token_supplier.pyandtests/unit/google/common/hooks/test_base_google.pyon main 0e7068d.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Claude Fable 5.1, Claude Opus 5.5) following the guidelines. I reviewed and understand all changes; the tests were run locally as listed above.
🤖 Generated with Claude Code