devise_auth_proxy 0.2.6 → 0.2.11

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: a7b8c06f1cfc1c095e593694745b2c94df0248d34636bf4a7a360dab88b374d3
4
- data.tar.gz: 76e606ebdc8fc7c8042058429769aeeb9100f6b8ab9b7898a30d8a867e3b10f9
3
+ metadata.gz: 76a08bfabfbd0b04ce4cb7fb4ae6b5d6cd53296b365158adc95e8eb7e7e33e47
4
+ data.tar.gz: c6c81ce74bd088e22066c409d6c94d26ddc0883d71b8ae920f6860569be43873
5
5
  SHA512:
6
- metadata.gz: 8c10add109b98d5f2a052b1aea8011f277cea8f07674454dc8c47fc3ae85038d2905b0f519397665c67f032e51d7e09916f8446e82eb5aae014d6424d93a35a2
7
- data.tar.gz: 65854419db6ccbc644c0bf456c5ea8a6f605ff3eda9a4be3b4269aaa3e79304fa93ae1cbad0846d7bb4f00789147b693d89030e772be988b2fe65b75b5cef4a9
6
+ metadata.gz: ae48cbc65b9423bb5da6fabd84910c98e89d13b25f420e185fd92777afd2a471b60f2196fbee00ec9fa84b3fda9b6738a8cf88c5129e1e0a2e87942f1259d520
7
+ data.tar.gz: 742e2d8f3a6f412781bd548e5f091766c019626d63dc6b665e0c1d30a9302054049237502d5e89cff8b459e43d3a660cbdc4399aabc2cbb4177f1bd1dbebee53
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- devise_auth_proxy (0.2.6)
4
+ devise_auth_proxy (0.2.11)
5
5
  devise
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -33,6 +33,7 @@ Configuration options:
33
33
  * `auto_update` - Boolean (default: false). Whether to auto-update authenticated user attributes from proxy user attributes.
34
34
  * `default_role` - List (default: []). A list of role default for new user. If your application integrate with CanCan of something like that.
35
35
  * `logout_service` - String. A service to handle logout session.
36
+ * `skip_session` - Boolean (default: false). To skip storage login session.
36
37
  * `logout_url` - String (default: '/'). For redirecting to a proxy user logout URL after signing out of the Rails application. Include DeviseAuthProxy::ControllerBehavior in your application controller to enable (by overriding Devise's after_sign_out_path_for).
37
38
 
38
39
 
@@ -48,6 +49,7 @@ DeviseAuthProxy.configure do |config|
48
49
  config.attribute_map = { email: 'mail' }
49
50
  config.default_role = ['role_name / role_id']
50
51
  config.logout_service = '<service name>'
52
+ config.skip_session = true
51
53
  config.logout_url = "http://localhost:3000/logout"
52
54
  end
53
55
  ```
@@ -5,7 +5,7 @@ module DeviseAuthProxy
5
5
  class << self
6
6
  attr_accessor :env_key, :auto_create, :auto_update, :auth_key,
7
7
  :attribute_map, :default_role, :logout_service, :logout_url,
8
- :http_cookie
8
+ :skip_session
9
9
  end
10
10
 
11
11
  # request.env key for remote user name
@@ -36,7 +36,8 @@ module DeviseAuthProxy
36
36
  # (it overrides Devise's after_sign_out_path_for method).
37
37
  self.logout_url = '/'
38
38
 
39
- self.http_cookie = nil
39
+ # To skip storage login session. Default is false.
40
+ self.skip_session = false
40
41
 
41
42
  def self.configure
42
43
  yield self
@@ -9,13 +9,14 @@ module DeviseAuthProxy
9
9
  unless DeviseAuthProxy.logout_service.nil?
10
10
  case DeviseAuthProxy.logout_service
11
11
  when 'foss_identity'
12
- Service::FossIdentity.sign_out(DeviseAuthProxy.logout_url, DeviseAuthProxy.http_cookie)
12
+ Service::FossIdentity.sign_out(DeviseAuthProxy.logout_url, self.request.env['HTTP_COOKIE'])
13
13
  else
14
14
  # do nothing
15
15
  end
16
16
  end
17
17
 
18
- return DeviseAuthProxy.logout_url if DeviseAuthProxy.logout_url
18
+ return self.request.env['HTTP_REFERER'] if self.request.env['HTTP_REFERER']
19
+
19
20
  super
20
21
  end
21
22
  end
@@ -13,11 +13,14 @@ module Devise
13
13
 
14
14
  return fail(:invalid) unless resource
15
15
 
16
- DeviseAuthProxy.http_cookie = env["HTTP_COOKIE"]
17
16
  # remember_me(resource)
18
17
  success!(resource)
19
18
  end
20
19
 
20
+ def store?
21
+ !DeviseAuthProxy.skip_session
22
+ end
23
+
21
24
  end
22
25
  end
23
26
  end
@@ -1,3 +1,3 @@
1
1
  module DeviseAuthProxy
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.11"
3
3
  end
@@ -6,11 +6,12 @@ module Service
6
6
  module_function
7
7
 
8
8
  def sign_out(path, cookie)
9
- Net::HTTP.post(
9
+ resp = Net::HTTP.post(
10
10
  URI(path),
11
11
  nil,
12
- "cookie" => cookie
12
+ "Cookie" => cookie
13
13
  )
14
+ resp
14
15
  end
15
16
  end
16
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_auth_proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - QuangTK
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-30 00:00:00.000000000 Z
11
+ date: 2020-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise