authtrail 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff58207c013a0181500aea1886029896cae2af4fe0cf8dbf65bd1545e0637f4a
4
- data.tar.gz: f2b530b002daaa2ca52f2dbf471199e9fcfc13c04c9c821df139b9e6e909eecc
3
+ metadata.gz: 00a8cfabe2cfddb7349c055c13db2b56080409058ba48813310c6218a6b34fba
4
+ data.tar.gz: 59190df662382f672ad17c753d1eee6c0f8afacb68f7e082ed8766f188487d66
5
5
  SHA512:
6
- metadata.gz: 94ec2b6986bef058156630c1dccf900c366f1b9c2aaf84703c5372370dbf305af698c554c9e1b5f0ca64d144cd934c065499ac745c711a98d8dfe33c3138ed5b
7
- data.tar.gz: ae73465fd479199a31cabed9a87a6afdf6acca838de32c8b329f2da061709229046812584dfce1a9a8fdb4650834a5b2a4f2928ac7ea0d6e0cbf50da98e2c4c2
6
+ metadata.gz: c9137421c5e8f4c91be7dae62ccc9f12a831da6ae6fb390cfca766274045135c130f3cd9b0b5178d041be1348c527f39cc1aa0c986c798634e68300ee1c5a0a7
7
+ data.tar.gz: fa139b3a9df804feb52fa3823a67fb88781cefeda509d5719caf3f98c793e1aaaaecec553e8d1b1f08c03da8c4886b8e42400158e04aef12c34d404045b7b799
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.4.3 (2022-06-12)
2
+
3
+ - Updated install generator for Lockbox 1.0
4
+
1
5
  ## 0.4.2 (2021-12-13)
2
6
 
3
7
  - Added experimental support for Active Record encryption
data/README.md CHANGED
@@ -13,7 +13,7 @@ Track Devise login activity
13
13
  Add this line to your application’s Gemfile:
14
14
 
15
15
  ```ruby
16
- gem 'authtrail'
16
+ gem "authtrail"
17
17
  ```
18
18
 
19
19
  To encrypt email and IP addresses with Lockbox, install [Lockbox](https://github.com/ankane/lockbox) and [Blind Index](https://github.com/ankane/blind_index) and run:
@@ -23,7 +23,7 @@ rails generate authtrail:install --encryption=lockbox
23
23
  rails db:migrate
24
24
  ```
25
25
 
26
- To use Active Record encryption (Rails 7+, experimental, unreleased), run:
26
+ To use Active Record encryption (Rails 7+, experimental), run:
27
27
 
28
28
  ```sh
29
29
  rails generate authtrail:install --encryption=activerecord
@@ -118,7 +118,7 @@ AuthTrail uses [Geocoder](https://github.com/alexreisner/geocoder) for geocoding
118
118
  To enable geocoding, add this line to your application’s Gemfile:
119
119
 
120
120
  ```ruby
121
- gem 'geocoder'
121
+ gem "geocoder"
122
122
  ```
123
123
 
124
124
  And update `config/initializers/authtrail.rb`:
@@ -138,7 +138,7 @@ AuthTrail.job_queue = :low_priority
138
138
  For privacy and performance, we recommend geocoding locally. Add this line to your application’s Gemfile:
139
139
 
140
140
  ```ruby
141
- gem 'maxminddb'
141
+ gem "maxminddb"
142
142
  ```
143
143
 
144
144
  For city-level geocoding, download the [GeoLite2 City database](https://dev.maxmind.com/geoip/geoip2/geolite2/) and create `config/initializers/geocoder.rb` with:
@@ -221,7 +221,7 @@ There are two notable changes to geocoding:
221
221
  2. The `geocoder` gem is now an optional dependency. To use geocoding, add it to your Gemfile:
222
222
 
223
223
  ```ruby
224
- gem 'geocoder'
224
+ gem "geocoder"
225
225
  ```
226
226
 
227
227
  ### 0.2.0
@@ -1,3 +1,3 @@
1
1
  module AuthTrail
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
@@ -22,7 +22,7 @@ module Authtrail
22
22
  def generate_model
23
23
  case encryption
24
24
  when "lockbox"
25
- template "model_lockbox.rb", "app/models/login_activity.rb"
25
+ template "model_lockbox.rb", "app/models/login_activity.rb", lockbox_method: lockbox_method
26
26
  when "activerecord"
27
27
  template "model_activerecord.rb", "app/models/login_activity.rb"
28
28
  else
@@ -70,6 +70,14 @@ module Authtrail
70
70
  abort "Error: encryption must be lockbox, activerecord, or none"
71
71
  end
72
72
  end
73
+
74
+ def lockbox_method
75
+ if defined?(Lockbox::VERSION) && Lockbox::VERSION.to_i < 1
76
+ "encrypts"
77
+ else
78
+ "has_encrypted"
79
+ end
80
+ end
73
81
  end
74
82
  end
75
83
  end
@@ -1,7 +1,7 @@
1
1
  class LoginActivity < ApplicationRecord
2
2
  belongs_to :user, polymorphic: true, optional: true
3
3
 
4
- encrypts :identity, :ip
4
+ <%= lockbox_method %> :identity, :ip
5
5
  blind_index :identity, :ip
6
6
 
7
7
  before_save :reduce_precision
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authtrail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-14 00:00:00.000000000 Z
11
+ date: 2022-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  - !ruby/object:Gem::Version
92
92
  version: '0'
93
93
  requirements: []
94
- rubygems_version: 3.2.32
94
+ rubygems_version: 3.3.7
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: Track Devise login activity