@codefresh-io/authenticated-entity
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -185,3 +185,10 @@ 'use strict'; | ||
describe('Create hash string', () => { | ||
it('Should create', () => { | ||
const user = User.constructFromEncodedString(encodedFakeUser); | ||
expect(user.generateHashString()).to.be.deep.equal('6959c12fb513a3d1cd47bf23a37153837972fae49936d1ab7c0c15236449f096'); | ||
}); | ||
}); | ||
}); | ||
'use strict'; | ||
const _ = require('lodash'); | ||
const crypto = require('crypto'); | ||
@@ -82,2 +83,8 @@ const requiredParams = [ | ||
generateHashString() { | ||
return crypto.createHash('sha256') | ||
.update(this.encodeToBase64String()) | ||
.digest('hex'); | ||
} | ||
encodeToBase64String() { | ||
@@ -106,3 +113,3 @@ return Buffer.from(this.toString()).toString('base64'); | ||
} | ||
getUserId() { | ||
@@ -109,0 +116,0 @@ return this._user._id; |
{ | ||
"name": "@codefresh-io/authenticated-entity", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
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
112903
10
298
0