File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,14 @@ def test_round_trip_with_different_key_types(self, key):
89
89
assert verified_data ['testkey' ] == 'testvalue'
90
90
91
91
92
+ class TestJWK (object ):
93
+ def test_jwk (self , payload ):
94
+ key_data = 'key'
95
+ key = jwk .construct (key_data , algorithm = 'HS256' )
96
+ token = jws .sign (payload , key , algorithm = ALGORITHMS .HS256 )
97
+ assert jws .verify (token , key_data , ALGORITHMS .HS256 ) == payload
98
+
99
+
92
100
class TestHMAC (object ):
93
101
94
102
def testHMAC256 (self , payload ):
@@ -272,6 +280,10 @@ def test_tuple(self):
272
280
def test_list (self ):
273
281
assert ['test' , 'key' ] == jws ._get_keys (['test' , 'key' ])
274
282
283
+ def test_jwk (self ):
284
+ jwkey = jwk .construct ('key' , algorithm = 'HS256' )
285
+ assert (jwkey ,) == jws ._get_keys (jwkey )
286
+
275
287
276
288
class TestRSA (object ):
277
289
You can’t perform that action at this time.
0 commit comments