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

openapi-fuzzer-core

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi-fuzzer-core - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

2

package.json
{
"name": "openapi-fuzzer-core",
"version": "1.0.4",
"version": "1.0.5",
"description": "A library to generate random requests based on open-api specifications.",

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

const { klona } = require("klona");
const HTTP_METHODS = ['get', 'post', 'put', 'patch', 'delete'];
const HTTP_METHODS_SET = new Set(HTTP_METHODS);

@@ -35,12 +36,14 @@ class Swagger {

for (const method of Object.keys(path)) {
this.specs.push({
name: 'PATH',
request: {
method,
path: `${this.basePath}${route}/INVALID/PATH`
},
expect: {
status: [404]
}
});
if (HTTP_METHODS_SET.has(method)) {
this.specs.push({
name: 'PATH',
request: {
method,
path: `${this.basePath}${route}/INVALID/PATH`
},
expect: {
status: [404]
}
});
}
}

@@ -74,8 +77,10 @@ }

for (const method of Object.keys(path)) {
const info = path[method];
const parameters = info.parameters;
if (parameters && parameters.length > 0) {
this.fuzzPathParams(route, method, parameters);
this.fuzzQueryParams(route, method, parameters);
this.fuzzBodyParams(route, method, parameters);
if (HTTP_METHODS_SET.has(method)) {
const info = path[method];
const parameters = info.parameters;
if (parameters && parameters.length > 0) {
this.fuzzPathParams(route, method, parameters);
this.fuzzQueryParams(route, method, parameters);
this.fuzzBodyParams(route, method, parameters);
}
}

@@ -82,0 +87,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