omniauth-cas 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/History.md +14 -0
- data/README.md +8 -4
- data/lib/omniauth/cas/version.rb +1 -1
- data/lib/omniauth/strategies/cas.rb +6 -2
- data/omniauth-cas.gemspec +7 -7
- data/spec/omniauth/strategies/cas_spec.rb +2 -2
- data/spec/spec_helper.rb +5 -1
- metadata +27 -27
data/History.md
CHANGED
@@ -1,4 +1,18 @@
|
|
1
1
|
|
2
|
+
0.0.7 / 2012-05-04
|
3
|
+
==================
|
4
|
+
|
5
|
+
* Version bump to 0.0.7
|
6
|
+
* Updated RSpec
|
7
|
+
* Updated SimpleCov
|
8
|
+
* Updated WebMock
|
9
|
+
* Updated Bourne
|
10
|
+
* Updated OmniAuth to 1.1.0
|
11
|
+
* Added language hint for code example.
|
12
|
+
* Updated the Travis/Gemnasium status graphics to work better with DocumentUp.
|
13
|
+
* Wow... commit fail.
|
14
|
+
* Added History/Changelog
|
15
|
+
|
2
16
|
0.0.6 / 2012-03-07
|
3
17
|
==================
|
4
18
|
|
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
# OmniAuth CAS Strategy [![Build Status]
|
1
|
+
# OmniAuth CAS Strategy [![Build Status][travis_status]][travis] [![Dependency Status][gemnasium_status]][gemnasium]
|
2
2
|
|
3
3
|
[travis]: http://travis-ci.org/dlindahl/omniauth-cas
|
4
|
+
[travis_status]: https://secure.travis-ci.org/dlindahl/omniauth-cas.png
|
4
5
|
[gemnasium]: https://gemnasium.com/dlindahl/omniauth-cas
|
6
|
+
[gemnasium_status]: https://gemnasium.com/dlindahl/omniauth-cas.png?travis
|
5
7
|
|
6
8
|
This is a OmniAuth 1.0 compatible port of the previously available
|
7
9
|
[OmniAuth CAS strategy][old_omniauth_cas] that was bundled with OmniAuth 0.3.
|
@@ -26,9 +28,11 @@ Or install it yourself as:
|
|
26
28
|
|
27
29
|
Use like any other OmniAuth strategy:
|
28
30
|
|
29
|
-
|
30
|
-
|
31
|
-
|
31
|
+
```ruby
|
32
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
33
|
+
provider :cas, :host => 'cas.yourdomain.com'
|
34
|
+
end
|
35
|
+
```
|
32
36
|
|
33
37
|
OmniAuth CAS requires at least one of the following two configuration options:
|
34
38
|
|
data/lib/omniauth/cas/version.rb
CHANGED
@@ -6,6 +6,10 @@ module OmniAuth
|
|
6
6
|
class CAS
|
7
7
|
include OmniAuth::Strategy
|
8
8
|
|
9
|
+
# Custom Exceptions
|
10
|
+
class MissingCASTicket < StandardError; end
|
11
|
+
class InvalidCASTicket < StandardError; end
|
12
|
+
|
9
13
|
autoload :Configuration, 'omniauth/strategies/cas/configuration'
|
10
14
|
autoload :ServiceTicketValidator, 'omniauth/strategies/cas/service_ticket_validator'
|
11
15
|
|
@@ -58,11 +62,11 @@ module OmniAuth
|
|
58
62
|
def callback_phase
|
59
63
|
@ticket = request.params['ticket']
|
60
64
|
|
61
|
-
return fail!(:no_ticket, 'No CAS Ticket') unless @ticket
|
65
|
+
return fail!(:no_ticket, MissingCASTicket.new('No CAS Ticket')) unless @ticket
|
62
66
|
|
63
67
|
self.raw_info = ServiceTicketValidator.new(self, @options, callback_url, @ticket).user_info
|
64
68
|
|
65
|
-
return fail!(:invalid_ticket, 'Invalid CAS Ticket') if raw_info.empty?
|
69
|
+
return fail!(:invalid_ticket, InvalidCASTicket.new('Invalid CAS Ticket')) if raw_info.empty?
|
66
70
|
|
67
71
|
super
|
68
72
|
end
|
data/omniauth-cas.gemspec
CHANGED
@@ -15,16 +15,16 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = Omniauth::Cas::VERSION
|
17
17
|
|
18
|
-
gem.add_dependency 'omniauth',
|
19
|
-
gem.add_dependency 'nokogiri',
|
20
|
-
gem.add_dependency 'addressable',
|
18
|
+
gem.add_dependency 'omniauth', '~> 1.1.0'
|
19
|
+
gem.add_dependency 'nokogiri', '~> 1.5'
|
20
|
+
gem.add_dependency 'addressable', '~> 2.2'
|
21
21
|
|
22
22
|
gem.add_development_dependency 'rake', '~> 0.9'
|
23
|
-
gem.add_development_dependency 'webmock', '~> 1.8.
|
24
|
-
gem.add_development_dependency 'simplecov', '~> 0.6.
|
25
|
-
gem.add_development_dependency 'rspec', '~> 2.
|
23
|
+
gem.add_development_dependency 'webmock', '~> 1.8.6'
|
24
|
+
gem.add_development_dependency 'simplecov', '~> 0.6.2'
|
25
|
+
gem.add_development_dependency 'rspec', '~> 2.10'
|
26
26
|
gem.add_development_dependency 'rack-test', '~> 0.6'
|
27
|
-
gem.add_development_dependency 'bourne', '~> 1.1.
|
27
|
+
gem.add_development_dependency 'bourne', '~> 1.1.2'
|
28
28
|
|
29
29
|
gem.add_development_dependency 'awesome_print'
|
30
30
|
|
@@ -50,7 +50,7 @@ describe OmniAuth::Strategies::CAS, :type => :strategy do
|
|
50
50
|
|
51
51
|
it { should be_redirect }
|
52
52
|
it "should have a failure message" do
|
53
|
-
subject.headers['Location'].should == "/auth/failure?message=no_ticket"
|
53
|
+
subject.headers['Location'].should == "/auth/failure?message=no_ticket&strategy=cas"
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
@@ -65,7 +65,7 @@ describe OmniAuth::Strategies::CAS, :type => :strategy do
|
|
65
65
|
|
66
66
|
it { should be_redirect }
|
67
67
|
it 'should have a failure message' do
|
68
|
-
subject.headers['Location'].should == "/auth/failure?message=invalid_ticket"
|
68
|
+
subject.headers['Location'].should == "/auth/failure?message=invalid_ticket&strategy=cas"
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
data/spec/spec_helper.rb
CHANGED
@@ -2,7 +2,7 @@ require 'bundler/setup'
|
|
2
2
|
require 'bourne'
|
3
3
|
|
4
4
|
RSpec.configure do |c|
|
5
|
-
c.filter_run :
|
5
|
+
c.filter_run focus: true
|
6
6
|
c.run_all_when_everything_filtered = true
|
7
7
|
c.treat_symbols_as_metadata_keys_with_true_values = true
|
8
8
|
c.mock_with :mocha
|
@@ -12,5 +12,9 @@ require 'simplecov'
|
|
12
12
|
SimpleCov.start
|
13
13
|
|
14
14
|
require 'rack/test'
|
15
|
+
# TODO: Remove this.
|
16
|
+
# https://github.com/bblimke/webmock/issues/64
|
17
|
+
# https://github.com/bblimke/webmock/commit/9d255f118a6a39d297856fa83302aca1577b2c03#commitcomment-192888
|
18
|
+
require 'rspec/expectations'
|
15
19
|
require 'webmock/rspec'
|
16
20
|
require 'omniauth-cas'
|
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
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-04 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: omniauth
|
16
|
-
requirement: &
|
16
|
+
requirement: &2151833720 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.0
|
21
|
+
version: 1.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2151833720
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: nokogiri
|
27
|
-
requirement: &
|
27
|
+
requirement: &2151832920 !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: *
|
35
|
+
version_requirements: *2151832920
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: addressable
|
38
|
-
requirement: &
|
38
|
+
requirement: &2151832180 !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: *
|
46
|
+
version_requirements: *2151832180
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rake
|
49
|
-
requirement: &
|
49
|
+
requirement: &2151831280 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,43 +54,43 @@ dependencies:
|
|
54
54
|
version: '0.9'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2151831280
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: webmock
|
60
|
-
requirement: &
|
60
|
+
requirement: &2151830460 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version: 1.8.
|
65
|
+
version: 1.8.6
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2151830460
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: simplecov
|
71
|
-
requirement: &
|
71
|
+
requirement: &2151829660 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: 0.6.
|
76
|
+
version: 0.6.2
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *2151829660
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: rspec
|
82
|
-
requirement: &
|
82
|
+
requirement: &2151828800 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ~>
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version: '2.
|
87
|
+
version: '2.10'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *2151828800
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: rack-test
|
93
|
-
requirement: &
|
93
|
+
requirement: &2151828000 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ~>
|
@@ -98,21 +98,21 @@ dependencies:
|
|
98
98
|
version: '0.6'
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *2151828000
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: bourne
|
104
|
-
requirement: &
|
104
|
+
requirement: &2151826620 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ~>
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: 1.1.
|
109
|
+
version: 1.1.2
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *2151826620
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: awesome_print
|
115
|
-
requirement: &
|
115
|
+
requirement: &2151825020 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ! '>='
|
@@ -120,7 +120,7 @@ dependencies:
|
|
120
120
|
version: '0'
|
121
121
|
type: :development
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *2151825020
|
124
124
|
description:
|
125
125
|
email:
|
126
126
|
- dlindahl@customink.com
|