Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

Commit

Permalink
Don’t depend on old private PyJWT API
Browse files Browse the repository at this point in the history
base64url_decode wasn’t meant to be
public API and has since been moved.
  • Loading branch information
jpadilla committed Feb 18, 2015
1 parent 744d90b commit 84f4157
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import json
from jwt import base64url_decode
import base64

from django.contrib.auth import get_user_model
from django.test import TestCase
Expand All @@ -8,6 +8,15 @@
User = get_user_model()


def base64url_decode(input):
rem = len(input) % 4

if rem > 0:
input += b'=' * (4 - rem)

return base64.urlsafe_b64decode(input)


class UtilsTests(TestCase):
def setUp(self):
self.username = 'jpueblo'
Expand Down

0 comments on commit 84f4157

Please sign in to comment.