
Improvement identified in #2790. Add a prefix to the diff-id when it is used multiple times in different "how to fix it in XYZ" sections to avoid ambiguity and pedantically follow the spec: > A single and unique diff-id should be used only once for each type of code example as shown in the description of a rule. Obvious typos around `diff-type` were fixed. An obvious extra use of diff blocks was removed.
36 lines
633 B
Plaintext
36 lines
633 B
Plaintext
== How to fix it in python-jwt
|
|
|
|
=== Code examples
|
|
|
|
include::../../common/fix/code-rationale-decode.adoc[]
|
|
|
|
==== Noncompliant code example
|
|
|
|
[source,python,diff-id=11,diff-type=noncompliant]
|
|
----
|
|
import python_jwt as jwt
|
|
|
|
jwt.process_jwt(token) # Noncompliant
|
|
----
|
|
|
|
==== Compliant solution
|
|
|
|
[source,python,diff-id=11,diff-type=compliant]
|
|
----
|
|
import python_jwt as jwt
|
|
|
|
jwt.process_jwt(token)
|
|
jwt.verify_jwt(token, key, ['HS256'])
|
|
----
|
|
|
|
=== How does this work?
|
|
|
|
include::../../common/fix/decode.adoc[]
|
|
|
|
=== Going the extra mile
|
|
|
|
include::../../common/extra-mile/key-storage.adoc[]
|
|
|
|
include::../../common/extra-mile/key-rotation.adoc[]
|
|
|