cognito-jwt-lite
Advanced tools
Comparing version
@@ -11,10 +11,7 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.verify = exports.JwtError = void 0; | ||
const jsonwebtoken_1 = require("jsonwebtoken"); | ||
const jwk_to_pem_1 = __importDefault(require("jwk-to-pem")); | ||
const https_1 = require("https"); | ||
const jose_1 = require("jose"); | ||
const DEFAULT_DISCOVERY_RETRIES = 2; | ||
@@ -98,3 +95,4 @@ class JwtError extends Error { | ||
try { | ||
return (0, jwk_to_pem_1.default)(matchingKey); | ||
const publicKey = yield (0, jose_1.importJWK)(matchingKey); | ||
return (0, jose_1.exportSPKI)(publicKey); | ||
} | ||
@@ -101,0 +99,0 @@ catch (e) { |
{ | ||
"name": "cognito-jwt-lite", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Lightweight AWS Cognito JWT verifier", | ||
@@ -34,3 +34,2 @@ "main": "lib/src/index.js", | ||
"@types/jsonwebtoken": "^9.0.0", | ||
"@types/jwk-to-pem": "^2.0.1", | ||
"@types/node": "^18.11.18", | ||
@@ -47,3 +46,3 @@ "@typescript-eslint/eslint-plugin": "^5.46.1", | ||
"prettier": "^2.8.1", | ||
"semantic-release": "^19.0.5", | ||
"semantic-release": "^24.0.0", | ||
"ts-jest": "^29.0.4", | ||
@@ -53,4 +52,4 @@ "typescript": "^4.9.4" | ||
"dependencies": { | ||
"jsonwebtoken": "^9.0.0", | ||
"jwk-to-pem": "^2.0.5" | ||
"jose": "^5.6.3", | ||
"jsonwebtoken": "^9.0.2" | ||
}, | ||
@@ -57,0 +56,0 @@ "lint-staged": { |
@@ -8,3 +8,3 @@ # cognito-jwt-lite | ||
<!-- | ||
 | ||
@@ -19,3 +19,3 @@  | ||
[](https://sonarcloud.io/dashboard?id=MarioArnt_cognito-jwt-lite) | ||
[](https://sonarcloud.io/dashboard?id=MarioArnt_cognito-jwt-lite) | ||
[](https://sonarcloud.io/dashboard?id=MarioArnt_cognito-jwt-lite)--> | ||
@@ -22,0 +22,0 @@ <p align="center"> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
16
-5.88%17136
-0.75%192
-1.03%+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated