atlassian-jwt
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -60,2 +60,3 @@ import { Request as ExpressRequest } from 'express'; | ||
export declare function getKeyId(token: string): any; | ||
export declare function getAlgorithm(token: string): any; | ||
/** | ||
@@ -62,0 +63,0 @@ * Decodes JWT string to object. |
@@ -48,3 +48,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createQueryStringHash = exports.createCanonicalRequest = exports.encodeAsymmetric = exports.encodeSymmetric = exports.decodeSymmetric = exports.getKeyId = exports.decodeAsymmetric = exports.version = exports.fromMethodAndPathAndBody = exports.fromMethodAndUrl = exports.fromExpressRequest = exports.SymmetricAlgorithm = exports.AsymmetricAlgorithm = void 0; | ||
exports.createQueryStringHash = exports.createCanonicalRequest = exports.encodeAsymmetric = exports.encodeSymmetric = exports.decodeSymmetric = exports.getAlgorithm = exports.getKeyId = exports.decodeAsymmetric = exports.version = exports.fromMethodAndPathAndBody = exports.fromMethodAndUrl = exports.fromExpressRequest = exports.SymmetricAlgorithm = exports.AsymmetricAlgorithm = void 0; | ||
var crypto_1 = require("crypto"); | ||
@@ -156,2 +156,9 @@ var lodash_1 = __importDefault(require("lodash")); | ||
exports.getKeyId = getKeyId; | ||
function getAlgorithm(token) { | ||
var _a = getTokenSegments(token), headerSeg = _a[0], payloadSeg = _a[1]; | ||
// Base64 decode and parse JSON | ||
var header = getHeaderAndPayload(headerSeg, payloadSeg)[0]; | ||
return header && header.alg; | ||
} | ||
exports.getAlgorithm = getAlgorithm; | ||
/** | ||
@@ -158,0 +165,0 @@ * Decodes JWT string to object. |
{ | ||
"name": "atlassian-jwt", | ||
"description": "JWT (JSON Web Token) implementation with custom Atlassian QSH claim verification", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"author": "Atlassian", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -75,3 +75,4 @@ # atlassian-jwt | ||
Extracts `kid` from a jwt token. | ||
- `jwt.getAlgorithm(token)` | ||
Extracts `alg` from a jwt token. | ||
### Algorithms | ||
@@ -78,0 +79,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
29465
534
159
0