New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

edgegrid

Package Overview
Dependencies
Maintainers
3
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

edgegrid - npm Package Compare versions

Comparing version 3.0.3 to 3.0.4

2

package.json
{
"name": "edgegrid",
"version": "3.0.3",
"version": "3.0.4",
"description": "Authentication handler for the Akamai OPEN EdgeGrid Authentication scheme in Node.js",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -34,2 +34,17 @@ // Copyright 2014 Akamai Technologies, Inc. All Rights Reserved

function validatedConfig(config) {
if (!(config.host && config.access_token &&
config.client_secret && config.client_token)) {
var errorMessage = "";
var tokens =
['client_token', 'client_secret','access_token','host'];
tokens.forEach(function(token) {
if (!config[token]) {
errorMessage += "\nMissing: " + token;
}
})
console.log('Missing part of the configuration:\n' + errorMessage);
return {};
}
if (config.host.indexOf('https://') > -1) {

@@ -40,3 +55,3 @@ return config;

config.host = 'https://' + config.host;
return config;

@@ -65,5 +80,32 @@ }

function readEnv(section) {
// If any are set, we're committed
var envConf = {};
var envPrefix = "AKAMAI_" + section.toUpperCase()
var tokens =
['client_token', 'client_secret','access_token','host'];
tokens.forEach(function(token){
var envcheck = envPrefix + "_" + token.toUpperCase()
if (process.env[envcheck]) {
envConf[token] = process.env[envcheck];
}
})
if (Object.keys(envConf).length > 0) {
console.log("Using configuration from environment variables")
return validatedConfig(envConf);
}
return {};
}
module.exports = function(path, conf) {
var confSection = conf || 'default'
var envConf = readEnv(confSection);
if (envConf['host']) {
return envConf;
}
var edgerc = fs.readFileSync(path).toString().split('\n'),
confSection = conf || 'default',
confSection,
confData = getSection(edgerc, confSection);

@@ -70,0 +112,0 @@

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