🚨 Latest Research:Tanstack npm Packages Compromised in Ongoing Mini Shai-Hulud Supply-Chain Attack.Learn More
Socket
Book a DemoSign in
Socket

python-jwt

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

python-jwt - pypi Package Compare versions

Comparing version
3.3.2
to
3.3.3
bench/__pycache__/__init__.cpython-310.pyc

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

+66
-22

@@ -133,3 +133,3 @@ /*

ul.search li div.context {
ul.search li p.context {
color: #888;

@@ -512,3 +512,60 @@ margin: 2px 0 0 30px;

/* -- object description styles --------------------------------------------- */
.sig {
font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
}
.sig-name, code.descname {
background-color: transparent;
font-weight: bold;
}
.sig-name {
font-size: 1.1em;
}
code.descname {
font-size: 1.2em;
}
.sig-prename, code.descclassname {
background-color: transparent;
}
.optional {
font-size: 1.3em;
}
.sig-paren {
font-size: larger;
}
.sig-param.n {
font-style: italic;
}
/* C++ specific styling */
.sig-inline.c-texpr,
.sig-inline.cpp-texpr {
font-family: unset;
}
.sig.c .k, .sig.c .kt,
.sig.cpp .k, .sig.cpp .kt {
color: #0033B3;
}
.sig.c .m,
.sig.cpp .m {
color: #1750EB;
}
.sig.c .s, .sig.c .sc,
.sig.cpp .s, .sig.cpp .sc {
color: #067D17;
}
/* -- other body styles ----------------------------------------------------- */

@@ -639,10 +696,2 @@

.optional {
font-size: 1.3em;
}
.sig-paren {
font-size: larger;
}
.versionmodified {

@@ -688,4 +737,5 @@ font-style: italic;

font-style: normal;
margin: 0.5em;
margin: 0 0.5em;
content: ":";
display: inline-block;
}

@@ -777,4 +827,8 @@

span.linenos,
div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */
user-select: none;
div.highlight span.gp { /* gp: Generic.Prompt */
user-select: none;
-webkit-user-select: text; /* Safari fallback only */
-webkit-user-select: none; /* Chrome/Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+ */
}

@@ -794,12 +848,2 @@

