omniauth-shibboleth 1.0.5 → 1.0.6

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.
data/Gemfile CHANGED
@@ -2,6 +2,3 @@ source 'http://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- #group :example do
6
- # gem 'sinatra'
7
- #end
data/README.md CHANGED
@@ -86,11 +86,11 @@ To provide Shibboleth attributes via environment variables, we can not use proxy
86
86
 
87
87
  ### development mode
88
88
 
89
- When you deploy a new application, you may want to confirm the assumed attributes are correctly provided by Shibboleth SP. OmniAuth Shibboleth strategy provides a confirmation option :dev_mode. If you set :dev_mode true, you can see the environment variables provided at the /auth/shibboleth/callback uri.
89
+ When you deploy a new application, you may want to confirm the assumed attributes are correctly provided by Shibboleth SP. OmniAuth Shibboleth strategy provides a confirmation option :debug. If you set :debug true, you can see the environment variables provided at the /auth/shibboleth/callback uri.
90
90
 
91
91
  % vi config/initializer/omniauth.rb
92
92
  Rails.application.config.middleware.use OmniAuth::Builder do
93
- provider :shibboleth, { :dev_mode => true }
93
+ provider :shibboleth, { :debug => true }
94
94
  end
95
95
 
96
96
  ## License (MIT License)
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Shibboleth
3
- VERSION = "1.0.5"
3
+ VERSION = "1.0.6"
4
4
  end
5
5
  end
@@ -6,7 +6,7 @@ module OmniAuth
6
6
  option :uid_field, :eppn
7
7
  option :fields, [:name, :email]
8
8
  option :extra_fields, []
9
- option :dev_mode, false
9
+ option :debug, false
10
10
 
11
11
  def request_phase
12
12
  [
@@ -20,7 +20,7 @@ module OmniAuth
20
20
  end
21
21
 
22
22
  def callback_phase
23
- if options[:dev_mode]
23
+ if options[:debug]
24
24
  # dump attributes
25
25
  return [
26
26
  200,
@@ -4,6 +4,10 @@ require File.expand_path('../lib/omniauth-shibboleth/version', __FILE__)
4
4
  Gem::Specification.new do |gem|
5
5
  gem.add_dependency 'omniauth', '>= 1.0.0'
6
6
 
7
+ gem.add_development_dependency 'rack-test'
8
+ gem.add_development_dependency 'rake'
9
+ gem.add_development_dependency 'rspec', '~> 2.8'
10
+
7
11
  gem.authors = ["Toyokazu Akiyama"]
8
12
  gem.email = ["toyokazu@gmail.com"]
9
13
  gem.description = %q{OmniAuth Shibboleth strategies for OmniAuth 1.0}
@@ -15,4 +19,6 @@ Gem::Specification.new do |gem|
15
19
  gem.name = "omniauth-shibboleth"
16
20
  gem.require_paths = ["lib"]
17
21
  gem.version = OmniAuth::Shibboleth::VERSION
22
+
23
+
18
24
  end
@@ -9,6 +9,14 @@ def make_env(path = '/auth/shibboleth', props = {})
9
9
  }.merge(props)
10
10
  end
11
11
 
12
+ def failure_path
13
+ if OmniAuth::VERSION >= "1.0" && OmniAuth::VERSION < "1.1"
14
+ "/auth/failure?message=no_shibboleth_session"
15
+ elsif OmniAuth::VERSION >= "1.1"
16
+ "/auth/failure?message=no_shibboleth_session&strategy=shibboleth"
17
+ end
18
+ end
19
+
12
20
  describe OmniAuth::Strategies::Shibboleth do
13
21
  let(:app){ Rack::Builder.new do |b|
14
22
  b.use Rack::Session::Cookie
@@ -35,7 +43,7 @@ describe OmniAuth::Strategies::Shibboleth do
35
43
 
36
44
  it 'should fail to get Shib-Session-ID environment variable' do
37
45
  last_response.status.should == 302
38
- last_response.location.should == '/auth/failure?message=no_shibboleth_session'
46
+ last_response.location.should == failure_path
39
47
  end
40
48
  end
41
49
 
@@ -70,8 +78,8 @@ describe OmniAuth::Strategies::Shibboleth do
70
78
  end
71
79
  end
72
80
 
73
- context 'with dev_mode options' do
74
- let(:options){ { :dev_mode => true} }
81
+ context 'with debug options' do
82
+ let(:options){ { :debug => true} }
75
83
  let(:strategy){ OmniAuth::Strategies::Shibboleth.new(app, options) }
76
84
 
77
85
  it 'should raise environment variables' do
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'rspec'
2
2
  require 'rack/test'
3
3
  require 'omniauth'
4
+ require 'omniauth/version'
4
5
  require 'omniauth-shibboleth'
5
6
 
6
7
  RSpec.configure do |config|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-shibboleth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
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-05-03 00:00:00.000000000 Z
12
+ date: 2012-06-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth
16
- requirement: &70318358752680 !ruby/object:Gem::Requirement
16
+ requirement: &70308556621900 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,40 @@ dependencies:
21
21
  version: 1.0.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70318358752680
24
+ version_requirements: *70308556621900
25
+ - !ruby/object:Gem::Dependency
26
+ name: rack-test
27
+ requirement: &70308556621380 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *70308556621380
36
+ - !ruby/object:Gem::Dependency
37
+ name: rake
38
+ requirement: &70308556620600 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *70308556620600
47
+ - !ruby/object:Gem::Dependency
48
+ name: rspec
49
+ requirement: &70308556635620 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '2.8'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *70308556635620
25
58
  description: OmniAuth Shibboleth strategies for OmniAuth 1.0
26
59
  email:
27
60
  - toyokazu@gmail.com