mirror of
https://github.com/denoland/deno.git
synced 2025-09-29 13:44:47 +00:00
feat(std/jwt): add a JSON Web Token library (#7991)
Co-authored-by: Tim Reichen <timreichen@users.noreply.github.com>
This commit is contained in:
parent
992c2a436e
commit
034ab48086
7 changed files with 739 additions and 0 deletions
11
std/jwt/_algorithm_test.ts
Normal file
11
std/jwt/_algorithm_test.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { assertEquals } from "../testing/asserts.ts";
|
||||
|
||||
import { verify as verifyAlgorithm } from "./_algorithm.ts";
|
||||
|
||||
Deno.test("[jwt] verify algorithm", function () {
|
||||
assertEquals(verifyAlgorithm("HS512", "HS512"), true);
|
||||
assertEquals(verifyAlgorithm("HS512", "HS256"), false);
|
||||
assertEquals(verifyAlgorithm(["HS512"], "HS512"), true);
|
||||
assertEquals(verifyAlgorithm(["HS256", "HS512"], "HS512"), true);
|
||||
assertEquals(verifyAlgorithm(["HS512"], "HS256"), false);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue