Skip to content

Commit

Permalink
Merge pull request #16 from AikidoSec/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
hansott authored Feb 16, 2024
2 parents 42dc778 + 0f1e308 commit 5fa2053
Show file tree
Hide file tree
Showing 11 changed files with 1,757 additions and 1,171 deletions.
2 changes: 1 addition & 1 deletion benchmarks/express-mongodb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "express-mongodb-bench",
"private": true,
"dependencies": {
"@aikidosec/guard": "^1.0.0",
"@aikidosec/guard": "file:../../library",
"cookie-parser": "^1.4.6",
"dotenv": "^16.4.3",
"express": "^4.18.2",
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/mongodb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mongodb-bench",
"private": true,
"dependencies": {
"@aikidosec/guard": "^1.0.0",
"@aikidosec/guard": "file:../../library",
"mongodb": "^6.3.0"
}
}
3 changes: 3 additions & 0 deletions library/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
*

# Allowed files
!/README.md
!/LICENSE
!/package.json
!/dist/**/*
File renamed without changes.
2 changes: 1 addition & 1 deletion library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aikidosec/guard",
"version": "1.0.0",
"version": "0.0.0",
"description": "Aikido guard protects your application against NoSQL injections and more",
"keywords": [
"security",
Expand Down
7 changes: 4 additions & 3 deletions library/src/agent/Agent.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { hostname, platform, release } from "node:os";
import * as t from "tap";
import { ip } from "../helpers/ipAddress";
import { Agent } from "./Agent";
import { APIForTesting, Token } from "./API";
import { LoggerNoop } from "./Logger";
import { address } from "ip";

t.test("it sends started event", async (t) => {
const logger = new LoggerNoop();
Expand All @@ -23,13 +23,14 @@ t.test("it sends started event", async (t) => {
agent: {
dryMode: false,
hostname: hostname(),
version: "1.0.0",
ipAddress: address(),
version: "0.0.0",
ipAddress: ip(),
packages: {
mongodb: "4.0.0",
},
preventedPrototypePollution: false,
nodeEnv: "",
serverless: false,
os: {
name: platform(),
version: release(),
Expand Down
4 changes: 2 additions & 2 deletions library/src/agent/Agent.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { hostname, platform, release } from "node:os";
import { ip } from "../helpers/ipAddress";
import { API, AgentInfo, Token, Stats, Kind } from "./API";
import { Logger } from "./Logger";
import { Context } from "./Context";
import { resolve } from "path";
import { Source } from "./Source";
import { address } from "ip";

export class Agent {
private heartbeatIntervalInMS = 60 * 60 * 1000;
Expand Down Expand Up @@ -182,7 +182,7 @@ export class Agent {
dryMode: !this.block,
hostname: hostname() || "",
version: this.getAgentVersion(),
ipAddress: address() || "",
ipAddress: ip() || "",
packages: Object.keys(this.wrappedPackages).reduce(
(packages: Record<string, string>, pkg) => {
const details = this.wrappedPackages[pkg];
Expand Down
Loading

0 comments on commit 5fa2053

Please sign in to comment.