Download tests/test_jwtcheck.py from wuhp/bbscanner: direct link, hf CLI and curl.
- Browser
- Download file 353 Bytes
-
https://huggingface.co/spaces/wuhp/bbscanner/resolve/main/tests/test_jwtcheck.py
- Command line
-
hf download hf://spaces/wuhp/bbscanner/tests/test_jwtcheck.py
-
curl -L -o test_jwtcheck.py https://huggingface.co/spaces/wuhp/bbscanner/resolve/main/tests/test_jwtcheck.py
353 Bytes
| import json,base64 | |
| from app.jwtcheck import inspect_jwt | |
| def part(x): | |
| return base64.urlsafe_b64encode(json.dumps(x).encode()).decode().rstrip("=") | |
| def test_safe_inspection(): | |
| r=inspect_jwt(part({"alg":"none"})+"."+part({"sub":"secret"})+".x") | |
| assert r["signature_verified"] is False | |
| assert "secret" not in str(r) | |
| assert r["findings"] | |