code.descname {
background-color: transparent;
font-weight: bold;
font-size: 1.2em;
}
code.descclassname {
background-color: transparent;
}
code.xref, a code {

@@ -806,0 +850,0 @@ background-color: transparent;

@@ -304,2 +304,3 @@ /*

}
break;
case 39: // right

@@ -311,2 +312,3 @@ var nextHref = $('link[rel="next"]').prop('href');

}
break;
}

@@ -313,0 +315,0 @@ }

var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '3.3.2',
VERSION: '3.3.3',
LANGUAGE: 'None',

@@ -5,0 +5,0 @@ COLLAPSE_INDEX: false,

@@ -1,6 +0,6 @@

pre { line-height: 125%; margin: 0; }
td.linenos pre { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
span.linenos { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
td.linenos pre.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }

@@ -7,0 +7,0 @@ .highlight { background: #eeffcc; }

@@ -285,3 +285,6 @@ /*

if (data !== '' && data !== undefined) {
listItem.append(Search.makeSearchSummary(data, searchterms, hlterms));
var summary = Search.makeSearchSummary(data, searchterms, hlterms);
if (summary) {
listItem.append(summary);
}
}

@@ -329,3 +332,8 @@ Search.output.append(listItem);

for (var prefix in objects) {
for (var name in objects[prefix]) {
if (!(objects[prefix] instanceof Array)) {
objects[prefix] = Object.entries(objects[prefix]).map(([name, match]) => [...match, name]);
}
for (var iMatch = 0; iMatch != objects[prefix].length; ++iMatch) {
var match = objects[prefix][iMatch];
var name = match[4];
var fullname = (prefix ? prefix + '.' : '') + name;

@@ -344,3 +352,2 @@ var fullnameLower = fullname.toLowerCase()

}
var match = objects[prefix][name];
var objname = objnames[match[1]][2];

@@ -504,2 +511,5 @@ var title = titles[match[0]];

var text = Search.htmlToText(htmlText);
if (text == "") {
return null;
}
var textLower = text.toLowerCase();

@@ -516,3 +526,3 @@ var start = 0;

((start + 240 - text.length) ? '...' : '');
var rv = $('<div class="context"></div>').text(excerpt);
var rv = $('<p class="context"></p>').text(excerpt);
$.each(hlwords, function() {

@@ -519,0 +529,0 @@ rv = rv.highlightText(this, 'highlighted');

@@ -8,6 +8,6 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Index &#8212; python-jwt 3.3.2 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<title>Index &#8212; python-jwt 3.3.3 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/nature.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>

@@ -28,3 +28,3 @@ <script src="_static/underscore.js"></script>

>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">python-jwt 3.3.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="index.html">python-jwt 3.3.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Index</a></li>

@@ -107,3 +107,3 @@ </ul>

<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />

@@ -127,3 +127,3 @@ </form>

>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">python-jwt 3.3.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="index.html">python-jwt 3.3.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Index</a></li>

@@ -134,5 +134,5 @@ </ul>

&#169; Copyright 2015, David Halls.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.5.4.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
</div>
</body>
</html>

@@ -7,7 +7,8 @@

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>python_jwt module &#8212; python-jwt 3.3.2 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>python_jwt module &#8212; python-jwt 3.3.3 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/nature.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>

@@ -28,3 +29,3 @@ <script src="_static/underscore.js"></script>

>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="#">python-jwt 3.3.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="#">python-jwt 3.3.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">python_jwt module</a></li>

@@ -39,3 +40,3 @@ </ul>

<div class="section" id="python-jwt-module">
<section id="python-jwt-module">
<h1>python_jwt module<a class="headerlink" href="#python-jwt-module" title="Permalink to this headline">¶</a></h1>

@@ -48,3 +49,3 @@ <table class="longtable docutils align-default">

<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#python_jwt.generate_jwt" title="python_jwt.generate_jwt"><code class="xref py py-obj docutils literal notranslate"><span class="pre">python_jwt.generate_jwt</span></code></a>(claims[, priv_key, …])</p></td>
<tr class="row-odd"><td><p><a class="reference internal" href="#python_jwt.generate_jwt" title="python_jwt.generate_jwt"><code class="xref py py-obj docutils literal notranslate"><span class="pre">python_jwt.generate_jwt</span></code></a>(claims[, priv_key, ...])</p></td>
<td><p>Generate a JSON Web Token.</p></td>

@@ -55,3 +56,3 @@ </tr>

</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#python_jwt.verify_jwt" title="python_jwt.verify_jwt"><code class="xref py py-obj docutils literal notranslate"><span class="pre">python_jwt.verify_jwt</span></code></a>(jwt[, pub_key, …])</p></td>
<tr class="row-odd"><td><p><a class="reference internal" href="#python_jwt.verify_jwt" title="python_jwt.verify_jwt"><code class="xref py py-obj docutils literal notranslate"><span class="pre">python_jwt.verify_jwt</span></code></a>(jwt[, pub_key, ...])</p></td>
<td><p>Verify a JSON Web Token.</p></td>

@@ -63,4 +64,4 @@ </tr>

<dl class="py function">
<dt id="python_jwt.generate_jwt">
<code class="sig-prename descclassname"><span class="pre">python_jwt.</span></code><code class="sig-name descname"><span class="pre">generate_jwt</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">claims</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">priv_key</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">algorithm</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'PS512'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lifetime</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">expires</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">not_before</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">jti_size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">16</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">other_headers</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#python_jwt.generate_jwt" title="Permalink to this definition">¶</a></dt>
<dt class="sig sig-object py" id="python_jwt.generate_jwt">
<span class="sig-prename descclassname"><span class="pre">python_jwt.</span></span><span class="sig-name descname"><span class="pre">generate_jwt</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">claims</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">priv_key</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">algorithm</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'PS512'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lifetime</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">expires</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">not_before</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">jti_size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">16</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">other_headers</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#python_jwt.generate_jwt" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a JSON Web Token.</p>

@@ -101,4 +102,4 @@ <dl class="field-list simple">

<dl class="py function">
<dt id="python_jwt.process_jwt">
<code class="sig-prename descclassname"><span class="pre">python_jwt.</span></code><code class="sig-name descname"><span class="pre">process_jwt</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">jwt</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#python_jwt.process_jwt" title="Permalink to this definition">¶</a></dt>
<dt class="sig sig-object py" id="python_jwt.process_jwt">
<span class="sig-prename descclassname"><span class="pre">python_jwt.</span></span><span class="sig-name descname"><span class="pre">process_jwt</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">jwt</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#python_jwt.process_jwt" title="Permalink to this definition">¶</a></dt>
<dd><p>Process a JSON Web Token without verifying it.</p>

@@ -120,4 +121,4 @@ <p>Call this before <a class="reference internal" href="#python_jwt.verify_jwt" title="python_jwt.verify_jwt"><code class="xref py py-func docutils literal notranslate"><span class="pre">verify_jwt()</span></code></a> if you need access to the header or claims in the token before verifying it. For example, the claims might identify the issuer such that you can retrieve the appropriate public key.</p>

<dl class="py function">
<dt id="python_jwt.verify_jwt">
<code class="sig-prename descclassname"><span class="pre">python_jwt.</span></code><code class="sig-name descname"><span class="pre">verify_jwt</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">jwt</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">pub_key</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">allowed_algs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">iat_skew</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">datetime.timedelta(0)</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">checks_optional</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_not_implemented</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#python_jwt.verify_jwt" title="Permalink to this definition">¶</a></dt>
<dt class="sig sig-object py" id="python_jwt.verify_jwt">
<span class="sig-prename descclassname"><span class="pre">python_jwt.</span></span><span class="sig-name descname"><span class="pre">verify_jwt</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">jwt</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">pub_key</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">allowed_algs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">iat_skew</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">datetime.timedelta(0)</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">checks_optional</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_not_implemented</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#python_jwt.verify_jwt" title="Permalink to this definition">¶</a></dt>
<dd><p>Verify a JSON Web Token.</p>

@@ -130,3 +131,3 @@ <dl class="field-list simple">

<li><p><strong>allowed_algs</strong> (<em>list</em><em> or </em><em>NoneType</em><em> (</em><em>meaning an empty list</em><em>)</em>) – Algorithms expected to be used to sign the token. The <code class="docutils literal notranslate"><span class="pre">in</span></code> operator is used to test membership.</p></li>
<li><p><strong>iat_skew</strong> (<em>datetime.timedelta</em>) – The amount of leeway to allow between the issuer’s clock and the verifier’s clock when verifiying that the token was generated in the past. Defaults to no leeway.</p></li>
<li><p><strong>iat_skew</strong> (<em>datetime.timedelta</em>) – The amount of leeway to allow between the issuer’s clock and the verifier’s clock when verifying that the token was generated in the past. Defaults to no leeway.</p></li>
<li><p><strong>checks_optional</strong> (<em>bool</em>) – If <code class="docutils literal notranslate"><span class="pre">False</span></code>, then the token must contain the <strong>typ</strong> header property and the <strong>iat</strong>, <strong>nbf</strong> and <strong>exp</strong> claim properties.</p></li>

@@ -162,4 +163,4 @@ <li><p><strong>ignore_not_implemented</strong> (<em>bool</em>) – If <code class="docutils literal notranslate"><span class="pre">False</span></code>, then the token must <em>not</em> contain the <strong>jku</strong>, <strong>jwk</strong>, <strong>x5u</strong>, <strong>x5c</strong> or <strong>x5t</strong> header properties.</p></li>

</div>
<div class="section" id="indices-and-tables">
</section>
<section id="indices-and-tables">
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>

@@ -171,3 +172,3 @@ <ul class="simple">

</ul>
</div>
</section>

@@ -198,3 +199,3 @@

<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />

@@ -218,3 +219,3 @@ </form>

>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="#">python-jwt 3.3.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="#">python-jwt 3.3.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">python_jwt module</a></li>

@@ -225,5 +226,5 @@ </ul>

&#169; Copyright 2015, David Halls.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.5.4.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
</div>
</body>
</html>

@@ -8,6 +8,6 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Python Module Index &#8212; python-jwt 3.3.2 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<title>Python Module Index &#8212; python-jwt 3.3.3 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/nature.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>

@@ -35,3 +35,3 @@ <script src="_static/underscore.js"></script>

>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">python-jwt 3.3.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="index.html">python-jwt 3.3.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Python Module Index</a></li>

@@ -75,3 +75,3 @@ </ul>

<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />

@@ -95,3 +95,3 @@ </form>

>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">python-jwt 3.3.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="index.html">python-jwt 3.3.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Python Module Index</a></li>

@@ -102,5 +102,5 @@ </ul>

&#169; Copyright 2015, David Halls.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.5.4.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
</div>
</body>
</html>

@@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Search &#8212; python-jwt 3.3.2 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<title>Search &#8212; python-jwt 3.3.3 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/nature.css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>

@@ -34,3 +34,3 @@ <script src="_static/underscore.js"></script>

>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">python-jwt 3.3.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="index.html">python-jwt 3.3.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Search</a></li>

@@ -46,4 +46,5 @@ </ul>

<h1 id="search-documentation">Search</h1>
<div id="fallback" class="admonition warning">
<script>$('#fallback').hide();</script>
<noscript>
<div class="admonition warning">
<p>

@@ -54,2 +55,5 @@ Please activate JavaScript to enable the search

</div>
</noscript>
<p>

@@ -59,4 +63,6 @@ Searching for multiple words only shows matches that contain

</p>
<form action="" method="get">
<input type="text" name="q" aria-labelledby="search-documentation" value="" />
<input type="text" name="q" aria-labelledby="search-documentation" value="" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="search" />

@@ -66,5 +72,8 @@ <span id="search-progress" style="padding-left: 10px"></span>

<div id="search-results">
</div>

@@ -90,3 +99,3 @@ <div class="clearer"></div>

>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">python-jwt 3.3.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="index.html">python-jwt 3.3.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Search</a></li>

@@ -97,5 +106,5 @@ </ul>

&#169; Copyright 2015, David Halls.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.5.4.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
</div>
</body>
</html>

@@ -1,1 +0,1 @@

Search.setIndex({docnames:["index"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":2,sphinx:56},filenames:["index.rst"],objects:{"":{python_jwt:[0,0,0,"-"]},python_jwt:{generate_jwt:[0,1,1,""],process_jwt:[0,1,1,""],verify_jwt:[0,1,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:function"},terms:{"01t0":0,"128":0,"1970":0,"byte":0,"default":0,"function":0,"int":0,"long":0,"public":0,"return":0,For:0,Its:0,The:0,access:0,account:0,added:0,alg:0,algorithm:0,allow:0,allowed_alg:0,amount:0,ani:0,appropri:0,attack:0,befor:0,between:0,bit:0,bool:0,call:0,can:0,checks_opt:0,claim:0,clock:0,contain:0,correspond:0,cryptograph:0,current:0,date:0,datetim:0,detect:0,dict:0,either:0,empti:0,es256:0,es384:0,es512:0,exampl:0,exp:0,expect:0,expir:0,expiri:0,extra:0,fail:0,fals:0,follow:0,forc:0,from:0,futur:0,gener:0,generate_jwt:0,header:0,how:0,hs256:0,hs384:0,hs512:0,iat:0,iat_skew:0,identifi:0,ignore_not_impl:0,includ:0,index:0,intdat:0,isn:0,issuer:0,its:0,jku:0,json:0,jti:0,jti_siz:0,jwcrypto:0,jwk:0,jwt:0,kei:0,leewai:0,lifetim:0,list:0,mai:0,mean:0,membership:0,might:0,must:0,nbf:0,need:0,none:0,nonetyp:0,not_befor:0,note:0,number:0,omit:0,oper:0,other:0,other_head:0,page:0,paramet:0,pass:0,past:0,per:0,present:0,priv_kei:0,privat:0,process:0,process_jwt:0,properti:0,ps256:0,ps384:0,ps512:0,pub_kei:0,put:0,rais:0,replai:0,repres:0,retriev:0,rs256:0,rs384:0,rs512:0,search:0,second:0,sign:0,signatur:0,size:0,spec:0,specifi:0,str:0,successfulli:0,support:0,take:0,test:0,than:0,thei:0,thi:0,time:0,timedelta:0,token:0,tupl:0,typ:0,type:0,unction:[],unicod:0,uniqu:0,unless:0,use:0,used:0,using:0,utc:0,valid:0,valu:0,valueerror:0,verifi:0,verifii:0,verify_jwt:0,want:0,web:0,when:0,which:0,without:0,x5c:0,x5t:0,x5u:0,you:0},titles:["python_jwt module"],titleterms:{indic:0,modul:0,python_jwt:0,tabl:0}})
Search.setIndex({docnames:["index"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":4,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,sphinx:56},filenames:["index.rst"],objects:{"":[[0,0,0,"-","python_jwt"]],python_jwt:[[0,1,1,"","generate_jwt"],[0,1,1,"","process_jwt"],[0,1,1,"","verify_jwt"]]},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:function"},terms:{"0":0,"01":0,"01t0":0,"0z":0,"128":0,"16":0,"1970":0,"byte":0,"default":0,"function":0,"int":0,"long":0,"public":0,"return":0,A:0,For:0,If:0,Its:0,The:0,access:0,account:0,ad:0,alg:0,algorithm:0,allow:0,allowed_alg:0,amount:0,an:0,ani:0,appropri:0,ar:0,attack:0,befor:0,between:0,bit:0,bool:0,call:0,can:0,checks_opt:0,claim:0,clock:0,contain:0,correspond:0,cryptograph:0,current:0,date:0,datetim:0,detect:0,dict:0,either:0,empti:0,es256:0,es384:0,es512:0,exampl:0,exp:0,expect:0,expir:0,expiri:0,extra:0,fail:0,fals:0,follow:0,forc:0,from:0,futur:0,gener:0,generate_jwt:0,header:0,how:0,hs256:0,hs384:0,hs512:0,iat:0,iat_skew:0,id:0,identifi:0,ignore_not_impl:0,includ:0,index:0,intdat:0,isn:0,issuer:0,its:0,jku:0,json:0,jti:0,jti_siz:0,jwcrypto:0,jwk:0,jwt:0,kei:0,leewai:0,lifetim:0,list:0,mai:0,mean:0,membership:0,might:0,must:0,nbf:0,need:0,none:0,nonetyp:0,not_befor:0,note:0,number:0,omit:0,oper:0,other:0,other_head:0,page:0,paramet:0,pass:0,past:0,per:0,present:0,priv_kei:0,privat:0,process:0,process_jwt:0,properti:0,ps256:0,ps384:0,ps512:0,pub_kei:0,put:0,rais:0,replai:0,repres:0,retriev:0,rs256:0,rs384:0,rs512:0,s:0,search:0,second:0,sign:0,signatur:0,size:0,spec:0,specifi:0,str:0,successfulli:0,support:0,t:0,take:0,test:0,than:0,thei:0,thi:0,time:0,timedelta:0,token:0,tupl:0,typ:0,type:0,unicod:0,uniqu:0,unless:0,us:0,utc:0,valid:0,valu:0,valueerror:0,verifi:0,verifii:[],verify_jwt:0,wa:0,want:0,web:0,when:0,which:0,without:0,x5c:0,x5t:0,x5u:0,you:0},titles:["python_jwt module"],titleterms:{indic:0,modul:0,python_jwt:0,tabl:0}})

@@ -55,3 +55,3 @@ # -*- coding: utf-8 -*-

# The full version, including alpha/beta/rc tags.
release = '3.3.2'
release = '3.3.3'

@@ -58,0 +58,0 @@ # The language for content autogenerated by Sphinx. Refer to documentation

+118
-115
Metadata-Version: 2.1
Name: python_jwt
Version: 3.3.2
Version: 3.3.3
Summary: Module for generating and verifying JSON Web Tokens

@@ -9,116 +9,2 @@ Home-page: https://github.com/davedoesdev/python-jwt

License: MIT
Description: # python-jwt&nbsp;&nbsp;&nbsp;[![Build Status](https://github.com/davedoesdev/python-jwt/actions/workflows/ci.yml/badge.svg)](https://github.com/davedoesdev/python-jwt/actions/workflows/ci.yml) [![Coverage Status](https://coveralls.io/repos/github/davedoesdev/python-jwt/badge.svg?branch=master)](https://coveralls.io/github/davedoesdev/python-jwt?branch=master) [![PyPI version](https://badge.fury.io/py/python-jwt.svg)](https://badge.fury.io/py/python-jwt)
Module for generating and verifying [JSON Web Tokens](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html).
- **Note:** From version 2.0.1 the namespace has changed from `jwt` to `python_jwt`, in order to avoid conflict with [PyJWT](https://github.com/jpadilla/pyjwt).
- **Note:** Versions 1.0.0 and later fix [a vulnerability](https://www.timmclean.net/2015/02/25/jwt-alg-none.html) in JSON Web Token verification so please upgrade if you're using this functionality. The API has changed so you will need to update your application. [verify_jwt](http://rawgit.davedoesdev.com/davedoesdev/python-jwt/master/docs/_build/html/index.html#python_jwt.verify_jwt) now requires you to specify which signature algorithms are allowed.
- Uses [jwcrypto](https://jwcrypto.readthedocs.io) to do the heavy lifting.
- Supports [__RS256__, __RS384__, __RS512__](https://tools.ietf.org/html/rfc7518#section-3.3), [__PS256__, __PS384__, __PS512__](https://tools.ietf.org/html/rfc7518#section-3.5), [__HS256__, __HS384__, __HS512__](https://tools.ietf.org/html/rfc7518#section-3.2), [__ES256__, __ES384__, __ES512__](https://tools.ietf.org/html/rfc7518#section-3.4), [__ES256K__](https://tools.ietf.org/html/draft-ietf-cose-webauthn-algorithms-05#section-3.2), [__EdDSA__](https://tools.ietf.org/html/rfc8037#section-3.1) and [__none__](http://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-14#section-3.6) signature algorithms.
- Unit tests, including tests for interoperability with [jose](https://github.com/panva/jose).
- Supports Python 2,7 and 3.6+. **Note:** [generate_jwt](http://rawgit.davedoesdev.com/davedoesdev/python-jwt/master/docs/_build/html/index.html#python_jwt.generate_jwt) returns the token as a Unicode string, even on Python 2.7.
Example:
```python
import python_jwt as jwt, jwcrypto.jwk as jwk, datetime
key = jwk.JWK.generate(kty='RSA', size=2048)
payload = { 'foo': 'bar', 'wup': 90 };
token = jwt.generate_jwt(payload, key, 'PS256', datetime.timedelta(minutes=5))
header, claims = jwt.verify_jwt(token, key, ['PS256'])
for k in payload: assert claims[k] == payload[k]
```
The API is described [here](http://rawgit.davedoesdev.com/davedoesdev/python-jwt/master/docs/_build/html/index.html).
## Installation
```shell
pip install python_jwt
```
## Another Example
You can read and write keys from and to [PEM-format](http://www.openssl.org/docs/crypto/pem.html) strings:
```python
import python_jwt as jwt, jwcrypto.jwk as jwk, datetime
key = jwk.JWK.generate(kty='RSA', size=2048)
priv_pem = key.export_to_pem(private_key=True, password=None)
pub_pem = key.export_to_pem()
payload = { 'foo': 'bar', 'wup': 90 };
priv_key = jwk.JWK.from_pem(priv_pem)
pub_key = jwk.JWK.from_pem(pub_pem)
token = jwt.generate_jwt(payload, priv_key, 'RS256', datetime.timedelta(minutes=5))
header, claims = jwt.verify_jwt(token, pub_key, ['RS256'])
for k in payload: assert claims[k] == payload[k]
```
## Licence
[MIT](https://raw.github.com/davedoesdev/python-jwt/master/LICENCE)
## Tests
```shell
make test
```
## Lint
```shell
make lint
```
## Code Coverage
```shell
make coverage
```
[coverage.py](http://nedbatchelder.com/code/coverage/) results are available [here](http://rawgit.davedoesdev.com/davedoesdev/python-jwt/master/coverage/html/index.html).
Coveralls page is [here](https://coveralls.io/r/davedoesdev/python-jwt).
## Benchmarks
```shell
make bench
```
Here are some results on a laptop with an Intel Core i5-4300M 2.6Ghz CPU and 8Gb RAM running Ubuntu 17.04.
Generate Key|user (ns)|sys (ns)|real (ns)
:--|--:|--:|--:
RSA|103,100,000|200,000|103,341,537
Generate Token|user (ns)|sys (ns)|real (ns)
:--|--:|--:|--:
HS256|220,000|0|226,478
HS384|220,000|0|218,233
HS512|230,000|0|225,823
PS256|1,530,000|10,000|1,536,235
PS384|1,550,000|0|1,549,844
PS512|1,520,000|10,000|1,524,844
RS256|1,520,000|10,000|1,524,565
RS384|1,530,000|0|1,528,074
RS512|1,510,000|0|1,526,089
Load Key|user (ns)|sys (ns)|real (ns)
:--|--:|--:|--:
RSA|210,000|3,000|210,791
Verify Token|user (ns)|sys (ns)|real (ns)
:--|--:|--:|--:
HS256|100,000|0|101,478
HS384|100,000|10,000|103,014
HS512|110,000|0|104,323
PS256|230,000|0|231,058
PS384|240,000|0|237,551
PS512|240,000|0|232,450
RS256|230,000|0|227,737
RS384|230,000|0|230,698
RS512|230,000|0|228,624
Platform: UNKNOWN

@@ -130,1 +16,118 @@ Classifier: Programming Language :: Python :: 2

Description-Content-Type: text/markdown
License-File: LICENCE
# python-jwt&nbsp;&nbsp;&nbsp;[![Build Status](https://github.com/davedoesdev/python-jwt/actions/workflows/ci.yml/badge.svg)](https://github.com/davedoesdev/python-jwt/actions/workflows/ci.yml) [![Coverage Status](https://coveralls.io/repos/github/davedoesdev/python-jwt/badge.svg?branch=master)](https://coveralls.io/github/davedoesdev/python-jwt?branch=master) [![PyPI version](https://badge.fury.io/py/python-jwt.svg)](https://badge.fury.io/py/python-jwt)
Module for generating and verifying [JSON Web Tokens](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html).
- **Note:** From version 2.0.1 the namespace has changed from `jwt` to `python_jwt`, in order to avoid conflict with [PyJWT](https://github.com/jpadilla/pyjwt).
- **Note:** Versions 1.0.0 and later fix [a vulnerability](https://www.timmclean.net/2015/02/25/jwt-alg-none.html) in JSON Web Token verification so please upgrade if you're using this functionality. The API has changed so you will need to update your application. [verify_jwt](http://rawgit.davedoesdev.com/davedoesdev/python-jwt/master/docs/_build/html/index.html#python_jwt.verify_jwt) now requires you to specify which signature algorithms are allowed.
- Uses [jwcrypto](https://jwcrypto.readthedocs.io) to do the heavy lifting.
- Supports [__RS256__, __RS384__, __RS512__](https://tools.ietf.org/html/rfc7518#section-3.3), [__PS256__, __PS384__, __PS512__](https://tools.ietf.org/html/rfc7518#section-3.5), [__HS256__, __HS384__, __HS512__](https://tools.ietf.org/html/rfc7518#section-3.2), [__ES256__, __ES384__, __ES512__](https://tools.ietf.org/html/rfc7518#section-3.4), [__ES256K__](https://tools.ietf.org/html/draft-ietf-cose-webauthn-algorithms-05#section-3.2), [__EdDSA__](https://tools.ietf.org/html/rfc8037#section-3.1) and [__none__](http://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-14#section-3.6) signature algorithms.
- Unit tests, including tests for interoperability with [jose](https://github.com/panva/jose).
- Supports Python 2,7 and 3.6+. **Note:** [generate_jwt](http://rawgit.davedoesdev.com/davedoesdev/python-jwt/master/docs/_build/html/index.html#python_jwt.generate_jwt) returns the token as a Unicode string, even on Python 2.7.
Example:
```python
import python_jwt as jwt, jwcrypto.jwk as jwk, datetime
key = jwk.JWK.generate(kty='RSA', size=2048)
payload = { 'foo': 'bar', 'wup': 90 };
token = jwt.generate_jwt(payload, key, 'PS256', datetime.timedelta(minutes=5))
header, claims = jwt.verify_jwt(token, key, ['PS256'])
for k in payload: assert claims[k] == payload[k]
```
The API is described [here](http://rawgit.davedoesdev.com/davedoesdev/python-jwt/master/docs/_build/html/index.html).
## Installation
```shell
pip install python_jwt
```
## Another Example
You can read and write keys from and to [PEM-format](http://www.openssl.org/docs/crypto/pem.html) strings:
```python
import python_jwt as jwt, jwcrypto.jwk as jwk, datetime
key = jwk.JWK.generate(kty='RSA', size=2048)
priv_pem = key.export_to_pem(private_key=True, password=None)
pub_pem = key.export_to_pem()
payload = { 'foo': 'bar', 'wup': 90 };
priv_key = jwk.JWK.from_pem(priv_pem)
pub_key = jwk.JWK.from_pem(pub_pem)
token = jwt.generate_jwt(payload, priv_key, 'RS256', datetime.timedelta(minutes=5))
header, claims = jwt.verify_jwt(token, pub_key, ['RS256'])
for k in payload: assert claims[k] == payload[k]
```
## Licence
[MIT](https://raw.github.com/davedoesdev/python-jwt/master/LICENCE)
## Tests
```shell
make test
```
## Lint
```shell
make lint
```
## Code Coverage
```shell
make coverage
```
[coverage.py](http://nedbatchelder.com/code/coverage/) results are available [here](http://rawgit.davedoesdev.com/davedoesdev/python-jwt/master/coverage/html/index.html).
Coveralls page is [here](https://coveralls.io/r/davedoesdev/python-jwt).
## Benchmarks
```shell
make bench
```
Here are some results on a laptop with an Intel Core i5-4300M 2.6Ghz CPU and 8Gb RAM running Ubuntu 17.04.
Generate Key|user (ns)|sys (ns)|real (ns)
:--|--:|--:|--:
RSA|103,100,000|200,000|103,341,537
Generate Token|user (ns)|sys (ns)|real (ns)
:--|--:|--:|--:
HS256|220,000|0|226,478
HS384|220,000|0|218,233
HS512|230,000|0|225,823
PS256|1,530,000|10,000|1,536,235
PS384|1,550,000|0|1,549,844
PS512|1,520,000|10,000|1,524,844
RS256|1,520,000|10,000|1,524,565
RS384|1,530,000|0|1,528,074
RS512|1,510,000|0|1,526,089
Load Key|user (ns)|sys (ns)|real (ns)
:--|--:|--:|--:
RSA|210,000|3,000|210,791
Verify Token|user (ns)|sys (ns)|real (ns)
:--|--:|--:|--:
HS256|100,000|0|101,478
HS384|100,000|10,000|103,014
HS512|110,000|0|104,323
PS256|230,000|0|231,058
PS384|240,000|0|237,551
PS512|240,000|0|232,450
RS256|230,000|0|227,737
RS384|230,000|0|230,698
RS512|230,000|0|228,624
Metadata-Version: 2.1
Name: python-jwt
Version: 3.3.2
Version: 3.3.3
Summary: Module for generating and verifying JSON Web Tokens

@@ -9,116 +9,2 @@ Home-page: https://github.com/davedoesdev/python-jwt

License: MIT
Description: # python-jwt&nbsp;&nbsp;&nbsp;[![Build Status](https://github.com/davedoesdev/python-jwt/actions/workflows/ci.yml/badge.svg)](https://github.com/davedoesdev/python-jwt/actions/workflows/ci.yml) [![Coverage Status](https://coveralls.io/repos/github/davedoesdev/python-jwt/badge.svg?branch=master)](https://coveralls.io/github/davedoesdev/python-jwt?branch=master) [![PyPI version](https://badge.fury.io/py/python-jwt.svg)](https://badge.fury.io/py/python-jwt)
Module for generating and verifying [JSON Web Tokens](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html).
- **Note:** From version 2.0.1 the namespace has changed from `jwt` to `python_jwt`, in order to avoid conflict with [PyJWT](https://github.com/jpadilla/pyjwt).
- **Note:** Versions 1.0.0 and later fix [a vulnerability](https://www.timmclean.net/2015/02/25/jwt-alg-none.html) in JSON Web Token verification so please upgrade if you're using this functionality. The API has changed so you will need to update your application. [verify_jwt](http://rawgit.davedoesdev.com/davedoesdev/python-jwt/master/docs/_build/html/index.html#python_jwt.verify_jwt) now requires you to specify which signature algorithms are allowed.
- Uses [jwcrypto](https://jwcrypto.readthedocs.io) to do the heavy lifting.
- Supports [__RS256__, __RS384__, __RS512__](https://tools.ietf.org/html/rfc7518#section-3.3), [__PS256__, __PS384__, __PS512__](https://tools.ietf.org/html/rfc7518#section-3.5), [__HS256__, __HS384__, __HS512__](https://tools.ietf.org/html/rfc7518#section-3.2), [__ES256__, __ES384__, __ES512__](https://tools.ietf.org/html/rfc7518#section-3.4), [__ES256K__](https://tools.ietf.org/html/draft-ietf-cose-webauthn-algorithms-05#section-3.2), [__EdDSA__](https://tools.ietf.org/html/rfc8037#section-3.1) and [__none__](http://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-14#section-3.6) signature algorithms.
- Unit tests, including tests for interoperability with [jose](https://github.com/panva/jose).
- Supports Python 2,7 and 3.6+. **Note:** [generate_jwt](http://rawgit.davedoesdev.com/davedoesdev/python-jwt/master/docs/_build/html/index.html#python_jwt.generate_jwt) returns the token as a Unicode string, even on Python 2.7.
Example:
```python
import python_jwt as jwt, jwcrypto.jwk as jwk, datetime
key = jwk.JWK.generate(kty='RSA', size=2048)
payload = { 'foo': 'bar', 'wup': 90 };
token = jwt.generate_jwt(payload, key, 'PS256', datetime.timedelta(minutes=5))
header, claims = jwt.verify_jwt(token, key, ['PS256'])
for k in payload: assert claims[k] == payload[k]
```
The API is described [here](http://rawgit.davedoesdev.com/davedoesdev/python-jwt/master/docs/_build/html/index.html).
## Installation
```shell
pip install python_jwt
```
## Another Example
You can read and write keys from and to [PEM-format](http://www.openssl.org/docs/crypto/pem.html) strings:
```python
import python_jwt as jwt, jwcrypto.jwk as jwk, datetime
key = jwk.JWK.generate(kty='RSA', size=2048)
priv_pem = key.export_to_pem(private_key=True, password=None)
pub_pem = key.export_to_pem()
payload = { 'foo': 'bar', 'wup': 90 };
priv_key = jwk.JWK.from_pem(priv_pem)
pub_key = jwk.JWK.from_pem(pub_pem)
token = jwt.generate_jwt(payload, priv_key, 'RS256', datetime.timedelta(minutes=5))
header, claims = jwt.verify_jwt(token, pub_key, ['RS256'])
for k in payload: assert claims[k] == payload[k]
```
## Licence
[MIT](https://raw.github.com/davedoesdev/python-jwt/master/LICENCE)
## Tests
```shell
make test
```
## Lint
```shell
make lint
```
## Code Coverage
```shell
make coverage
```
[coverage.py](http://nedbatchelder.com/code/coverage/) results are available [here](http://rawgit.davedoesdev.com/davedoesdev/python-jwt/master/coverage/html/index.html).
Coveralls page is [here](https://coveralls.io/r/davedoesdev/python-jwt).
## Benchmarks
```shell
make bench
```
Here are some results on a laptop with an Intel Core i5-4300M 2.6Ghz CPU and 8Gb RAM running Ubuntu 17.04.
Generate Key|user (ns)|sys (ns)|real (ns)
:--|--:|--:|--:
RSA|103,100,000|200,000|103,341,537
Generate Token|user (ns)|sys (ns)|real (ns)
:--|--:|--:|--:
HS256|220,000|0|226,478
HS384|220,000|0|218,233
HS512|230,000|0|225,823
PS256|1,530,000|10,000|1,536,235
PS384|1,550,000|0|1,549,844
PS512|1,520,000|10,000|1,524,844
RS256|1,520,000|10,000|1,524,565
RS384|1,530,000|0|1,528,074
RS512|1,510,000|0|1,526,089
Load Key|user (ns)|sys (ns)|real (ns)
:--|--:|--:|--:
RSA|210,000|3,000|210,791
Verify Token|user (ns)|sys (ns)|real (ns)
:--|--:|--:|--:
HS256|100,000|0|101,478
HS384|100,000|10,000|103,014
HS512|110,000|0|104,323
PS256|230,000|0|231,058
PS384|240,000|0|237,551
PS512|240,000|0|232,450
RS256|230,000|0|227,737
RS384|230,000|0|230,698
RS512|230,000|0|228,624
Platform: UNKNOWN

@@ -130,1 +16,118 @@ Classifier: Programming Language :: Python :: 2

Description-Content-Type: text/markdown
License-File: LICENCE
# python-jwt&nbsp;&nbsp;&nbsp;[![Build Status](https://github.com/davedoesdev/python-jwt/actions/workflows/ci.yml/badge.svg)](https://github.com/davedoesdev/python-jwt/actions/workflows/ci.yml) [![Coverage Status](https://coveralls.io/repos/github/davedoesdev/python-jwt/badge.svg?branch=master)](https://coveralls.io/github/davedoesdev/python-jwt?branch=master) [![PyPI version](https://badge.fury.io/py/python-jwt.svg)](https://badge.fury.io/py/python-jwt)
Module for generating and verifying [JSON Web Tokens](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html).
- **Note:** From version 2.0.1 the namespace has changed from `jwt` to `python_jwt`, in order to avoid conflict with [PyJWT](https://github.com/jpadilla/pyjwt).
- **Note:** Versions 1.0.0 and later fix [a vulnerability](https://www.timmclean.net/2015/02/25/jwt-alg-none.html) in JSON Web Token verification so please upgrade if you're using this functionality. The API has changed so you will need to update your application. [verify_jwt](http://rawgit.davedoesdev.com/davedoesdev/python-jwt/master/docs/_build/html/index.html#python_jwt.verify_jwt) now requires you to specify which signature algorithms are allowed.
- Uses [jwcrypto](https://jwcrypto.readthedocs.io) to do the heavy lifting.
- Supports [__RS256__, __RS384__, __RS512__](https://tools.ietf.org/html/rfc7518#section-3.3), [__PS256__, __PS384__, __PS512__](https://tools.ietf.org/html/rfc7518#section-3.5), [__HS256__, __HS384__, __HS512__](https://tools.ietf.org/html/rfc7518#section-3.2), [__ES256__, __ES384__, __ES512__](https://tools.ietf.org/html/rfc7518#section-3.4), [__ES256K__](https://tools.ietf.org/html/draft-ietf-cose-webauthn-algorithms-05#section-3.2), [__EdDSA__](https://tools.ietf.org/html/rfc8037#section-3.1) and [__none__](http://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-14#section-3.6) signature algorithms.
- Unit tests, including tests for interoperability with [jose](https://github.com/panva/jose).
- Supports Python 2,7 and 3.6+. **Note:** [generate_jwt](http://rawgit.davedoesdev.com/davedoesdev/python-jwt/master/docs/_build/html/index.html#python_jwt.generate_jwt) returns the token as a Unicode string, even on Python 2.7.
Example:
```python
import python_jwt as jwt, jwcrypto.jwk as jwk, datetime
key = jwk.JWK.generate(kty='RSA', size=2048)
payload = { 'foo': 'bar', 'wup': 90 };
token = jwt.generate_jwt(payload, key, 'PS256', datetime.timedelta(minutes=5))
header, claims = jwt.verify_jwt(token, key, ['PS256'])
for k in payload: assert claims[k] == payload[k]
```
The API is described [here](http://rawgit.davedoesdev.com/davedoesdev/python-jwt/master/docs/_build/html/index.html).
## Installation
```shell
pip install python_jwt
```
## Another Example
You can read and write keys from and to [PEM-format](http://www.openssl.org/docs/crypto/pem.html) strings:
```python
import python_jwt as jwt, jwcrypto.jwk as jwk, datetime
key = jwk.JWK.generate(kty='RSA', size=2048)
priv_pem = key.export_to_pem(private_key=True, password=None)
pub_pem = key.export_to_pem()
payload = { 'foo': 'bar', 'wup': 90 };
priv_key = jwk.JWK.from_pem(priv_pem)
pub_key = jwk.JWK.from_pem(pub_pem)
token = jwt.generate_jwt(payload, priv_key, 'RS256', datetime.timedelta(minutes=5))
header, claims = jwt.verify_jwt(token, pub_key, ['RS256'])
for k in payload: assert claims[k] == payload[k]
```
## Licence
[MIT](https://raw.github.com/davedoesdev/python-jwt/master/LICENCE)
## Tests
```shell
make test
```
## Lint
```shell
make lint
```
## Code Coverage
```shell
make coverage
```
[coverage.py](http://nedbatchelder.com/code/coverage/) results are available [here](http://rawgit.davedoesdev.com/davedoesdev/python-jwt/master/coverage/html/index.html).
Coveralls page is [here](https://coveralls.io/r/davedoesdev/python-jwt).
## Benchmarks
```shell
make bench
```
Here are some results on a laptop with an Intel Core i5-4300M 2.6Ghz CPU and 8Gb RAM running Ubuntu 17.04.
Generate Key|user (ns)|sys (ns)|real (ns)
:--|--:|--:|--:
RSA|103,100,000|200,000|103,341,537
Generate Token|user (ns)|sys (ns)|real (ns)
:--|--:|--:|--:
HS256|220,000|0|226,478
HS384|220,000|0|218,233
HS512|230,000|0|225,823
PS256|1,530,000|10,000|1,536,235
PS384|1,550,000|0|1,549,844
PS512|1,520,000|10,000|1,524,844
RS256|1,520,000|10,000|1,524,565
RS384|1,530,000|0|1,528,074
RS512|1,510,000|0|1,526,089
Load Key|user (ns)|sys (ns)|real (ns)
:--|--:|--:|--:
RSA|210,000|3,000|210,791
Verify Token|user (ns)|sys (ns)|real (ns)
:--|--:|--:|--:
HS256|100,000|0|101,478
HS384|100,000|10,000|103,014
HS512|110,000|0|104,323
PS256|230,000|0|231,058
PS384|240,000|0|237,551
PS512|240,000|0|232,450
RS256|230,000|0|227,737
RS384|230,000|0|230,698
RS512|230,000|0|228,624

@@ -18,4 +18,7 @@ .coveragerc

bench/verify_token_bench.py
bench/__pycache__/__init__.cpython-310.pyc
bench/__pycache__/__init__.cpython-39.pyc
bench/__pycache__/reporter.cpython-310.pyc
bench/__pycache__/reporter.cpython-39.pyc
bench/__pycache__/unitbench.cpython-310.pyc
bench/__pycache__/unitbench.cpython-39.pyc

@@ -64,2 +67,3 @@ docs/Makefile

python_jwt.egg-info/top_level.txt
python_jwt/__pycache__/__init__.cpython-310.pyc
python_jwt/__pycache__/__init__.cpython-33.pyc

@@ -100,2 +104,3 @@ python_jwt/__pycache__/__init__.cpython-34.pyc

test/variance_vows.pyc
test/__pycache__/__init__.cpython-310.pyc
test/__pycache__/__init__.cpython-34.pyc

@@ -106,8 +111,11 @@ test/__pycache__/__init__.cpython-35.pyc

test/__pycache__/__init__.cpython-39.pyc
test/__pycache__/alg_none_verification_vows.cpython-310.pyc
test/__pycache__/alg_none_verification_vows.cpython-34.pyc
test/__pycache__/alg_none_verification_vows.cpython-37.pyc
test/__pycache__/alg_none_verification_vows.cpython-39.pyc
test/__pycache__/allowed_algs_vows.cpython-310.pyc
test/__pycache__/allowed_algs_vows.cpython-34.pyc
test/__pycache__/allowed_algs_vows.cpython-37.pyc
test/__pycache__/allowed_algs_vows.cpython-39.pyc
test/__pycache__/common.cpython-310.pyc
test/__pycache__/common.cpython-34.pyc

@@ -117,2 +125,3 @@ test/__pycache__/common.cpython-35.pyc

test/__pycache__/common.cpython-39.pyc
test/__pycache__/fixtures.cpython-310.pyc
test/__pycache__/fixtures.cpython-34.pyc

@@ -122,8 +131,12 @@ test/__pycache__/fixtures.cpython-35.pyc

test/__pycache__/fixtures.cpython-39.pyc
test/__pycache__/google_jwt_oauth_vows.cpython-310.pyc
test/__pycache__/google_jwt_oauth_vows.cpython-34.pyc
test/__pycache__/google_jwt_oauth_vows.cpython-37.pyc
test/__pycache__/google_jwt_oauth_vows.cpython-39.pyc
test/__pycache__/jose_interop_vows.cpython-310.pyc
test/__pycache__/jose_interop_vows.cpython-39.pyc
test/__pycache__/jwcrypto_notimpl_vows.cpython-310.pyc
test/__pycache__/jwcrypto_notimpl_vows.cpython-37.pyc
test/__pycache__/jwcrypto_notimpl_vows.cpython-39.pyc
test/__pycache__/jwt_spec.cpython-310.pyc
test/__pycache__/jwt_spec.cpython-34.pyc

@@ -133,2 +146,3 @@ test/__pycache__/jwt_spec.cpython-35.pyc

test/__pycache__/jwt_spec.cpython-39.pyc
test/__pycache__/jwt_vows.cpython-310.pyc
test/__pycache__/jwt_vows.cpython-34.pyc

@@ -138,2 +152,3 @@ test/__pycache__/jwt_vows.cpython-35.pyc

test/__pycache__/jwt_vows.cpython-39.pyc
test/__pycache__/missing_claims_vows.cpython-310.pyc
test/__pycache__/missing_claims_vows.cpython-37.pyc

@@ -143,7 +158,10 @@ test/__pycache__/missing_claims_vows.cpython-39.pyc

test/__pycache__/node_jsjws_interop_vows.cpython-37.pyc
test/__pycache__/other_headers_vows.cpython-310.pyc
test/__pycache__/other_headers_vows.cpython-37.pyc
test/__pycache__/other_headers_vows.cpython-39.pyc
test/__pycache__/pem_as_hmac_key_vows.cpython-310.pyc
test/__pycache__/pem_as_hmac_key_vows.cpython-34.pyc
test/__pycache__/pem_as_hmac_key_vows.cpython-37.pyc
test/__pycache__/pem_as_hmac_key_vows.cpython-39.pyc
test/__pycache__/variance_vows.cpython-310.pyc
test/__pycache__/variance_vows.cpython-34.pyc

@@ -154,2 +172,3 @@ test/__pycache__/variance_vows.cpython-37.pyc

test/python_jwt/__init__.pyc
test/python_jwt/__pycache__/__init__.cpython-310.pyc
test/python_jwt/__pycache__/__init__.cpython-33.pyc

@@ -167,2 +186,3 @@ test/python_jwt/__pycache__/__init__.cpython-34.pyc

test/run/run_pyvows.py
test/run/__pycache__/__init__.cpython-310.pyc
test/run/__pycache__/__init__.cpython-34.pyc

@@ -173,2 +193,3 @@ test/run/__pycache__/__init__.cpython-35.pyc

test/run/__pycache__/__init__.cpython-39.pyc
test/run/__pycache__/patch.cpython-310.pyc
test/run/__pycache__/patch.cpython-34.pyc

@@ -175,0 +196,0 @@ test/run/__pycache__/patch.cpython-35.pyc

@@ -119,3 +119,3 @@ """

:param iat_skew: The amount of leeway to allow between the issuer's clock and the verifier's clock when verifiying that the token was generated in the past. Defaults to no leeway.
:param iat_skew: The amount of leeway to allow between the issuer's clock and the verifier's clock when verifying that the token was generated in the past. Defaults to no leeway.
:type iat_skew: datetime.timedelta

@@ -122,0 +122,0 @@

@@ -9,3 +9,3 @@ import os

name='python_jwt',
version='3.3.2',
version='3.3.3',
description="Module for generating and verifying JSON Web Tokens",

@@ -12,0 +12,0 @@ long_description=read('README.md'),

@@ -8,3 +8,3 @@ """ Test verification of tokens with algorithms none """

from pyvows import Vows, expect
from jwcrypto.jwt import JWK
from jwcrypto.jwk import JWK
from jwcrypto.common import base64url_encode

@@ -11,0 +11,0 @@

@@ -7,3 +7,3 @@ """ Test JWS not-implemented errors """

from pyvows import Vows, expect
from jwcrypto.jwt import JWK
from jwcrypto.jwk import JWK
from jwcrypto.common import base64url_encode

@@ -10,0 +10,0 @@

@@ -119,3 +119,3 @@ """

:param iat_skew: The amount of leeway to allow between the issuer's clock and the verifier's clock when verifiying that the token was generated in the past. Defaults to no leeway.
:param iat_skew: The amount of leeway to allow between the issuer's clock and the verifier's clock when verifying that the token was generated in the past. Defaults to no leeway.
:type iat_skew: datetime.timedelta

@@ -122,0 +122,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet