From 78429496e0625a68ccfdd215c7e240eddb3b5b66 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Mon, 26 Oct 2020 23:10:48 +1100 Subject: revert new std/jwt module so issues can be addressed (#8127) This reverts commit aa0e64b5794e4515d5e1911107ba54ce7e0dcc3c. This reverts commit 034ab48086557af00216ffe311c71ad4eb0ec4d5. --- std/jwt/_algorithm.ts | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 std/jwt/_algorithm.ts (limited to 'std/jwt/_algorithm.ts') diff --git a/std/jwt/_algorithm.ts b/std/jwt/_algorithm.ts deleted file mode 100644 index c9c5257e1..000000000 --- a/std/jwt/_algorithm.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JSW ยง1: Cryptographic algorithms and identifiers for use with this specification - * are described in the separate JSON Web Algorithms (JWA) specification: - * https://www.rfc-editor.org/rfc/rfc7518 - */ -export type Algorithm = "none" | "HS256" | "HS512"; -export type AlgorithmInput = Algorithm | Array>; -/** - * Verify the algorithm - * @param algorithm as string or multiple algorithms in an array excluding 'none' - * @param the algorithm from the jwt header - */ -export function verify(algorithm: AlgorithmInput, jwtAlg: string): boolean { - return Array.isArray(algorithm) - ? (algorithm as string[]).includes(jwtAlg) - : algorithm === jwtAlg; -} -- cgit v1.2.3