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

@algolia/dns-filter

Package Overview
Dependencies
Maintainers
68
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@algolia/dns-filter

A small utility library to test whether requests try to access predefined IPs

  • 1.1.24
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
41
increased by32.26%
Maintainers
68
Weekly downloads
 
Created
Source

dns-filter

A small utility library to test whether requests try to access predefined IPs

WARNING This project is not an officially maintained Algolia project. This repository should not be used for any production project. Bug reports and feature requests will most likely be ignored.

Usage

const { validateURL, NetworkError, PRIVATE_IP_PREFIXES } = require('@algolia/dns-filter');

const restricted = process.env.NODE_ENV === 'development'
  ? [] // allow everything in dev
  : PRIVATE_IP_PREFIXES; // no private IPs otherwise

const url = 'http://localhost/admin';
try {
  await validateURL({
    url,
    ipPrefixes: restricted,
    context: { some: 'metadata' },
  });
}
catch (err) {
  log.error(err); // log error
  throw new NetworkError(); // throw generic error
}

Contributing

To release this package, wait for semantic-release to finish, then:

  • Make sure you're logged in with npm login
  • Run:
yarn build
yarn publish

FAQs

Package last updated on 02 Nov 2021

Did you know?

Socket

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.

Install

Related posts

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