rspec/rules/S5659/python/rule.adoc

39 lines
846 B
Plaintext
Raw Normal View History

2021-01-26 04:07:35 +00:00
include::../description.adoc[]
== Noncompliant Code Example
2021-01-26 04:07:35 +00:00
For https://github.com/jpadilla/pyjwt[pyjwt] module:
2021-01-26 04:07:35 +00:00
----
jwt.decode(token, verify = False) # Noncompliant
jwt.decode(token, key, options={"verify_signature": False}) # Noncompliant
2021-01-26 04:07:35 +00:00
----
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:
2021-01-26 04:07:35 +00:00
----
jwt.decode(token, key, algo)
2021-01-26 04:07:35 +00:00
----
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)
2021-01-26 04:07:35 +00:00
----
include::../see.adoc[]
ifdef::env-github,rspecator-view[]
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]