omniauth-dice 0.1.9 → 0.2.0
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 +4 -4
- checksums.yaml.gz.sig +1 -1
- data.tar.gz.sig +0 -0
- data/README.md +2 -0
- data/lib/omniauth/dice/version.rb +1 -1
- data/lib/omniauth/strategies/dice.rb +2 -1
- data/spec/omniauth/strategies/dice_integrations_spec.rb +22 -1
- metadata +2 -2
- metadata.gz.sig +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7133e04ea14b309df8e8c0d57bc11e424fa537f7
|
4
|
+
data.tar.gz: dbc33b1b548e1e0ab3d2b34a704d0b1c13cc2bba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac8a4ad5542cee1c7ad5e4563d1b7aa3c1e550b622bbebcd3362dc7dd0750e3b20634fac2097997035c36ed40b9c5aca508be1611972c54dae4789873d94ba67
|
7
|
+
data.tar.gz: eedb52806258e18ffc7f648fe19b75dd8f5ac1c65b64a2d55a3e9083fd72622aee1d1fcc0627c02697eb1ef0fb249884fdb0acb9884a6d09cc2c62f08d93c36e
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
��
|
1
|
+
�f��l(�C�`�]_7n�@f2t����5��!,����s���#p���d�y([��Z�ԑ��K��_����V�@yB]L����zS�(�?����2w��]�C� ���.#V�%����MWy���X�������#���Mn������Fՙ?�F2��S�5��ҘO�������EI��#�i�A�E�M�ɉ��9땨(��E�����R���h�B�˻��G��3��NR~O�\�T���d�n
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -63,6 +63,8 @@ Full configuration options are as follows:
|
|
63
63
|
|
64
64
|
* `cas_server` [String] Required base URL for CAS server
|
65
65
|
* `authentication_path` [String] URL path for endpoint, e.g. '/users'
|
66
|
+
* `use_callback_url` [Boolean] Use full URL vs path for callback endpoint
|
67
|
+
This is especially useful if your app runs as a sub-URI example.org/app_name
|
66
68
|
* `return_field` [String] Optional path to append after DN string
|
67
69
|
* `ssl_config` [Hash] Configuration hash for `Faraday` SSL options
|
68
70
|
* `format_header` [String] 'application/json', 'application/xml', etc
|
@@ -37,6 +37,7 @@ module OmniAuth
|
|
37
37
|
|
38
38
|
option :dnc_options, {}
|
39
39
|
option :cas_server, nil
|
40
|
+
option :use_callback_url, false
|
40
41
|
option :authentication_path, nil
|
41
42
|
option :return_field, 'info'
|
42
43
|
option :ssl_config, {}
|
@@ -82,7 +83,7 @@ module OmniAuth
|
|
82
83
|
log :debug, "Formatted issuer_dn: #{issuer_dn}"
|
83
84
|
set_session_dn(issuer_dn, 'issuer') if issuer_dn
|
84
85
|
|
85
|
-
redirect callback_path
|
86
|
+
redirect options.use_callback_url==true ? callback_url : callback_path
|
86
87
|
end
|
87
88
|
|
88
89
|
def callback_phase
|
@@ -62,7 +62,6 @@ describe OmniAuth::Strategies::Dice, type: :strategy do
|
|
62
62
|
self.app = Rack::Builder.app do
|
63
63
|
use Rack::Session::Cookie, :secret => '1337geeks'
|
64
64
|
use RackSessionAccess::Middleware
|
65
|
-
ap dice_options
|
66
65
|
use OmniAuth::Strategies::Dice, dice_options
|
67
66
|
run lambda{|env| [404, {'env' => env}, ["HELLO!"]]}
|
68
67
|
end
|
@@ -81,6 +80,28 @@ describe OmniAuth::Strategies::Dice, type: :strategy do
|
|
81
80
|
set_app!(defaults)
|
82
81
|
end
|
83
82
|
|
83
|
+
describe "use_callback_url" do
|
84
|
+
it "should use the callback_url method instead of callback_path when specified" do
|
85
|
+
callback_url_opts = {
|
86
|
+
cas_server: 'http://example.org',
|
87
|
+
authentication_path: '/dn',
|
88
|
+
use_callback_url: true
|
89
|
+
}
|
90
|
+
self.app = Rack::Builder.app do
|
91
|
+
use Rack::Session::Cookie, :secret => '1337geeks'
|
92
|
+
use RackSessionAccess::Middleware
|
93
|
+
use OmniAuth::Strategies::Dice, callback_url_opts
|
94
|
+
run lambda{|env| [404, {'env' => env}, ["HELLO!"]]}
|
95
|
+
end
|
96
|
+
header 'Ssl-Client-Cert', user_cert
|
97
|
+
get '/auth/dice'
|
98
|
+
expect(last_request.env['HTTP_SSL_CLIENT_CERT']).to eq(user_cert)
|
99
|
+
expect(last_request.url).to eq('http://example.org/auth/dice')
|
100
|
+
expect(last_request.env['rack.session']['omniauth.params']['user_dn']).to eq(user_dn.to_s)
|
101
|
+
expect(last_request.env['rack.session']['omniauth.params']['issuer_dn']).to eq(issuer_dn)
|
102
|
+
expect(last_response.location).to eq('http://example.org/auth/dice/callback')
|
103
|
+
end
|
104
|
+
end
|
84
105
|
|
85
106
|
describe '#request_phase' do
|
86
107
|
it 'should fail without a client DN' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-dice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Haddox
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
42qdwEXvvkODZAD6KAIXPdmbMfBgPbcd+B/4eUA0PyKo+4dgL1NuqX4MPWToevIZ
|
31
31
|
O8EKLF2X7NmC6FY1bOsSj/J8r1SOkx0rxgF+geRvY1P+hfNjDfxTsjU=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2015-02-
|
33
|
+
date: 2015-02-27 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: awesome_print
|
metadata.gz.sig
CHANGED