@liberstudio/cloudflare-list 2.0.7 → 2.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,10 +29,7 @@ let AttacksService = class AttacksService {
29
29
  this.API_URL = `https://api.cloudflare.com/client/v4/accounts`;
30
30
  }
31
31
  async updateIpList(ip) {
32
- const apiToken = this.options.apiToken.trim();
33
- const accountId = this.options.accountId.trim();
34
- const listId = this.options.listId.trim();
35
- const comment = this.options.comment || "Auto-blocked";
32
+ const { accountId, listId, apiToken, comment } = this.options;
36
33
  const url = `${this.API_URL}/${accountId}/rules/lists/${listId}/items`;
37
34
  this.logger.error(`Aggiungo IP ${ip} alla lista Cloudflare`);
38
35
  const formattedIp = ip.includes("/") ? ip : `${ip}/32`;
@@ -57,7 +57,7 @@ let AttackLoggerMiddleware = class AttackLoggerMiddleware {
57
57
  if (res.statusCode === 404) {
58
58
  this.processSuspiciousRequest(req).catch((err) => {
59
59
  const msg = err instanceof Error ? err.message : "Unknown error";
60
- this.logger.error(`Errore nel processando attacco: ${msg}`);
60
+ this.logger.error(`Errore nel processando la richiesta verso Cloudflare: ${msg}`);
61
61
  });
62
62
  }
63
63
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liberstudio/cloudflare-list",
3
- "version": "2.0.7",
3
+ "version": "2.0.9",
4
4
  "description": "Modulo NestJS per gestione IP List Cloudflare",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",