internet_security_event 1.0.0 → 1.0.1

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
2
  SHA256:
3
- metadata.gz: 4983418aad1987cf8bb74e94f9d472aa766977d301b9fd213cc500b3887edc1c
4
- data.tar.gz: d45b6627aca7593463b8c6d082311a4bd457642620263f36458a6556d301aae2
3
+ metadata.gz: 6028e31de34aca5377e011e84066b8ce6532cf406464edf4a8a67eb4e2230bec
4
+ data.tar.gz: 61198576708f2460fb9a21c682676b038917b150be82bcf36f1cc7c4888c4a42
5
5
  SHA512:
6
- metadata.gz: f746311b39c632eabebad17a08b91e89f6f89ae5f0b893cafdcce8be8364ce5bbde6176803f2dd47ff73a30ae7ac4156ba00767bcffea4640c8749821ab7728c
7
- data.tar.gz: d28ead27e04380af4131b97c6f5c18629cc0b165b94f6c07560f08138534671c405b780fb45f46a1c4ccff4fe8e8b0079e81259421e7c8320b7fe276f90a27a5
6
+ metadata.gz: c3949507e6194312a786461c1e335493d2f34f57d63546850164ae5305966743ca4a7637daf66fd4c9084351069f97f35a9f81e53dd1f6fe2d78b84c01b74409
7
+ data.tar.gz: ecfb68fb113d7846cb0e3278a000a12531f327661e933d09644174f7758ff2efed7ac088ef166446ae3dfe28b8db3851f8588ed34dec1318725813fef5ffb991
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.require_paths = ['lib']
25
25
 
26
26
  spec.add_dependency 'actionview', '~> 5.2'
27
+ spec.add_dependency 'activesupport', '~> 5.2'
27
28
 
28
29
  spec.add_development_dependency 'bundler'
29
30
  spec.add_development_dependency 'rake'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InternetSecurityEvent
4
- VERSION = '1.0.0'
4
+ VERSION = '1.0.1'
5
5
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'action_view'
4
4
  require 'action_view/helpers'
5
+ require 'active_support/core_ext/numeric/time'
5
6
 
6
7
  module InternetSecurityEvent
7
8
  class X509Status
@@ -59,7 +60,7 @@ module InternetSecurityEvent
59
60
  end
60
61
 
61
62
  def expired_or_expire_soon?
62
- now + 3600 * 24 * 2 > certificate.not_after
63
+ now + renewal_duration / 3 > certificate.not_after
63
64
  end
64
65
 
65
66
  def expired?
@@ -67,7 +68,15 @@ module InternetSecurityEvent
67
68
  end
68
69
 
69
70
  def expire_soonish?
70
- now + 3600 * 24 * 14 > certificate.not_after
71
+ now + 2 * renewal_duration / 3 > certificate.not_after
72
+ end
73
+
74
+ def renewal_duration
75
+ [validity_duration / 3, 90.days].min
76
+ end
77
+
78
+ def validity_duration
79
+ certificate.not_after - certificate.not_before
71
80
  end
72
81
 
73
82
  def now
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: internet_security_event
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Romain Tartière
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-16 00:00:00.000000000 Z
11
+ date: 2019-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '5.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: activesupport
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '5.2'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '5.2'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement