Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core-http-utils): remove whitelist access log #2655

Merged
merged 1 commit into from
Jun 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion deprecated/core-json-rpc/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export const startServer = async options => {
plugin: plugins.whitelist,
options: {
whitelist: options.whitelist,
name: "JSON-RPC",
},
});
}
Expand Down
1 change: 0 additions & 1 deletion packages/core-api/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ export class Server {
plugin: plugins.whitelist,
options: {
whitelist: this.config.whitelist,
name: "Public API",
},
});

Expand Down
7 changes: 1 addition & 6 deletions packages/core-http-utils/src/plugins/whitelist.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { app } from "@arkecosystem/core-container";
import Boom from "@hapi/boom";
import nm from "nanomatch";

Expand All @@ -9,7 +8,7 @@ export const whitelist = {
server.ext({
type: "onRequest",
async method(request, h) {
const remoteAddress = request.info.remoteAddress;
const remoteAddress: string = request.info.remoteAddress;

if (Array.isArray(options.whitelist)) {
for (const ip of options.whitelist) {
Expand All @@ -23,10 +22,6 @@ export const whitelist = {
}
}

app.resolvePlugin("logger").warn(
`${remoteAddress} tried to access the ${options.name} without being whitelisted`,
);

return Boom.forbidden();
},
});
Expand Down
3 changes: 0 additions & 3 deletions packages/core-p2p/src/utils/is-whitelisted.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import nm from "nanomatch";

/**
* Check if the given IP address is whitelisted.
*/
export const isWhitelisted = (whitelist: string[], ip: string): boolean => {
if (Array.isArray(whitelist)) {
for (const item of whitelist) {
Expand Down
1 change: 0 additions & 1 deletion packages/core-webhooks/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export const startServer = async config => {
plugin: plugins.whitelist,
options: {
whitelist: config.whitelist,
name: "Webhook API",
},
});

Expand Down