devise_auth_proxy 0.2.3 → 0.2.8

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: f9b679470b4f07671e47ce108c45270fc227b9bccdc78cd03ca8f1dec0e1bc07
4
- data.tar.gz: 3023d64dcc4bce3c1978eb7a3fff8de3cb313d335b45bccd9a22f3347623d760
3
+ metadata.gz: d8f11986745a856d57be7cea983b325df1e9977b3f996c5ab7eefe78ea05ebd0
4
+ data.tar.gz: d2d54324053ad81e52605882eb2ae1b4bd9327626f47d89d93abb9298e50c4df
5
5
  SHA512:
6
- metadata.gz: ff2a76fd427a71f5d0dc55332942b7b14f8e34acc0ad9131e5cc1f4a5cc44b83c61ccb6ed8acc69c4d70204e273a7057247c0a44dff9d91721116dce9d53137a
7
- data.tar.gz: 1121f852ae5d984edfc245f9121c1f5b01243397a9b373e61cc5ca74c427152fb0055c9b507780fefd8cda93d3bb2628418607cd004589572c95e000158344e2
6
+ metadata.gz: ae2733530dd470aaeb15c4c879037adb0aa617d262c1a558603b7d7d3275fefbcc0781fae01cc3130a1582d2476effbc86aaeeaa0eb898d2bc07e6c9edadcc27
7
+ data.tar.gz: a9b5b4793e420c1ede8f20b67abe8f361750508f29125021b50da3f0583949c47a1b348b6a2d26c7d31ba628071655bfb24f28ad9a97f81167c85bc5ff26fae3
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- devise_auth_proxy (0.2.3)
4
+ devise_auth_proxy (0.2.8)
5
5
  devise
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -32,6 +32,7 @@ Configuration options:
32
32
  * `auto_create` - Boolean (default: false). Whether to auto-create a local user from the proxy user attributes. Note: Also requires adding the Warden callbacks as shown below.
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
+ * `logout_service` - String. A service to handle logout session.
35
36
  * `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).
36
37
 
37
38
 
@@ -46,6 +47,7 @@ DeviseAuthProxy.configure do |config|
46
47
  config.auto_update = true
47
48
  config.attribute_map = { email: 'mail' }
48
49
  config.default_role = ['role_name / role_id']
50
+ config.logout_service = '<service name>'
49
51
  config.logout_url = "http://localhost:3000/logout"
50
52
  end
51
53
  ```
@@ -9,7 +9,7 @@ module DeviseAuthProxy
9
9
  unless DeviseAuthProxy.logout_service.nil?
10
10
  case DeviseAuthProxy.logout_service
11
11
  when 'foss_identity'
12
- Service::FossIdentity.logout(DeviseAuthProxy.logout_url, DeviseAuthProxy.http_cookie)
12
+ Service::FossIdentity.sign_out(DeviseAuthProxy.logout_url, DeviseAuthProxy.http_cookie)
13
13
  else
14
14
  # do nothing
15
15
  end
@@ -1,3 +1,3 @@
1
1
  module DeviseAuthProxy
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.8"
3
3
  end
@@ -3,11 +3,15 @@ require 'uri'
3
3
 
4
4
  module Service
5
5
  module FossIdentity
6
- def logout(path, cookie)
7
- Net::HTTP.post(
6
+ module_function
7
+
8
+ def sign_out(path, cookie)
9
+ resp = Net::HTTP.post(
8
10
  URI(path),
9
- "cookie" => cookie
11
+ nil,
12
+ "Cookie" => cookie
10
13
  )
14
+ resp
11
15
  end
12
16
  end
13
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.3
4
+ version: 0.2.8
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-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise