Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cf-client

Package Overview
Dependencies
Maintainers
4
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cf-client - npm Package Compare versions

Comparing version 0.13.9 to 0.13.10

39

lib/model/uaa/UsersUAA.js

@@ -197,4 +197,41 @@ "use strict";

/**
* Method to decode an access token
*
* @param {String} accessToken [Access Token to be decoded]
* @return {Object} [decoded access token object]
*/
decodeAccessToken (accessToken) {
var tokenString;
var bearerTypeAndToken = accessToken.split(" ")
if (bearerTypeAndToken.length === 2) {
tokenString = bearerTypeAndToken[1]
} else if( bearerTypeAndToken.length === 1) {
tokenString = bearerTypeAndToken[0]
} else {
throw new Error("Invalid token format")
}
var tokenParts = tokenString.split(".")
if (tokenParts.length !== 3) {
throw new Error("Invalid token format")
}
var encodedTokenInfo = tokenParts[1];
var tokenInfo = {};
try {
var buf = new Buffer(encodedTokenInfo, "base64")
tokenInfo = JSON.decode(buf.toString("utf8"))
} catch(e) {
console.log(e);
throw new Error("Invalid token format")
}
return tokenInfo;
}
}
module.exports = UsersUAA;
module.exports = UsersUAA;

2

package.json
{
"name": "cf-client",
"version": "0.13.9",
"version": "0.13.10",
"description": "A Cloud Foundry Client for Node.js",

@@ -5,0 +5,0 @@ "author": "Juan Antonio Breña Moral <bren@juanantonio.info>",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc