omniauth-cas 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/History.md ADDED
@@ -0,0 +1,37 @@
1
+
2
+ 0.0.5 / 2012-02-10
3
+ ==================
4
+
5
+ * Version bump to 0.0.5
6
+ * Refactored Pull Request #4 to make the CA Path configurable and added a test.
7
+ * Merge pull request #4 from dynaum/master
8
+ * Configuring ssl certs path for ubuntu
9
+ * Added chnage log
10
+ * Updated README
11
+
12
+ 0.0.4 / 2012-01-24
13
+ ==================
14
+
15
+ * Version bump to 0.0.4
16
+ * Fixed Issue #3 - Corrected some improperly placed URL-encoding.
17
+ * Added Gemnasium dependency monitor graphic
18
+ * Updated OmniAuth dependency to 1.0.2 to get rid of a Rack bug.
19
+ * Only CI the master branch.
20
+ * Removed a debugging RSpec tag.
21
+ * Removed extraneous whitespace
22
+ * Corrected some formatting issues with the README
23
+ * Small change to the README
24
+
25
+ 0.0.3 / 2012-01-12
26
+ ==================
27
+
28
+ * Version bump to 0.0.3
29
+ * Upgraded RSpec to 2.8
30
+ * Fixed #2 - Removed an undeclared dependency left in from debugging.
31
+
32
+ 0.0.2 / 2012-01-03
33
+ ==================
34
+
35
+ * Version bump to 0.0.2
36
+ * Fixed #1 - The return URL can now be explicitly set, falling back to the `referrer` if absent.
37
+ * Added some brief usage guidelines to the README
data/README.md CHANGED
@@ -3,17 +3,10 @@
3
3
  [travis]: http://travis-ci.org/dlindahl/omniauth-cas
4
4
  [gemnasium]: https://gemnasium.com/dlindahl/omniauth-cas
5
5
 
6
- A CAS Strategy for OmniAuth.
6
+ This is a OmniAuth 1.0 compatible port of the previously available
7
+ [OmniAuth CAS strategy][old_omniauth_cas] that was bundled with OmniAuth 0.3.
7
8
 
8
- I didn't really want to do this, but no one else has, so I might as well give it a stab.
9
-
10
- This is highly experimental, use at your own risk!
11
-
12
- Having said that, please let me know if you discover any problems or
13
- have any feature requests by opening an Issue on the GitHub page. I will try to address
14
- them as fast as I can.
15
-
16
- Thanks in advance for trying this out!
9
+ [View the documentation][document_up]
17
10
 
18
11
  ## Installation
19
12
 
@@ -34,7 +27,7 @@ Or install it yourself as:
34
27
  Use like any other OmniAuth strategy:
35
28
 
36
29
  Rails.application.config.middleware.use OmniAuth::Builder do
37
- provider :cas, :host => 'cas.yourdomain.com'
30
+ provider :cas, :host => 'cas.yourdomain.com'
38
31
  end
39
32
 
40
33
  OmniAuth CAS requires at least one of the following two configuration options:
@@ -50,6 +43,7 @@ Other configuration options:
50
43
  * `service_validate_url` - The URL to use to validate a user. Defaults to `'/serviceValidate'`
51
44
  * `logout_url` - The URL to use to logout a user. Defaults to `'/logout'`
52
45
  * `uid_key` - The user data attribute to use as your user's unique identifier. Defaults to `'user'` (which usually contains the user's login name)
46
+ * `ca_path` - Optional when `ssl` is `true`. Sets path of a CA certification directory. See [Net::HTTP][net_http] for more details
53
47
 
54
48
  ## Contributing
55
49
 
@@ -65,3 +59,6 @@ Special thanks go out to the following people
65
59
 
66
60
  * Phillip Aldridge (@iterateNZ) and JB Barth (@jbbarth) for helping out with Issue #3
67
61
 
62
+ [old_omniauth_cas]: https://github.com/intridea/omniauth/blob/0-3-stable/oa-enterprise/lib/omniauth/strategies/cas.rb
63
+ [document_up]: http://dlindahl.github.com/omniauth-cas/
64
+ [net_http]: http://ruby-doc.org/stdlib-1.9.3/libdoc/net/http/rdoc/Net/HTTP.html
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Cas
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -78,7 +78,10 @@ module OmniAuth
78
78
  result = ''
79
79
  http = Net::HTTP.new(@uri.host, @uri.port)
80
80
  http.use_ssl = @uri.port == 443 || @uri.instance_of?(URI::HTTPS)
81
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE if http.use_ssl? && @options.disable_ssl_verification?
81
+ if http.use_ssl?
82
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE if @options.disable_ssl_verification?
83
+ http.ca_path = @options.ca_path
84
+ end
82
85
  http.start do |c|
83
86
  response = c.get "#{@uri.path}?#{@uri.query}", VALIDATION_REQUEST_HEADERS.dup
84
87
  result = response.body
data/omniauth-cas.gemspec CHANGED
@@ -19,11 +19,12 @@ Gem::Specification.new do |gem|
19
19
  gem.add_dependency 'nokogiri', '~> 1.5'
20
20
  gem.add_dependency 'addressable', '~> 2.2'
21
21
 
22
- gem.add_development_dependency 'rake', '~> 0.9'
23
- gem.add_development_dependency 'webmock', '~> 1.7'
24
- gem.add_development_dependency 'simplecov', '~> 0.5.4'
25
- gem.add_development_dependency 'rspec', '~> 2.8'
26
- gem.add_development_dependency 'rack-test', '~> 0.6'
22
+ gem.add_development_dependency 'rake', '~> 0.9'
23
+ gem.add_development_dependency 'webmock', '~> 1.7'
24
+ gem.add_development_dependency 'simplecov', '~> 0.5.4'
25
+ gem.add_development_dependency 'rspec', '~> 2.8'
26
+ gem.add_development_dependency 'rack-test', '~> 0.6'
27
+ gem.add_development_dependency 'bourne', '~> 1.0'
27
28
 
