Skip to content

Commit

Permalink
Feature/MX blacklist validation layer (#147)
Browse files Browse the repository at this point in the history
* Added Truemail::Validate::MxBlacklist, tests
* Updated Truemail::Core, tests
* Updated Truemail::Configuration, tests
* Updated Truemail::Validator
* Updated Truemail::Validate::Smtp, tests
* Updated Truemail::Log::Serializer::Base, dependent tests
* Updated Truemail::Log::Serializer::ValidatorText, tests
* Updated gem development dependencies
* Updated gem documentation, changelog, version
  • Loading branch information
bestwebua authored Apr 28, 2021
1 parent 256b36c commit 76d3e21
Show file tree
Hide file tree
Showing 23 changed files with 413 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ checks:
plugins:
rubocop:
enabled: true
channel: rubocop-1-12
channel: rubocop-1-13

reek:
enabled: true
17 changes: 9 additions & 8 deletions .reek.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,19 @@ detectors:

UtilityFunction:
exclude:
- Truemail::Validate::Smtp::Request#compose_from
- Truemail::Validator#select_validation_type
- Truemail::Validate::Base#configuration
- Truemail::Validate::Mx#null_mx?
- Truemail::Validate::Mx#a_record
- Truemail::Audit::Base#verifier_domain
- Truemail::Configuration#domain_matcher
- Truemail::Configuration#logger_options
- Truemail::Configuration#match_regex?
- Truemail::Configuration#regex_by_method
- Truemail::Dns::Worker#nameserver_port
- Truemail::Log::Serializer::Base#errors
- Truemail::Log::Serializer::ValidatorBase#replace_invalid_chars
- Truemail::Dns::Worker#nameserver_port
- Truemail::Configuration#check_dns_settings
- Truemail::Validator#select_validation_type
- Truemail::Validator#constantize
- Truemail::Validate::Base#configuration
- Truemail::Validate::Mx#null_mx?
- Truemail::Validate::Mx#a_record
- Truemail::Validate::Smtp::Request#compose_from

ControlParameter:
exclude:
Expand Down
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,9 @@ Performance/RedundantEqualityComparisonBlock:
Performance/RedundantSplitRegexpArgument:
Enabled: true

Performance/MapCompact:
Enabled: true

RSpec/ExampleLength:
Enabled: false

Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,35 @@

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.4.0] - 2021.04.28

### Added

- Implemented `MxBlacklist` validation. This layer provides checking mail servers with predefined blacklisted IP addresses list and can be used as a part of DEA ([disposable email address](https://en.wikipedia.org/wiki/Disposable_email_address)) validations.

```ruby
Truemail.configure do |config|
# Optional parameter. With this option Truemail will filter out unwanted mx servers via
# predefined list of ip addresses. It can be used as a part of DEA (disposable email
# address) validations. It is equal to empty array by default.
config.blacklisted_mx_ip_addresses = ['1.1.1.1', '2.2.2.2']
end

```

- Added `Truemail::Validate::MxBlacklist`, tests

### Changed

- Updated `Truemail::Core`, tests
- Updated `Truemail::Configuration`, tests
- Updated `Truemail::Validator`
- Updated `Truemail::Validate::Smtp`, tests
- Updated `Truemail::Log::Serializer::Base`, dependent tests
- Updated `Truemail::Log::Serializer::ValidatorText`, tests
- Updated gem development dependencies
- Updated gem documentation, changelog, version

## [2.3.4] - 2021.04.16

### Fixed
Expand Down
20 changes: 10 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
truemail (2.3.4)
truemail (2.4.0)
simpleidn (~> 0.2.1)

GEM
Expand Down Expand Up @@ -54,7 +54,7 @@ GEM
public_suffix (4.0.6)
rainbow (3.0.0)
rake (13.0.3)
reek (6.0.3)
reek (6.0.4)
kwalify (~> 0.7.0)
parser (~> 3.0.0)
psych (~> 3.1)
Expand All @@ -74,7 +74,7 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.2)
rubocop (1.12.1)
rubocop (1.13.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
Expand All @@ -85,10 +85,10 @@ GEM
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.4.1)
parser (>= 2.7.1.5)
rubocop-performance (1.10.2)
rubocop (>= 0.90.0, < 2.0)
rubocop-performance (1.11.0)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rspec (2.2.0)
rubocop-rspec (2.3.0)
rubocop (~> 1.0)
rubocop-ast (>= 1.1.0)
ruby-progressbar (1.11.0)
Expand Down Expand Up @@ -129,11 +129,11 @@ DEPENDENCIES
overcommit (~> 0.57.0)
pry-byebug (~> 3.9)
rake (~> 13.0, >= 13.0.3)
reek (~> 6.0, >= 6.0.3)
reek (~> 6.0, >= 6.0.4)
rspec (~> 3.10)
rubocop (~> 1.12, >= 1.12.1)
rubocop-performance (~> 1.10, >= 1.10.2)
rubocop-rspec (~> 2.2)
rubocop (~> 1.13)
rubocop-performance (~> 1.11)
rubocop-rspec (~> 2.3)
simplecov (~> 0.17.1)
truemail!
truemail-rspec (~> 0.4)
Expand Down
Loading

0 comments on commit 76d3e21

Please sign in to comment.