MCPcopy Create free account
hub / github.com/ParzivalHack/PySpector / TestJWT001

Class TestJWT001

tests/unit/test_missing_rules.py:203–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201# ============================================================
202
203class TestJWT001:
204 def test_verify_signature_false_fires(self):
205 code = 'payload = jwt.decode(token, options={"verify_signature": False})'
206 assert fires(code, "JWT001"), "JWT001 must fire: verify_signature=False"
207
208 def test_algorithms_none_fires(self):
209 code = "payload = jwt.decode(token, algorithms=['none'])"
210 assert fires(code, "JWT001"), "JWT001 must fire: algorithms=['none']"
211
212 def test_valid_decode_safe(self):
213 code = "payload = jwt.decode(token, secret, algorithms=['HS256'])"
214 assert not_fires(code, "JWT001"), "JWT001 must NOT fire for valid HS256 decode"
215
216
217# ============================================================

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected