dynamodb-admin
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -6,2 +6,3 @@ const express = require('express') | ||
const fs = require('fs') | ||
const os = require('os') | ||
const errorhandler = require('errorhandler') | ||
@@ -92,2 +93,18 @@ const { extractKey, extractKeysForItems, parseKey } = require('./util') | ||
function getHomeDir() { | ||
const env = process.env | ||
const home = env.HOME || env.USERPROFILE | ||
|| (env.HOMEPATH ? ((env.HOMEDRIVE || 'C:/') + env.HOMEPATH) : null) | ||
if (home) { | ||
return home | ||
} | ||
if (typeof os.homedir === 'function') { | ||
return os.homedir() | ||
} | ||
return null | ||
} | ||
exports.createServer = (dynamodb, docClient) => { | ||
@@ -100,4 +117,6 @@ const app = express() | ||
if (!dynamodb || !docClient) { | ||
if (fs.existsSync(path.join(process.env.HOME, '.aws', 'credentials')) && | ||
fs.existsSync(path.join(process.env.HOME, '.aws', 'config'))) { | ||
const homeDir = getHomeDir() | ||
if (homeDir && fs.existsSync(path.join(homeDir, '.aws', 'credentials')) && | ||
fs.existsSync(path.join(homeDir, '.aws', 'config'))) { | ||
process.env.AWS_SDK_LOAD_CONFIG = 1 | ||
@@ -104,0 +123,0 @@ } |
{ | ||
"name": "dynamodb-admin", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "GUI for DynamoDB. Useful for local development.", | ||
@@ -5,0 +5,0 @@ "main": "lib/backend.js", |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
790478
3836
7