devise_masquerade 1.3.5 → 1.3.6

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: 02e2f123857132cfdeaf49b1dbb8cef1dce29175448f862dba6387e72087ebe2
4
- data.tar.gz: 451e8c53e1e84d565fd0fcb13439c0f3b75dd27a00fb112e0c2fd8976f67b00b
3
+ metadata.gz: 289316079ab661599906ee251d276b9151b6d7b43a47131ea3683d4305cb198a
4
+ data.tar.gz: fce111853661fbfe07cab2058aefa0ceb2bf1cd15830a3740dc9f293a2126a42
5
5
  SHA512:
6
- metadata.gz: 4f3ea1133abf1ae6126ce12e64fb118fa88e2627587f1e29833fb7805bd230cac706d7e4ab1f12848409cca824e670a131f8b4c3bb1e02e00a45337ab8071de0
7
- data.tar.gz: a281f8c5bcab7bde06ca043830ed98982e38c7e061a77be364768486caf7a5f10f85b35e5788c6334806a3b98a6010e8f4e1ee170a0baba88d05723429036287
6
+ metadata.gz: 6d812afb79fc6e55780d5fff58432c6070bd23b5ec57d88d8706b1ee09eaf4a314bb68803a6924e731866594ba8cf4caeade6d6050c7ba888af6bebfc2058cd9
7
+ data.tar.gz: f9002c0ba65f8a347f9ba3b4b2abc7aa363784e60c3b9c7e9d6071ca131fd5484c7aac664e7b5566030792243f093793702e6d26ee620117c8126bb3316f60b0
data/Gemfile.lock CHANGED
@@ -52,7 +52,7 @@ GIT
52
52
  PATH
53
53
  remote: .
54
54
  specs:
55
- devise_masquerade (1.3.5)
55
+ devise_masquerade (1.3.6)
56
56
  devise (>= 4.7.0)
57
57
  globalid (>= 0.3.6)
58
58
  railties (>= 5.2.0)
@@ -132,11 +132,10 @@ class Devise::MasqueradesController < DeviseController
132
132
  def save_masquerade_owner_session(masqueradable_resource)
133
133
  skey = session_key(masqueradable_resource)
134
134
 
135
- resource_gid = send("current_#{masquerading_resource_name}").to_sgid(
136
- expires_in: Devise.masquerade_expires_in, for: 'masquerade')
135
+ resource_gid = send("current_#{masquerading_resource_name}").to_sgid(for: 'masquerade')
137
136
 
138
137
  # skip sharing owner id via session
139
- Rails.cache.write(skey, resource_gid, expires_in: Devise.masquerade_expires_in)
138
+ Rails.cache.write(skey, resource_gid)
140
139
  session[skey] = true
141
140
  session[session_key_masquerading_resource_class] = masquerading_resource_class.name
142
141
  session[session_key_masqueraded_resource_class] = masqueraded_resource_class.name
@@ -0,0 +1,18 @@
1
+ Feature: Use back button for returning to the owner despite on expiration time.
2
+ In order to back to the owner user
3
+ As an masquerade user
4
+ I want to be able to press a simple button on the page
5
+
6
+ Scenario: Use back button
7
+ Given I logged in
8
+ And I have a user for masquerade
9
+
10
+ When I have devise masquerade expiration time in 1 second
11
+
12
+ When I am on the users page
13
+ And I login as one user
14
+ Then I should be login as this user
15
+ And I waited for 2 seconds
16
+
17
+ When I press back masquerade button
18
+ Then I should be login as owner user
@@ -0,0 +1,9 @@
1
+ When("I have devise masquerade expiration time in {int} second") do |seconds|
2
+ Devise.masquerade_expires_in = seconds.second
3
+ end
4
+
5
+ Then("I waited for {int} seconds") do |seconds|
6
+ sleep(seconds)
7
+
8
+ Devise.masquerade_expires_in = 5.minutes
9
+ end
@@ -1,3 +1,3 @@
1
1
  module DeviseMasquerade
2
- VERSION = '1.3.5'.freeze
2
+ VERSION = '1.3.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_masquerade
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.5
4
+ version: 1.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandr Korsak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-23 00:00:00.000000000 Z
11
+ date: 2021-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -92,9 +92,11 @@ files:
92
92
  - config/environment.rb
93
93
  - devise_masquerade.gemspec
94
94
  - features/back.feature
95
+ - features/expires_masquerade.feature
95
96
  - features/multiple_masquerading_models.feature
96
97
  - features/step_definitions/auth_steps.rb
97
98
  - features/step_definitions/back_steps.rb
99
+ - features/step_definitions/expires_steps.rb
98
100
  - features/step_definitions/url_helpers_steps.rb
99
101
  - features/support/env.rb
100
102
  - features/url_helpers.feature
@@ -185,9 +187,11 @@ specification_version: 4
185
187
  summary: use for login as functionallity on your admin users pages
186
188
  test_files:
187
189
  - features/back.feature
190
+ - features/expires_masquerade.feature
188
191
  - features/multiple_masquerading_models.feature
189
192
  - features/step_definitions/auth_steps.rb
190
193
  - features/step_definitions/back_steps.rb
194
+ - features/step_definitions/expires_steps.rb
191
195
  - features/step_definitions/url_helpers_steps.rb
192
196
  - features/support/env.rb
193
197
  - features/url_helpers.feature