28
29
  gem.add_development_dependency 'awesome_print'
29
30
 
@@ -0,0 +1,32 @@
1
+ require 'ostruct'
2
+ require 'awesome_print'
3
+ require File.expand_path( 'spec/spec_helper' )
4
+
5
+ describe OmniAuth::Strategies::CAS::ServiceTicketValidator do
6
+ let(:strategy_stub) do
7
+ stub('strategy stub',
8
+ :service_validate_url => "https://example.org/serviceValidate"
9
+ )
10
+ end
11
+
12
+ let(:provider_options) do
13
+ stub('provider options',
14
+ :disable_ssl_verification? => false,
15
+ :ca_path => '/etc/ssl/certsZOMG'
16
+ )
17
+ end
18
+
19
+ let(:validator) do
20
+ OmniAuth::Strategies::CAS::ServiceTicketValidator.new( strategy_stub, provider_options, "/foo", nil )
21
+ end
22
+
23
+ describe "#user_info" do
24
+ before do
25
+ stub_request(:get, "https://example.org/serviceValidate?").to_return(:status => 200, :body => '')
26
+ validator.user_info
27
+ end
28
+ it "should use the configured CA path" do
29
+ provider_options.should have_received(:ca_path)
30
+ end
31
+ end
32
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,9 +1,11 @@
1
1
  require 'bundler/setup'
2
+ require 'bourne'
2
3
 
3
4
  RSpec.configure do |c|
4
5
  c.filter_run :focus => true
5
6
  c.run_all_when_everything_filtered = true
6
7
  c.treat_symbols_as_metadata_keys_with_true_values = true
8
+ c.mock_with :mocha
7
9
  end
8
10
 
9
11
  require 'simplecov'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-cas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-24 00:00:00.000000000Z
12
+ date: 2012-02-11 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth
16
- requirement: &2156820900 !ruby/object:Gem::Requirement
16
+ requirement: &2152816500 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.0.2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2156820900
24
+ version_requirements: *2152816500
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: nokogiri
27
- requirement: &2156820400 !ruby/object:Gem::Requirement
27
+ requirement: &2152816000 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '1.5'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2156820400
35
+ version_requirements: *2152816000
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: addressable
38
- requirement: &2156819940 !ruby/object:Gem::Requirement
38
+ requirement: &2152815520 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '2.2'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2156819940
46
+ version_requirements: *2152815520
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &2156819480 !ruby/object:Gem::Requirement
49
+ requirement: &2152815060 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0.9'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2156819480
57
+ version_requirements: *2152815060
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: webmock
60
- requirement: &2156819020 !ruby/object:Gem::Requirement
60
+ requirement: &2152804240 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '1.7'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2156819020
68
+ version_requirements: *2152804240
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: simplecov
71
- requirement: &2156818560 !ruby/object:Gem::Requirement
71
+ requirement: &2152803740 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 0.5.4
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *2156818560
79
+ version_requirements: *2152803740
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rspec
82
- requirement: &2156818100 !ruby/object:Gem::Requirement
82
+ requirement: &2152803280 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '2.8'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *2156818100
90
+ version_requirements: *2152803280
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rack-test
93
- requirement: &2156817580 !ruby/object:Gem::Requirement
93
+ requirement: &2152802560 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,21 @@ dependencies:
98
98
  version: '0.6'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *2156817580
101
+ version_requirements: *2152802560
102
+ - !ruby/object:Gem::Dependency
103
+ name: bourne
104
+ requirement: &2152802080 !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: '1.0'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: *2152802080
102
113
  - !ruby/object:Gem::Dependency
103
114
  name: awesome_print
104
- requirement: &2156817160 !ruby/object:Gem::Requirement
115
+ requirement: &2152801700 !ruby/object:Gem::Requirement
105
116
  none: false
106
117
  requirements:
107
118
  - - ! '>='
@@ -109,7 +120,7 @@ dependencies:
109
120
  version: '0'
110
121
  type: :development
111
122
  prerelease: false
112
- version_requirements: *2156817160
123
+ version_requirements: *2152801700
113
124
  description:
114
125
  email:
115
126
  - dlindahl@customink.com
@@ -121,6 +132,7 @@ files:
121
132
  - .rvmrc
122
133
  - .travis.yml
123
134
  - Gemfile
135
+ - History.md
124
136
  - LICENSE
125
137
  - README.md
126
138
  - Rakefile
@@ -133,6 +145,7 @@ files:
133
145
  - omniauth-cas.gemspec
134
146
  - spec/fixtures/cas_failure.xml
135
147
  - spec/fixtures/cas_success.xml
148
+ - spec/omniauth/strategies/cas/service_ticket_validator_spec.rb
136
149
  - spec/omniauth/strategies/cas_spec.rb
137
150
  - spec/spec_helper.rb
138
151
  homepage: https://github.com/dlindahl/omniauth-cas
@@ -162,5 +175,6 @@ summary: CAS Strategy for OmniAuth
162
175
  test_files:
163
176
  - spec/fixtures/cas_failure.xml
164
177
  - spec/fixtures/cas_success.xml
178
+ - spec/omniauth/strategies/cas/service_ticket_validator_spec.rb
165
179
  - spec/omniauth/strategies/cas_spec.rb
166
180
  - spec/spec_helper.rb