coppertone 0.0.7 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +79 -0
  3. data/.codeclimate.yml +28 -0
  4. data/.github/dependabot.yml +7 -0
  5. data/.rubocop.yml +47 -6
  6. data/.travis.yml +2 -6
  7. data/Gemfile +12 -2
  8. data/LICENSE +21 -201
  9. data/Rakefile +12 -6
  10. data/coppertone.gemspec +9 -9
  11. data/lib/coppertone/class_builder.rb +2 -0
  12. data/lib/coppertone/directive.rb +6 -1
  13. data/lib/coppertone/domain_spec.rb +5 -1
  14. data/lib/coppertone/error.rb +5 -0
  15. data/lib/coppertone/ip_address_wrapper.rb +5 -1
  16. data/lib/coppertone/macro_context.rb +11 -4
  17. data/lib/coppertone/macro_string.rb +4 -2
  18. data/lib/coppertone/macro_string/macro_expand.rb +6 -2
  19. data/lib/coppertone/macro_string/macro_literal.rb +1 -0
  20. data/lib/coppertone/macro_string/macro_parser.rb +8 -4
  21. data/lib/coppertone/macro_string/macro_static_expand.rb +3 -1
  22. data/lib/coppertone/mechanism.rb +2 -0
  23. data/lib/coppertone/mechanism/all.rb +1 -0
  24. data/lib/coppertone/mechanism/cidr_parser.rb +3 -3
  25. data/lib/coppertone/mechanism/domain_spec_mechanism.rb +10 -3
  26. data/lib/coppertone/mechanism/domain_spec_optional.rb +1 -0
  27. data/lib/coppertone/mechanism/domain_spec_required.rb +1 -0
  28. data/lib/coppertone/mechanism/domain_spec_with_dual_cidr.rb +8 -1
  29. data/lib/coppertone/mechanism/include_matcher.rb +3 -0
  30. data/lib/coppertone/mechanism/ip_mechanism.rb +20 -10
  31. data/lib/coppertone/mechanism/mx.rb +1 -0
  32. data/lib/coppertone/modifier.rb +3 -1
  33. data/lib/coppertone/modifier/base.rb +7 -2
  34. data/lib/coppertone/modifier/exp.rb +6 -2
  35. data/lib/coppertone/modifier/redirect.rb +1 -0
  36. data/lib/coppertone/modifier/unknown.rb +1 -0
  37. data/lib/coppertone/null_macro_context.rb +1 -1
  38. data/lib/coppertone/qualifier.rb +1 -0
  39. data/lib/coppertone/record.rb +6 -2
  40. data/lib/coppertone/record_evaluator.rb +5 -0
  41. data/lib/coppertone/record_finder.rb +2 -2
  42. data/lib/coppertone/record_term_parser.rb +9 -5
  43. data/lib/coppertone/redirect_record_finder.rb +3 -1
  44. data/lib/coppertone/request.rb +26 -23
  45. data/lib/coppertone/request_context.rb +1 -0
  46. data/lib/coppertone/request_count_limiter.rb +2 -0
  47. data/lib/coppertone/result.rb +2 -1
  48. data/lib/coppertone/sender_identity.rb +2 -1
  49. data/lib/coppertone/term.rb +1 -0
  50. data/lib/coppertone/terms_parser.rb +3 -1
  51. data/lib/coppertone/utils/domain_utils.rb +21 -8
  52. data/lib/coppertone/utils/ip_in_domain_checker.rb +1 -1
  53. data/lib/coppertone/utils/validated_domain_finder.rb +2 -1
  54. data/lib/coppertone/version.rb +1 -1
  55. data/spec/domain_spec_spec.rb +1 -1
  56. data/spec/macro_string/macro_static_expand_spec.rb +2 -2
  57. data/spec/mechanism/ip4_spec.rb +3 -0
  58. data/spec/mechanism/ip6_spec.rb +3 -0
  59. data/spec/null_macro_context_spec.rb +1 -1
  60. data/spec/open_spf/Initial_processing_spec.rb +0 -2
  61. data/spec/open_spf/Semantics_of_exp_and_other_modifiers_spec.rb +0 -2
  62. data/spec/record_spec.rb +1 -1
  63. data/spec/spec_helper.rb +14 -3
  64. data/spec/term_spec.rb +1 -1
  65. data/spec/utils/domain_utils_spec.rb +10 -2
  66. metadata +34 -32
data/spec/term_spec.rb CHANGED
@@ -29,7 +29,7 @@ describe Coppertone::Term do
29
29
  token = SecureRandom.hex(10)
