What is _validate_token meant to verify in the OIDC token parser?
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Refactoring
- Chiarezza
- Da chiarire
- Stato di attività
- Tranquilla
- Ambito
- authentication, backend, security
Direzione di ricerca
Inizia da sdk/python/feast/permissions/auth/oidc_token_parser.py, leggendo _validate_token, il suo chiamante e _decode_token; confronta il comportamento di parsing di OAuth2AuthorizationCodeBearer con i campi di discovery che carica. Decidi quale contratto debba esporre il percorso di auth e se l’attuale dipendenza dai campi di discovery sia intenzionale. Il lavoro è completato quando il comportamento scelto, i nomi dei metodi, il logging e il percorso di validazione sono coerenti e sono coperti i casi osservati di token vuoto o non valido e di token_endpoint mancante.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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 today
_validate_token builds a mock request, sets Authorization: Bearer <token> 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.
Verified against the installed fastapi (0.139.2) — every one of these is accepted, including the empty string:
'' -> ACCEPTED ''
' ' -> ACCEPTED ''
'garbage' -> ACCEPTED 'garbage'
'a.b.c' -> ACCEPTED 'a.b.c'
The caller then logs success:
await self._validate_token(access_token)
logger.debug("Token successfully validated.")
Real 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.
The one thing it does affect
Constructing 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.
Worth 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().
Why I am asking rather than sending a patch
Removing 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.
Roughly the options I see:
- It is vestigial, and the call plus the misleading log line can go.
- 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.
- It was meant to do something else entirely (introspection against the provider?) and never did, in which case that is the real issue.
Happy 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.
- Lingua principale
- Python
- Stelle
- 7.4k
- Fork
- 1.5k
- Merge medio
- 2g 6h
- PR unite (30g)
- 107
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di feast-dev/feast
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
BigQuery data quality monitoring fails: PRIMARY KEY placed outside the column list in monitoring table DDLForse già presa @liron-velocity l’ha presa 50 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
get_online_features silently drops a join key value when it shares a name with an OnDemandFeatureView's RequestSource fieldForse già presa @OHMFOHS l’ha presa 99 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
kind/bug priority/p2
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
feast-dev/feast#6778 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di feast-dev/feast
Issue simili
-
Public benchmark import end-to-end test fails when the test stack's worker runs the parity jobApertaaccepted
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
future-agi/future-agi#6392 ·
I maintainer di solito rispondono entro 1 giorno
-
memmapped_arange ignores the start value and drops the last point above the memmap thresholdForse già presa @prathameshfuke l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
StingraySoftware/HENDRICS#213 ·
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
bot-triaged module: decompositions module: edge cases module: int overflow module: primTorch oncall: pt2 triage review
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno