(oct_key)
| 29 | |
| 30 | |
| 31 | def test_authenticate_token(oct_key): |
| 32 | validator = JWTBearerTokenValidator(oct_key, issuer="foo") |
| 33 | claims = { |
| 34 | "iss": "bar", |
| 35 | "exp": int(time.time() + 3600), |
| 36 | "client_id": "client-id", |
| 37 | "grant_type": "client_credentials", |
| 38 | } |
| 39 | token_string = jwt.encode({"alg": "HS256"}, claims, oct_key) |
| 40 | token = validator.authenticate_token(token_string) |
| 41 | assert token is None |
| 42 | |
| 43 | token_string = jwt.encode({"alg": "HS256"}, {**claims, "iss": "foo"}, oct_key) |
| 44 | token = validator.authenticate_token(token_string) |
| 45 | assert token is not None |
| 46 | |
| 47 | |
| 48 | def test_expired_token(oct_key): |
nothing calls this directly
no test coverage detected
searching dependent graphs…