
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
org.mikeneck.httpspec:http-spec-runner
Advanced tools
Testing library for http API with DSL and jsonpath assertion.
http-spec is a library for web services to describe REST API specification.
This library build on top of Java 11's http API.
spec:
- name: 'getting path resource with paging parameters'
request:
get: 'http://localhost:8080/path'
queries:
q: test
page: 4
limit: 10
headers:
accept: application/json
authorization: bearer 11aa22bb33cc
response:
status: 200
headers:
content-type: application/json
body:
- path: $.firstName
expect:
type: string
value: John
class RestApiTest {
@Test
void runRequestFromYamlFile() {
var yamlFile = new File("/path/to/spec.yaml");
HttpSpecRunner.from(yamlFile).run(); // runs all requests and asserts responses.
}
}
class RestApiTest {
@Test
void runRequestByJavaCode() {
HttpSpecRunner.Builder builder = HttpSpecRunner.builder();
builder.addSpec(spec -> {
spec.name("getting path resource with paging parameters");
spec.request().get("http://localhost:8080/path", request -> {
request.query("q", "test");
request.query("page", 4);
request.query("limit", 10);
request.header("accept", "application/json");
request.header("authorization", "bearer 11aa22bb33cc");
});
spec.response(response -> {
response.status(200);
response.header("content-type", "application/json");
response.jsonBody(jsonBody -> jsonBody.path("$.firstName").toBe("John"));
});
});
HttpSpecRunner httpSpecRunner = builder.build();
httpSpecRunner.run(); // runs all requests and asserts responses.
}
}
T.B.D.
With junit-jupiter module, you can convert HttpSpecRunner
into Stream<DynamicTest>
.
import java.util.stream.Stream;
class RestApiTest {
// With junit-jupiter module, you can use httpSpecRunner as dynamic tests.
@TestFactory
Stream<DynamicTest> asDynamicTests() {
HttpSpecRunner.Builder builder = HttpSpecRunner.builder();
// same as the code in runRequestByJavaCode
HttpSpecRunner httpSpecRunner = builder.build();
// converts each assertion to dynamicTest
// - http status to be 200
// - content-type header to be application/json
// - body json has element $.firstName to be John
return DynamicTestAdapter.adapt(httpSpecRunner);
}
}
FAQs
Unknown package
We found that org.mikeneck.httpspec:http-spec-runner demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.