Conversation
…table recognition verdict, add play_integrity_e2e.py
| # Google Play Integrity | ||
| class PlayIntegrityRequest(BaseModel): | ||
| integrity_token: str | ||
| user_id: str |
There was a problem hiding this comment.
this allows empty value, but if it is empty, lower on https://github.com/Firefox-AI/MLPA/pull/79/changes#diff-b6cf33ca99c89749f7b57bcb0e80bf6fdc324b9f25577c2cb7af154baa0a62d9R37 may bypass the validation
There was a problem hiding this comment.
What do you mean? play_user_id is only non null if extract_user_from_play_integrity_jwt succeeds
There was a problem hiding this comment.
@noahpodgurski so I was wondering if it's possible for play_user_id to be empty, 'cause if not, and it can't be invalid after extract_user_from_play_integrity_jwt succeeds, then maybe we don't need if play_user_id: on line 37 of authorize.py
There was a problem hiding this comment.
@noahpodgurski went over this with more analysis, think it's fine for now to handle the "" user_id situation:
extract_user_from_play_integrity_jwt has two outcomes:
1. Returns payload["sub"] (a string)
2. Raises HTTPException(401)
It never returns None or empty string silently. If sub is missing, jwtoxide rejects it (it's in
required_spec_claims). If decoding fails for any reason, the except block raises 401.
The only way play_user_id could be empty string is the scenario from before -- someone issues a JWT with sub: ""
-- which would require them to know MLPA_ACCESS_TOKEN_SECRET. At that point you have bigger problems.
What's new