omniauth-dice 0.1.9 → 0.2.0

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
  SHA1:
3
- metadata.gz: b5b9be999c98d047041bd0ea7f9dc2e155971838
4
- data.tar.gz: 859a4cb50fa183cb687af337b040c41e9b83d14d
3
+ metadata.gz: 7133e04ea14b309df8e8c0d57bc11e424fa537f7
4
+ data.tar.gz: dbc33b1b548e1e0ab3d2b34a704d0b1c13cc2bba
5
5
  SHA512:
6
- metadata.gz: d9a80350574e4f83156c9c051c7c41b110d9847a3d2170239d7a950d28aa1e334c2506e2f29ff8cc8dbd42d2f1ffd4726408358485700f84c74b408c0116be79
7
- data.tar.gz: 488acf3620615cf66e72431bff942f7bc1dc79b02a09ddec73e44a544bf431b14a14c189902f0cfe63a3f98e8c0dcbebb13022fb153c7f02e8648f649479e902
6
+ metadata.gz: ac8a4ad5542cee1c7ad5e4563d1b7aa3c1e550b622bbebcd3362dc7dd0750e3b20634fac2097997035c36ed40b9c5aca508be1611972c54dae4789873d94ba67
7
+ data.tar.gz: eedb52806258e18ffc7f648fe19b75dd8f5ac1c65b64a2d55a3e9083fd72622aee1d1fcc0627c02697eb1ef0fb249884fdb0acb9884a6d09cc2c62f08d93c36e
checksums.yaml.gz.sig CHANGED
@@ -1 +1 @@
1
- ��ns�������J*�g��E���CdGɀ��mT��Ä2M eF"�&�:���m�XUY�X�/~֊E�mG�<]�Y��n�����Irƛ.�W��::3�d�׀�UB�n��?�r���&"2��)��ރ�t�<�lT�])�t�o�0����U΄���BŦ�B+���&��M��>7�U�@�տE�N =�E���Z����I�s�K- ��0�c[��b��κ�����qw
1
+ �f��l(�C�`�]_7n�@f2t����5��!,�׷���s���#p���dy([��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
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Dice
3
- VERSION = '0.1.9'
3
+ VERSION = '0.2.0'
4
4
  end
5
5
  end
@@ -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.1.9
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-19 00:00:00.000000000 Z
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
@@ -1 +1,3 @@
1
- Dƹ����TIF���b�]��Fڰ�Y�k�ѩ���ʒ_3�A���ɵ�{��� ���$�I�b@(�*�څm8ߨ4�L}Z誕�j����*����BD���c&;a��y? j�� � �tk/lc���Y�w,���d�D�]��@��`�Ve�x�q@_t��)=$̵[��?����H%�
1
+ 8P��2 �|���Bߴ�<}�N�^Y�\x���җ��L����*�ٞ@824`�a��@�yE9��*�Uũ��}�TI
2
+ ���f�T�
3
+ �w���}{