rspec/rules/S5659/python/rule.adoc
2021-06-02 20:44:38 +02:00

39 lines
825 B
Plaintext

include::../description.adoc[]
== Noncompliant Code Examples
For https://github.com/jpadilla/pyjwt[pyjwt] module:
----
jwt.decode(token, verify = False) # Noncompliant
jwt.decode(token, key, options={"verify_signature": False}) # Noncompliant
----
For https://github.com/davedoesdev/python-jwt[python_jwt] module:
----
jwt.process_jwt(token) # Noncompliant
----
== Compliant Solution
For https://github.com/jpadilla/pyjwt[pyjwt] module:
----
jwt.decode(token, key, algo)
----
For https://github.com/davedoesdev/python-jwt[python_jwt] module:
----
jwt.process_jwt(token) # Compliant because followed by verify_jwt()
jwt.verify_jwt(token, key, algo)
----
include::../see.adoc[]
ifdef::rspecator-view[]
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::rspecator-view[]