Validates that the 'jti' claim is valid. The "jti" (JWT ID) claim provides a unique identifier for the JWT. The identifier value MUST be assigned in a manner that ensures that there is a negligible probability that the same value will be accidentally assigned to a different data obj
(claims)
| 416 | |
| 417 | |
| 418 | def _validate_jti(claims): |
| 419 | """Validates that the 'jti' claim is valid. |
| 420 | |
| 421 | The "jti" (JWT ID) claim provides a unique identifier for the JWT. |
| 422 | The identifier value MUST be assigned in a manner that ensures that |
| 423 | there is a negligible probability that the same value will be |
| 424 | accidentally assigned to a different data object; if the application |
| 425 | uses multiple issuers, collisions MUST be prevented among values |
| 426 | produced by different issuers as well. The "jti" claim can be used |
| 427 | to prevent the JWT from being replayed. The "jti" value is a case- |
| 428 | sensitive string. Use of this claim is OPTIONAL. |
| 429 | |
| 430 | Args: |
| 431 | claims (dict): The claims dictionary to validate. |
| 432 | """ |
| 433 | if "jti" not in claims: |
| 434 | return |
| 435 | |
| 436 | if not isinstance(claims["jti"], str): |
| 437 | raise JWTClaimsError("JWT ID must be a string.") |
| 438 | |
| 439 | |
| 440 | def _validate_at_hash(claims, access_token, algorithm): |
no test coverage detected
searching dependent graphs…