dkim 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b79c96d0478fbf8b0034adf4e151e57eb0a54713
4
- data.tar.gz: 416192a1854051a5b7bb772746f6824e866daebc
2
+ SHA256:
3
+ metadata.gz: f9ac50ad199771571d27da93d35d17d404e6cf24b18642856b8d8e3574ecb7f9
4
+ data.tar.gz: 7d1248e2086cea45176e60867ac15c4de7eb39f8cd5767c04e682f406e7901eb
5
5
  SHA512:
6
- metadata.gz: 7420d356c4fbf3281d942a67647ad778d6ab84704a681b32d6b422aa57e01884dfd8b86cc0326a96972d2fe116825efa5fddde26d149f9c090c7cf03d7933d11
7
- data.tar.gz: 2d9edfbe6f3028af2aa4edfd92cb87b74aa4ae7dead5ae2b102cc53eff987f1a68b7f6175d2157ebb2b0f59b18164e10012a89d67c1aec2db2f1bd7e3baeeb80
6
+ metadata.gz: 0161d656b0d464c2dced244ce241077181700c42451178bb7e6ccc5af5d63790b993e15f0d7f4cec579830b9e52bbde1aafa80d7ee908ea3310fdaba821884e8
7
+ data.tar.gz: 9d6d1b6218d2fdf7e1a7935c72de032fe7db7f2178f257f3bfa9ebc2ae810dde46988416e6a40b711616b328b30f2762412b796b403459738f2aa534fdc811f8
@@ -0,0 +1,20 @@
1
+ name: Test
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ build:
7
+
8
+ runs-on: ubuntu-latest
9
+
10
+ steps:
11
+ - uses: actions/checkout@v1
12
+ - name: Set up Ruby 2.6
13
+ uses: actions/setup-ruby@v1
14
+ with:
15
+ ruby-version: 2.6.x
16
+ - name: Build and test with Rake
17
+ run: |
18
+ gem install bundler
19
+ bundle install --jobs 4 --retry 3
20
+ bundle exec rake
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # dkim Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ ## 1.1.0 (2021-12-05)
6
+ * Add support for DKIM expiration tag
7
+
8
+ ## 1.0.1 (2013-01-15)
9
+ * Fix Minitest
10
+ * Add support for identity, the "i=" tag
11
+ * Fix problem with `strip_field` in mail gem 2.7.0
12
+
3
13
  ## 1.0.0 (2013-01-15)
4
14
  * DKIM-Signature header is now prepended rather than appended
5
15
  * Headers are signed in the order they appear
data/README.md CHANGED
@@ -2,8 +2,6 @@ dkim
2
2
  ====
3
3
  A DKIM signing library in ruby.
4
4
 
5
- [![Build Status](https://secure.travis-ci.org/jhawthorn/dkim.png?branch=master)](http://travis-ci.org/jhawthorn/dkim)
6
-
7
5
  [Documentation](http://rubydoc.info/github/jhawthorn/dkim)
8
6
 
9
7
  Installation
@@ -96,7 +94,6 @@ Limitations
96
94
  * No support for the older Yahoo! DomainKeys standard ([RFC 4870](http://tools.ietf.org/html/rfc4870)) *(none planned)*
97
95
  * No support for specifying DKIM identity `i=` *(planned)*
98
96
  * No support for body length `l=` *(planned)*
99
- * No support for signature expiration `x=` *(planned)*
100
97
  * No support for copied header fields `z=` *(not immediately planned)*
101
98
 
102
99
  Resources
data/lib/dkim/options.rb CHANGED
@@ -21,6 +21,12 @@ module Dkim
21
21
  # @return [Time,#to_i] A Time object or seconds since the epoch
22
22
  define_option_method :time
23
23
 
24
+ # @attribute [rw]
25
+ # Signature expiration.
26
+ # This corresponds to the x= tag in the dkim header.
27
+ # @return [Time,#to_i] A Time object or seconds since the epoch
28
+ define_option_method :expire
29
+
24
30
  # @attribute [rw]
25
31
  # The signing algorithm for dkim. Valid values are 'rsa-sha1' and 'rsa-sha256' (default).
26
32
  # This corresponds to the a= tag in the dkim header.
@@ -63,6 +63,7 @@ module Dkim
63
63
  dkim_header['q'] = 'dns/txt'
64
64
  dkim_header['s'] = selector
65
65
  dkim_header['t'] = (time || Time.now).to_i
66
+ dkim_header['x'] = expire.to_i if expire
66
67
 
67
68
  # Add body hash and blank signature
68
69
  dkim_header['bh']= digest_alg.digest(canonical_body)
data/lib/dkim/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dkim
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -46,6 +46,19 @@ module Dkim
46
46
  assert_equal 't+dk4yxTI2ByZxxRzkwhZhM4WzTZjGWHiWnS2t4pg7oT7fAIlMrfihJ/CIvGmYqYv4lbq4LStHqHx9TmEgxrkjLevHtuqhxkN55xJ2vA2QzTzFi2fMDZ4fFqWy4QtvlLjBAhevG+LXpmjPYec1cyeMlHlPAthq5+RNi6NHErJiM=', dkim_header['b']
47
47
  end
48
48
 
49
+ def test_expire
50
+ options = {
51
+ :time => Time.at(1234567890),
52
+ :expire => Time.at(1234567990)
53
+ }
54
+ signed_mail = SignedMail.new(@mail, options)
55
+ dkim_header = signed_mail.dkim_header.list
56
+
57
+ assert_equal 1234567990, dkim_header['x']
58
+ assert_equal '2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8=', dkim_header['bh']
59
+ assert_equal 'dn2Y5rSXQNRBy904vwpvri6xcmlrwKDmDX4XtBgyABQw9jLTulgD/G61TeyqinwgaHiatQaYt4pnpzYQGMaCCg7MepkkpZAR4IggAnHo/qB4JRx5OYBslKCCwpeb70YOPdukVopEnaCoUfkCGJ5vvu3xXG1N+ajKWqYiZ0n4z+o=', dkim_header['b']
60
+ end
61
+
49
62
  def test_identity
50
63
  options = {
51
64
  :domain => 'example.org',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dkim
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Hawthorn
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-16 00:00:00.000000000 Z
11
+ date: 2021-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -74,8 +74,8 @@ executables:
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
+ - ".github/workflows/test.yml"
77
78
  - ".gitignore"
78
- - ".travis.yml"
79
79
  - Appraisals
80
80
  - CHANGELOG.md
81
81
  - Gemfile
@@ -113,7 +113,7 @@ files:
113
113
  homepage: https://github.com/jhawthorn/dkim
114
114
  licenses: []
115
115
  metadata: {}
116
- post_install_message:
116
+ post_install_message:
117
117
  rdoc_options: []
118
118
  require_paths:
119
119
  - lib
@@ -128,9 +128,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  - !ruby/object:Gem::Version
129
129
  version: '0'
130
130
  requirements: []
131
- rubyforge_project: dkim
132
- rubygems_version: 2.6.8
133
- signing_key:
131
+ rubygems_version: 3.1.4
132
+ signing_key:
134
133
  specification_version: 4
135
134
  summary: DKIM library in ruby
136
135
  test_files:
data/.travis.yml DELETED
@@ -1,10 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 1.9.3
4
- - 2.0.0
5
- - 2.1.0
6
- - 2.2.0
7
- - jruby-19mode
8
- gemfile:
9
- - gemfiles/mail_2.6.gemfile
10
- - gemfiles/mail_2.7.gemfile