Repository navigation
Allow partial chain IdP CA in OIDC refresh - #2800
Conversation
|
could you make the change in the upstream openapi-generator? so we don't need to carry a patch in this repo? |
roycaihw
left a comment
There was a problem hiding this comment.
Only the IdP calls need this. _refresh_oidc already uses a requests session for the token refresh; can the discovery GET go through the same session with your adapter? Then we don't need the Configuration field or the generated-code patch, and nothing to upstream.
|
Minor / non-blocking nit Wrapping OAuth2Session(...) in a with block would close its connection pool after _refresh_oidc() returns (pre-existing code didn't close it either, so not a regression). |
|
thanks for the PR /lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chala2001, yliaog The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
a5f5a39
into
kubernetes-client:master
What type of PR is this?
/kind bug
What this PR does / why we need it:
When the OIDC IdP CA in the kubeconfig is a leaf or intermediate cert, kubectl accepts it but the Python client fails with "self-signed certificate in certificate chain". On Python 3.12 and older OpenSSL needs a self-signed root unless
VERIFY_X509_PARTIAL_CHAINis set. Python 3.13 sets it by default._refresh_oidcnow does the discovery GET with the same requests session as the token refresh, and mounts a small adapter that sets the flag when an IdP CA is given. Onlykube_config.pychanges, no generated code.Which issue(s) this PR fixes:
Fixes #2415
Special notes for your reviewer:
Tested end to end on 3.12 with a local IdP and a root, intermediate, leaf chain. Leaf or intermediate as the CA failed before and works now. An unrelated CA and a wrong hostname still fail. Also checked on 3.13.
With no IdP CA set, discovery still skips verification like before. The asyncio client is not changed here.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: