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

burner_email_db

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

burner_email_db

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

Burner email DB

Gem Version Build Status

A very long list (119 261) of burner email domains, packaged for Ruby gems.

Sourse

Copied with much respect from Wes Bos’s repo.

Installation

Add this line to your application's Gemfile:

gem "burner_email_db"

Usage

Just list everything

BurnerEmailDB.domains #=> ["0-00.usa.cc", "0-180.com", ...]

ActiveModel validation

class User
  validates :email, exclusion: { in: BurnerEmailDB.domains }
end

ActiveModel validator

You could write a validator:

class BurnerEmailValidator < ActiveModel::EachValidator

  def validate_each(record, attribute_name, address)
    return if address.blank? # validate presence separately
    record.errors.add attribute_name, :disposable_email if disposable?(address)
  end

  private def disposable?(address)
    BurnerEmailDB.domains.any? { |burner_domain| address.include? burner_domain }
  end

end

Add translations:

---
ru:
  errors:
    messages:
      disposable_email: в сервисе одноразовых email-адресов

and then use it like so:

class User
  validates :email, presence: true, burner_email: true
end

Dry validation

WIP, I promise, Piotr!

FAQs

Package last updated on 08 Feb 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