Title: OIDC auth builds a new JWKS client per request, adding a network fetch to every authenticated call · Issue #6682 · feast-dev/feast · GitHub
Open Graph Title: OIDC auth builds a new JWKS client per request, adding a network fetch to every authenticated call · Issue #6682 · feast-dev/feast
X Title: OIDC auth builds a new JWKS client per request, adding a network fetch to every authenticated call · Issue #6682 · feast-dev/feast
Description: The observation OidcTokenParser._decode_token constructs a fresh PyJWKClient on every call (sdk/python/feast/permissions/auth/oidc_token_parser.py): def _decode_token(self, access_token: str) -> dict: ... jwks_client = PyJWKClient( self....
Open Graph Description: The observation OidcTokenParser._decode_token constructs a fresh PyJWKClient on every call (sdk/python/feast/permissions/auth/oidc_token_parser.py): def _decode_token(self, access_token: str) -> di...
X Description: The observation OidcTokenParser._decode_token constructs a fresh PyJWKClient on every call (sdk/python/feast/permissions/auth/oidc_token_parser.py): def _decode_token(self, access_token: str) ->...
Opengraph URL: https://github.com/feast-dev/feast/issues/6682
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"OIDC auth builds a new JWKS client per request, adding a network fetch to every authenticated call","articleBody":"## The observation\n\n`OidcTokenParser._decode_token` constructs a fresh `PyJWKClient` on every call (`sdk/python/feast/permissions/auth/oidc_token_parser.py`):\n\n```python\ndef _decode_token(self, access_token: str) -> dict:\n ...\n jwks_client = PyJWKClient(\n self.oidc_discovery_service.get_jwks_url(), headers=..., ssl_context=ssl_ctx,\n )\n signing_key = jwks_client.get_signing_key_from_jwt(access_token)\n```\n\n`PyJWKClient` caches the fetched JWK set, but the cache lives on the instance, so a per-request instance starts cold every time and `get_signing_key_from_jwt` performs a full HTTPS round trip to the IdP's JWKS endpoint, TLS handshake included, on every authenticated request.\n\nReproduced on master with a mock JWKS endpoint and a hit counter: 25 authenticated decodes produce 25 JWKS fetches.\n\n## Measured impact\n\nOn a production-shaped deployment (containerized feature server, Entra ID OIDC, Redis online store):\n\n- The JWKS fetch alone measures 124-196 ms against `login.microsoftonline.com`.\n- Server-side latency for single-entity online reads sat at p50 247 ms / p95 314 ms while the Redis engine idled at 0.5% CPU; the unauthenticated `/health` floor on the same connection was ~50 ms. Nearly the entire request budget goes to re-fetching a document that hasn't changed.\n- Because the fetch is blocking I/O in the request path, concurrent requests serialize behind it: 3 parallel readers measured p50 900 ms (an exact 3x of single-request latency), and 10 parallel readers produced 502s from a perfectly healthy process. A deployment could easily misdiagnose this as \"the feature server cannot handle load\" when it is one cold cache constructor.\n\nBoth the latency inflation and the concurrency collapse are the same defect.\n\n## Fix\n\nBuild the `PyJWKClient` lazily once per parser. The parser is constructed once per process (`init_auth_manager`), so PyJWT's built-in JWK-set cache (default `cache_jwk_set=True`, `lifespan=300`) then does its job. Key rotation stays safe: `PyJWKClient.get_signing_key` refreshes the set and retries once whenever it sees an unknown `kid` (verified in PyJWT 2.13, the currently resolved version - feast pins no upper bound).\n\nAfter the change the same 25-decode benchmark performs exactly 1 JWKS fetch. To be precise about the concurrency half: this removes the accidental serialization behind per-request network I/O; it does not add parallelism to the server.\n\nPR to follow shortly.\n","author":{"url":"https://github.com/larrysingleton007","@type":"Person","name":"larrysingleton007"},"datePublished":"2026-07-31T14:17:01Z","url":"https://github.com/feast-dev/feast/issues/6682"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:54ec1369-1a8b-819b-d8c5-601fa0e59ede |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D6E2:16B4F1:2AC7AC:3AFBE5:6AFE9818 |
| html-safe-nonce | ab75d3c0b75c69e9a140230b7019cb068f9a4795da14a075f8217bc416419718 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENkUyOjE2QjRGMToyQUM3QUM6M0FGQkU1OjZBRkU5ODE4IiwidmlzaXRvcl9pZCI6IjE2ODE0MTI4NTEzMDgwNzUwMzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | cd85e19beb7c06c2fcbbb1e57f32aaf0091f15ca6b098e675a44b5db77ee2ffc |
| hovercard-subject-tag | issue:5030408018 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feast-dev/feast/6682/issue_layout |
| twitter:image | https://opengraph.githubassets.com/30ebe39f0dc4ed493bfb47a5c63245774d60e2eb9d4070ca60020b7c713263d3/feast-dev/feast/issues/6682 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/30ebe39f0dc4ed493bfb47a5c63245774d60e2eb9d4070ca60020b7c713263d3/feast-dev/feast/issues/6682 |
| og:image:alt | The observation OidcTokenParser._decode_token constructs a fresh PyJWKClient on every call (sdk/python/feast/permissions/auth/oidc_token_parser.py): def _decode_token(self, access_token: str) -> di... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | larrysingleton007 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| go-import | github.com/feast-dev/feast git https://github.com/feast-dev/feast.git |
| octolytics-dimension-user_id | 57027613 |
| octolytics-dimension-user_login | feast-dev |
| octolytics-dimension-repository_id | 161133770 |
| octolytics-dimension-repository_nwo | feast-dev/feast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161133770 |
| octolytics-dimension-repository_network_root_nwo | feast-dev/feast |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width