30
30
  expect(Coppertone::Directive)
31
31
  .to receive(:matching_term).with(token)
32
- .and_raise(Coppertone::Error)
32
+ .and_raise(Coppertone::Error)
33
33
  expect do
34
34
  Coppertone::Term.build_from_token(token)
35
35
  end.to raise_error(Coppertone::Error)
@@ -1,5 +1,3 @@
1
- # -- encoding : utf-8 --
2
-
3
1
  require 'spec_helper'
4
2
 
5
3
  describe Coppertone::Utils::DomainUtils do
@@ -27,6 +25,11 @@ describe Coppertone::Utils::DomainUtils do
27
25
  expect(subject.valid?('one')).to eq(false)
28
26
  end
29
27
 
28
+ it 'should reject domains with empty labels' do
29
+ expect(subject.valid?('.spf.example.com')).to eq(false)
30
+ expect(subject.valid?('spf..example.com')).to eq(false)
31
+ end
32
+
30
33
  it 'should handle IDNA domains' do
31
34
  expect(subject.valid?('清华大学.cn')).to eq(true)
32
35
  expect(subject.valid?('ジェーピーニック.jp')).to eq(true)
@@ -41,6 +44,11 @@ describe Coppertone::Utils::DomainUtils do
41
44
  expect(subject.valid?('abcd._domainkey.gmail.com')).to eq(true)
42
45
  end
43
46
 
47
+ it 'should reject wildcard domains while allowing interstitial asterisks' do
48
+ expect(subject.valid?('*.axb.longshot.com')).to eq(false)
49
+ expect(subject.valid?('rst.*.example.com')).to eq(true)
50
+ end
51
+
44
52
  it 'should reject IP addresses' do
45
53
  expect(subject.valid?('192.38.7.14')).to eq(false)
46
54
  end
metadata CHANGED
@@ -1,31 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coppertone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter M. Goldstein
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-18 00:00:00.000000000 Z
11
+ date: 2021-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: dns_adapter
14
+ name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '3.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '3.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: i18n
28
+ name: addressable
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: addressable
42
+ name: dns_adapter
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -53,19 +53,19 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: activesupport
56
+ name: i18n
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '3.0'
61
+ version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '3.0'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -81,56 +81,59 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: rake
84
+ name: flay
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '10.0'
89
+ version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '10.0'
96
+ version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: rspec
98
+ name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '3.0'
103
+ version: '13.0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '3.0'
110
+ version: '13.0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: rubocop
112
+ name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: '0'
117
+ version: '3.0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: '0'
124
+ version: '3.0'
125
125
  description: Coppertone includes tools for parsing SPF DNS records, evaluating the
126
126
  result of SPF checks for received emails, and creating appropriate email headers
127
127
  from SPF results.
128
128
  email:
129
- - peter.m.goldstein@gmail.com
129
+ - peter@valimail.com
130
130
  executables: []
131
131
  extensions: []
132
132
  extra_rdoc_files: []
133
133
  files:
134
+ - ".circleci/config.yml"
135
+ - ".codeclimate.yml"
136
+ - ".github/dependabot.yml"
134
137
  - ".gitignore"
135
138
  - ".rubocop.yml"
136
139
  - ".travis.yml"
@@ -247,11 +250,11 @@ files:
247
250
  - spec/utils/host_utils_spec.rb
248
251
  - spec/utils/ip_in_domain_checker_spec.rb
249
252
  - spec/utils/validated_domain_finder_spec.rb
250
- homepage: https://github.com/petergoldstein/coppertone
253
+ homepage: https://github.com/ValiMail/coppertone
251
254
  licenses:
252
- - Apache
255
+ - MIT
253
256
  metadata: {}
254
- post_install_message:
257
+ post_install_message:
255
258
  rdoc_options: []
256
259
  require_paths:
257
260
  - lib
@@ -259,16 +262,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
259
262
  requirements:
260
263
  - - ">="
261
264
  - !ruby/object:Gem::Version
262
- version: '0'
265
+ version: '2.7'
263
266
  required_rubygems_version: !ruby/object:Gem::Requirement
264
267
  requirements:
265
268
  - - ">="
266
269
  - !ruby/object:Gem::Version
267
270
  version: '0'
268
271
  requirements: []
269
- rubyforge_project:
270
- rubygems_version: 2.5.1
271
- signing_key:
272
+ rubygems_version: 3.2.8
273
+ signing_key:
272
274
  specification_version: 4
273
275
  summary: A Sender Policy Framework (SPF) toolkit
274
276
  test_files: