Comparing version 3.1.4 to 3.1.5
/*global module*/ | ||
var base64url = require('base64url'); | ||
var Buffer = require('safe-buffer').Buffer; | ||
var DataStream = require('./data-stream'); | ||
@@ -9,2 +9,11 @@ var jwa = require('jwa'); | ||
function base64url(string, encoding) { | ||
return Buffer | ||
.from(string, encoding) | ||
.toString('base64') | ||
.replace(/=/g, '') | ||
.replace(/\+/g, '-') | ||
.replace(/\//g, '_'); | ||
} | ||
function jwsSecuredInput(header, payload, encoding) { | ||
@@ -11,0 +20,0 @@ encoding = encoding || 'utf8'; |
/*global module*/ | ||
var base64url = require('base64url'); | ||
var Buffer = require('safe-buffer').Buffer; | ||
var DataStream = require('./data-stream'); | ||
@@ -23,3 +23,3 @@ var jwa = require('jwa'); | ||
var encodedHeader = jwsSig.split('.', 1)[0]; | ||
return safeJsonParse(base64url.decode(encodedHeader, 'binary')); | ||
return safeJsonParse(Buffer.from(encodedHeader, 'base64').toString('binary')); | ||
} | ||
@@ -38,3 +38,3 @@ | ||
var payload = jwsSig.split('.')[1]; | ||
return base64url.decode(payload, encoding); | ||
return Buffer.from(payload, 'base64').toString(encoding); | ||
} | ||
@@ -41,0 +41,0 @@ |
{ | ||
"name": "jws", | ||
"version": "3.1.4", | ||
"version": "3.1.5", | ||
"description": "Implementation of JSON Web Signatures", | ||
@@ -27,4 +27,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"base64url": "^2.0.0", | ||
"jwa": "^1.1.4", | ||
"jwa": "^1.1.5", | ||
"safe-buffer": "^5.0.1" | ||
@@ -31,0 +30,0 @@ }, |
@@ -119,5 +119,5 @@ # node-jws [![Build Status](https://secure.travis-ci.org/brianloveswords/node-jws.png)](http://travis-ci.org/brianloveswords/node-jws) | ||
// is equivilant to this: | ||
const signer = jws.createSign( | ||
const signer = jws.createSign({ | ||
header: { alg: 'RS256' }, | ||
); | ||
}); | ||
privateKeyStream.pipe(signer.privateKey); | ||
@@ -124,0 +124,0 @@ payloadStream.pipe(signer.payload); |
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
17500
2
247
9
- Removedbase64url@^2.0.0
- Removedbase64url@2.0.0(transitive)
Updatedjwa@^1.1.5