Title: What is _validate_token meant to verify in the OIDC token parser? · Issue #6688 · feast-dev/feast · GitHub
Open Graph Title: What is _validate_token meant to verify in the OIDC token parser? · Issue #6688 · feast-dev/feast
X Title: What is _validate_token meant to verify in the OIDC token parser? · Issue #6688 · feast-dev/feast
Description: Question What is OidcTokenParser._validate_token intended to verify? As written it cannot reject any token, but it reads like a security gate and logs as though one passed, so I would rather ask than assume it is dead code. What it does ...
Open Graph Description: Question What is OidcTokenParser._validate_token intended to verify? As written it cannot reject any token, but it reads like a security gate and logs as though one passed, so I would rather ask th...
X Description: Question What is OidcTokenParser._validate_token intended to verify? As written it cannot reject any token, but it reads like a security gate and logs as though one passed, so I would rather ask th...
Opengraph URL: https://github.com/feast-dev/feast/issues/6688
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"What is _validate_token meant to verify in the OIDC token parser?","articleBody":"## Question\n\nWhat is `OidcTokenParser._validate_token` intended to verify? As written it cannot reject any token, but it reads like a security gate and logs as though one passed, so I would rather ask than assume it is dead code.\n\n## What it does today\n\n[`_validate_token`](https://github.com/feast-dev/feast/blob/3a6a1031ac501c715b6d7aaf6d6aa3cee25c5367/sdk/python/feast/permissions/auth/oidc_token_parser.py#L45-L60) builds a mock request, sets `Authorization: Bearer \u003ctoken>` on it from the token it was handed, and awaits `OAuth2AuthorizationCodeBearer`. That scheme only parses the header and returns the token; it never inspects the value. Since the method supplies the header itself, the check always succeeds.\n\nVerified against the installed fastapi (0.139.2) — every one of these is accepted, including the empty string:\n\n```\n'' -> ACCEPTED ''\n' ' -> ACCEPTED ''\n'garbage' -> ACCEPTED 'garbage'\n'a.b.c' -> ACCEPTED 'a.b.c'\n```\n\nThe caller then logs success:\n\n```python\nawait self._validate_token(access_token)\nlogger.debug(\"Token successfully validated.\")\n```\n\nReal verification happens afterwards in `_decode_token`, which fetches the JWKS signing key and calls `jwt.decode`. So the token is genuinely validated, just not here. My concern is that the method name, the docstring (\"Validate the token ... against the OAuth2 server\"), and that log line together suggest a verification step that does not exist, which is the kind of thing that misleads a future reader auditing the auth path.\n\n## The one thing it does affect\n\nConstructing the scheme reads `token_endpoint` and `authorization_endpoint` from the discovery document, so a discovery document **missing** `token_endpoint` raises a `ValidationError` and the request fails (an empty string passes). That is the only input that can make this method fail.\n\nWorth noting the server-side validation path itself never needs a token endpoint — it only needs `jwks_uri`. So this effectively requires a discovery field that Feast's own token validation does not use. It also does not trigger anything that would otherwise be skipped: `_decode_token` reaches the same lazily-fetched discovery data via `get_jwks_url()`.\n\n## Why I am asking rather than sending a patch\n\nRemoving the call would be a behavior change for anyone whose provider omits `token_endpoint` (they would go from failing to working), and it is the only `await` on this branch of the OIDC path, which matters if the blocking JWKS work is ever moved to a thread. Both seem like your call rather than mine.\n\nRoughly the options I see:\n\n1. It is vestigial, and the call plus the misleading log line can go.\n2. The discovery-document shape check is wanted, in which case it would be clearer done once at parser construction rather than per request, and against the fields actually required.\n3. It was meant to do something else entirely (introspection against the provider?) and never did, in which case that is the real issue.\n\nHappy to send a PR for whichever you prefer. Not urgent, and the per-request cost is small; this is about the auth path saying it does something it does not.\n","author":{"url":"https://github.com/larrysingleton007","@type":"Person","name":"larrysingleton007"},"datePublished":"2026-07-31T19:10:28Z","url":"https://github.com/feast-dev/feast/issues/6688"}
| 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:95d5ce3d-bab9-1daf-0154-0ab8e840a9f4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C44:2D9CF4:115F789:16F65BC:6AFEA265 |
| html-safe-nonce | 42d4746f3f13e4cfb01d1c8edac79eaa0ad34535f0735a5cce96edfd7e880cef |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzQ0OjJEOUNGNDoxMTVGNzg5OjE2RjY1QkM6NkFGRUEyNjUiLCJ2aXNpdG9yX2lkIjoiNDc5MjcxMDYwMjQ2MTk3OTIzOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c213f98f8624693a1737c8cb33ea303e040e82aefa1f7cef54d7a217b6d841c3 |
| hovercard-subject-tag | issue:5032620729 |
| 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/6688/issue_layout |
| twitter:image | https://opengraph.githubassets.com/76f3216e8d6a4f60e95a18f7cd371681b0e0f0cbf52ec2f3499cd0f4ce755948/feast-dev/feast/issues/6688 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/76f3216e8d6a4f60e95a18f7cd371681b0e0f0cbf52ec2f3499cd0f4ce755948/feast-dev/feast/issues/6688 |
| og:image:alt | Question What is OidcTokenParser._validate_token intended to verify? As written it cannot reject any token, but it reads like a security gate and logs as though one passed, so I would rather ask th... |
| 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 | 95b2753c978240785d6cca00783c00a371b2d7d9879bb32e305170a1b19bd28e |
| 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 | 3f25273206cd841171bca0002261ae4c9757d934 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width