|
3 | 3 | # Encoding
|
4 | 4 |
|
5 | 5 | # good - key and algorithm supplied
|
6 |
| -jwt.encode({"foo": "bar"}, "key", "HS256") |
7 |
| -jwt.encode({"foo": "bar"}, key="key", algorithm="HS256") |
| 6 | +jwt.encode(token, "key", "HS256") |
| 7 | +jwt.encode(token, key="key", algorithm="HS256") |
8 | 8 |
|
9 | 9 | # bad - both key and algorithm set to None
|
10 |
| -jwt.encode({"foo": "bar"}, None, None) |
| 10 | +jwt.encode(token, None, None) |
11 | 11 |
|
12 | 12 | # bad - empty key
|
13 |
| -jwt.encode({"foo": "bar"}, "", algorithm="HS256") |
14 |
| -jwt.encode({"foo": "bar"}, key="", algorithm="HS256") |
| 13 | +jwt.encode(token, "", algorithm="HS256") |
| 14 | +jwt.encode(token, key="", algorithm="HS256") |
15 | 15 |
|
16 | 16 | # Decoding
|
17 | 17 |
|
|
25 | 25 | # good - verified decoding
|
26 | 26 | jwt.decode(token, verify=True)
|
27 | 27 | jwt.decode(token, key, options={"verify_signature": True})
|
| 28 | + |
| 29 | + |
| 30 | +def indeterminate(verify): |
| 31 | + jwt.decode(token, key, verify) |
0 commit comments