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

kong-admin-node-client

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kong-admin-node-client - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

.npmignore

66

package.json
{
"name": "kong-admin-node-client",
"version": "1.0.3",
"description": "Kong admin API client in node",
"main": "index.js",
"directories": {
"test": "test"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ugolas/kong-admin-node-client.git"
},
"keywords": [
"kong",
"admin",
"api",
"node"
],
"author": "Alex Ugol <alex.ugol@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/ugolas/kong-admin-node-client/issues"
},
"homepage": "https://github.com/ugolas/kong-admin-node-client#readme",
"dependencies": {
"bunyan": "^1.8.12",
"lodash": "^4.17.4",
"pkginfo": "^0.4.1",
"request": "^2.83.0",
"request-promise": "^4.2.2"
}
"name": "kong-admin-node-client",
"version": "1.0.4",
"description": "Kong admin API client in node",
"main": "index.js",
"directories": {
"test": "test"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ugolas/kong-admin-node-client.git"
},
"keywords": [
"kong",
"admin",
"api",
"node"
],
"author": "Alex Ugol <alex.ugol@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/ugolas/kong-admin-node-client/issues"
},
"homepage": "https://github.com/ugolas/kong-admin-node-client#readme",
"dependencies": {
"bunyan": "^1.8.12",
"lodash": "^4.17.4",
"pkginfo": "^0.4.1",
"request": "^2.83.0",
"request-promise": "^4.2.2"
}
}

@@ -19,2 +19,16 @@ let _ = require('lodash'),

let deleteAPI = function ({
url,
apiName
}) {
let options = {
method: 'DELETE',
uri: `${url}/apis/${apiName}`,
body: body
};
var requestOptions = _.assign(options, basicRequest);
return sendRequestAndProcessError(requestOptions, [204])
};
let getAPI = function ({

@@ -81,3 +95,3 @@ url,

if (!expectedStatuses.includes(res.statusCode)) {
logger.error(`Error during get plugin, expected status ${expectedStatuses}, got: ${res.statusCode}`)
logger.error(`Error during operation, expected status ${expectedStatuses}, got: ${res.statusCode}`)
logger.error(`Error body: ${JSON.stringify(res.body)}`)

@@ -84,0 +98,0 @@ throw new Error(`Error in ${options.method}, ${options.uri}`)

@@ -74,2 +74,17 @@ let httpHelper = require('./http-helper'),

async removeAPIs(apis) {
logger.info(`Removing apis from kong, ${apis.length} in total`);
for (let api of apis) {
logger.info(`Removing api: ${api.name}, ${apis.indexOf(api) + 1} out of ${apis.length} apis`);
// Check if exists
let removeResponse = await httpHelper.deleteAPI({
url: this.kongAdminUrl,
apiName: api.name
})
logger.info(`Configuration for api: ${api.name} was removed successfully`);
}
}
async createPlugins(plugins, apiName) {

@@ -76,0 +91,0 @@ logger.info(apiName ? `Setting up plugins in api: ${apiName}, ${plugins.length} in total` : `Setting up plugins, ${plugins.length} in total`);

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