omniauth-dice 0.2.0 → 0.2.1
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 +4 -1
- data.tar.gz.sig +1 -6
- data/README.md +2 -0
- data/lib/omniauth/dice/version.rb +1 -1
- data/lib/omniauth/strategies/dice.rb +14 -1
- data/spec/omniauth/strategies/dice_integrations_spec.rb +23 -0
- metadata +2 -2
- metadata.gz.sig +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 552059b078d15950580a1ab3d239785e072489bd
|
4
|
+
data.tar.gz: a219cf089244eb8e2fd89adcf162f67cca54c88a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b274db299621bedf763313c1199551ba53a8629979282c329662e71c2e02a19b6716581b4254dd03c91632360a9ca32123de266bf2f801377d603536495c67a
|
7
|
+
data.tar.gz: cd0e5841cd236925e43e4076cac60a407edeb2a7bdb6051e67a49569e4b20569a788c22f93a09a71e5838a3e381e86c1e437de2c7f5788fcc8352575c906e41e
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1,4 @@
|
|
1
|
-
�
|
1
|
+
G���Vs�Y��t
|
2
|
+
�����1T.���1pq|�\z[����o�YU�BA�
|
3
|
+
��ڬ�o>����M�\�r>���6�g��j���4�$����
|
4
|
+
��"������JM12�K�&���Dx��Z�@&���u��rS�*�Z]��,3h��I;y�6��P�@y{DzeZu���l�#�����pF9�����Z)�"�O�;�D1��A�3��5�@Qu���{,�a���ʍ�݊��.]֫� � p}w9F�Ȭb��&
|
data.tar.gz.sig
CHANGED
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
|
+
* `custom_callback_url` [String] Use a fully custom URL for callback endpoint
|
67
|
+
This option overrides the `use_callback_url` option setting!
|
66
68
|
* `use_callback_url` [Boolean] Use full URL vs path for callback endpoint
|
67
69
|
This is especially useful if your app runs as a sub-URI example.org/app_name
|
68
70
|
* `return_field` [String] Optional path to append after DN string
|
@@ -37,6 +37,7 @@ module OmniAuth
|
|
37
37
|
|
38
38
|
option :dnc_options, {}
|
39
39
|
option :cas_server, nil
|
40
|
+
option :custom_callback_url, nil
|
40
41
|
option :use_callback_url, false
|
41
42
|
option :authentication_path, nil
|
42
43
|
option :return_field, 'info'
|
@@ -83,7 +84,7 @@ module OmniAuth
|
|
83
84
|
log :debug, "Formatted issuer_dn: #{issuer_dn}"
|
84
85
|
set_session_dn(issuer_dn, 'issuer') if issuer_dn
|
85
86
|
|
86
|
-
|
87
|
+
redirect_for_callback
|
87
88
|
end
|
88
89
|
|
89
90
|
def callback_phase
|
@@ -128,6 +129,18 @@ module OmniAuth
|
|
128
129
|
info
|
129
130
|
end
|
130
131
|
|
132
|
+
def redirect_for_callback
|
133
|
+
if options.custom_callback_url
|
134
|
+
redirect options.custom_callback_url
|
135
|
+
else
|
136
|
+
if options.use_callback_url == true
|
137
|
+
redirect callback_url
|
138
|
+
else
|
139
|
+
redirect callback_path
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
131
144
|
private
|
132
145
|
|
133
146
|
# Change Hashie indifferent access keys back to symbols
|
@@ -103,6 +103,29 @@ describe OmniAuth::Strategies::Dice, type: :strategy do
|
|
103
103
|
end
|
104
104
|
end
|
105
105
|
|
106
|
+
describe "custom_callback_url" do
|
107
|
+
it "should use the custom_callback_url provided instead of default callback_path|url when specified" do
|
108
|
+
callback_url_opts = {
|
109
|
+
cas_server: 'http://example.org',
|
110
|
+
authentication_path: '/dn',
|
111
|
+
custom_callback_url: 'http://example.org/sub-uri/auth/dice/callback'
|
112
|
+
}
|
113
|
+
self.app = Rack::Builder.app do
|
114
|
+
use Rack::Session::Cookie, :secret => '1337geeks'
|
115
|
+
use RackSessionAccess::Middleware
|
116
|
+
use OmniAuth::Strategies::Dice, callback_url_opts
|
117
|
+
run lambda{|env| [404, {'env' => env}, ["HELLO!"]]}
|
118
|
+
end
|
119
|
+
header 'Ssl-Client-Cert', user_cert
|
120
|
+
get '/auth/dice'
|
121
|
+
expect(last_request.env['HTTP_SSL_CLIENT_CERT']).to eq(user_cert)
|
122
|
+
expect(last_request.url).to eq('http://example.org/auth/dice')
|
123
|
+
expect(last_request.env['rack.session']['omniauth.params']['user_dn']).to eq(user_dn.to_s)
|
124
|
+
expect(last_request.env['rack.session']['omniauth.params']['issuer_dn']).to eq(issuer_dn)
|
125
|
+
expect(last_response.location).to eq('http://example.org/sub-uri/auth/dice/callback')
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
106
129
|
describe '#request_phase' do
|
107
130
|
it 'should fail without a client DN' do
|
108
131
|
expect { get '/auth/dice' }.to raise_error(OmniAuth::Error, 'You need a valid DN to authenticate.')
|
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.2.
|
4
|
+
version: 0.2.1
|
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-
|
33
|
+
date: 2015-03-05 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: awesome_print
|
metadata.gz.sig
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
���
|
3
|
-
|
1
|
+
p�-���6���"�L~�:0��^
|
2
|
+
�r���� ��~1����m��[g�⡊�{X�qc�OV�`�"���y#�9)�W>�A�$g����ӡ�����Q�ߜ�� sM���^���_î���h.ПhT��+h0�c�d�R_r��Eٵ��PCl4m�E�r�c���{���Ϊ�t�CV��
|
3
|
+
O�Js͂��ޖ����B�V�C�L\9�����V��'��'��M����B�.��(��l2�ta�!�`S_�Q���e��
|