omniauth-uaa-oauth2 0.0.8 → 1.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cca254fbc2a4e6c9c7a4c954a9ea26f101d20a24ad0e5d036675d45e73ddd12e
4
- data.tar.gz: 9ef68fb73b96b82a8d36aa1e80bbb3569e361a91ca8e04cfe0118e793ba7a5bd
3
+ metadata.gz: 9e8de9c63b6c5f6302ff2188fcb99045128f8af146d6014c8a0e26403e23e7b0
4
+ data.tar.gz: 995fc9391a8e7c91d6464adc34565a825f7c6853877e4b1467326043e38aeb21
5
5
  SHA512:
6
- metadata.gz: 5d7aa40472f14f9ddef7dce728c1f07218ee7a275c118ce101ff0c4d98f59ecdfefa64480b930d026f6b67e441d81b2b3501026c3e4b591b1cef36859804938e
7
- data.tar.gz: 46abec421931388b7dba1d8ce92fa47869c05073ba190c5d9829cf0d295e66de269a011998e43917f5001471595f48df6915651c2b58330a5f89ca1fc39071c6
6
+ metadata.gz: 85a906769d31270b17cf11c0ee1c9f2f905ff7fe2d36d7024a522ffb3d2da756714854f8e3ff71b237944ab11794dbf60161ca44d115986c8c05732a57a3ae0c
7
+ data.tar.gz: 88982fdba7d3fc827a892bf0fc3317e8261ce7fd1b2d0cd94c9c7730d8d6c9b157bbe6d2f88b1c2d1e82f99dc52fad7c67d0ae0d5767c0689e60162a2633a1b6
@@ -1,7 +1,12 @@
1
1
  language: ruby
2
2
 
3
- rvm:
4
- - 1.9.3
3
+ before_install:
4
+ - gem update
5
+ - gem install bundler
5
6
 
7
+ rvm:
8
+ - 2.3.7
9
+ - 2.4.4
10
+ - 2.5.1
6
11
 
7
12
 
data/README.md CHANGED
@@ -3,28 +3,18 @@ CloudFoundry UAA OmniAuth Strategy
3
3
 
4
4
  OmniAuth strategy for authenticating users using the CloudFoundry UAA server.
5
5
 
6
- Set up a local ruby environment (so sudo not required):
6
+ Add the following to your `Gemfile`:
7
7
 
8
- $ rvm use 1.9.2
8
+ ```text
9
+ gem 'omniauth-uaa-oauth2'
10
+ ```
9
11
 
10
- or
12
+ For example usage see:
11
13
 
12
- $ rbenv global 1.9.2-p180
14
+ * the `examples/config.ru` sample code
15
+ * https://github.com/starkandwayne/ultimate-guide-to-uaa-examples/tree/master/ruby/omniauth-login-only
16
+ * https://github.com/starkandwayne/ultimate-guide-to-uaa-examples/tree/master/ruby/omniauth-login-and-uaa-api-calls
17
+ * https://github.com/starkandwayne/ultimate-guide-to-uaa-examples/tree/master/ruby/resource-server-wrapper-ui
13
18
 
14
- see: https://rvm.io/ or http://rbenv.org/
15
-
16
- Build and install the cf-uaa-lib gem located at https://github.com/cloudfoundry/cf-uaa-lib
17
-
18
- Build the gem
19
-
20
- $ bundle install
21
- $ bundle exec gem build omniauth-uaa-oauth2.gemspec
22
-
23
- Install it
24
-
25
- $ gem install omniauth-uaa-oauth2-*.gem
26
-
27
-
28
- See the examples folder for details on how to use it.
29
19
 
30
20
  Warning: Unlike the omniauth-oauth2 gem, this gem does not support the oauth2 'state' security parameter.
@@ -19,7 +19,7 @@ class App < Sinatra::Base
19
19
  content_type 'application/json'
20
20
  request.env['omniauth.auth'].to_hash.to_json rescue "No Data"
21
21
  end
22
-
22
+
23
23
  get '/auth/failure' do
24
24
  content_type 'text/plain'
25
25
  request.env['omniauth.auth'].to_hash.inspect rescue "No Data"
@@ -35,6 +35,8 @@ module OmniAuth
35
35
  option :scope, nil
36
36
  option :async_calls, false
37
37
  option :skip_ssl_validation, false
38
+ option :ssl_ca_file, nil
39
+ option :ssl_cert_store, nil
38
40
 
39
41
  attr_accessor :access_token
40
42
  attr_reader :token_issuer
@@ -65,8 +67,10 @@ module OmniAuth
65
67
  options.client_id,
66
68
  options.client_secret,
67
69
  {
68
- :token_target => @token_server_url,
69
- :skip_ssl_validation => options.skip_ssl_validation
70
+ token_target: @token_server_url,
71
+ ssl_ca_file: options.ssl_ca_file,
72
+ ssl_cert_store: options.ssl_cert_store,
73
+ skip_ssl_validation: options.skip_ssl_validation
70
74
  })
71
75
  log :info, "Client: #{options.client_id} auth_server: #{@auth_server_url} token_server: #{@token_server_url}"
72
76
  @token_issuer.logger = OmniAuth.logger
@@ -78,7 +82,9 @@ module OmniAuth
78
82
  def uaa_info
79
83
  @uaa_info ||= CF::UAA::Info.new(
80
84
  @token_server_url,
81
- :skip_ssl_validation => options.skip_ssl_validation
85
+ ssl_ca_file: options.ssl_ca_file,
86
+ ssl_cert_store: options.ssl_cert_store,
87
+ skip_ssl_validation: options.skip_ssl_validation
82
88
  )
83
89
  end
84
90
 
@@ -131,10 +137,10 @@ module OmniAuth
131
137
 
132
138
  info do
133
139
  prune!({
134
- :name => raw_info["name"],
135
- :email => raw_info["email"],
136
- :first_name => raw_info["given_name"],
137
- :last_name => raw_info["family_name"]
140
+ name: raw_info["name"],
141
+ email: raw_info["email"],
142
+ first_name: raw_info["given_name"],
143
+ last_name: raw_info["family_name"]
138
144
  })
139
145
  end
140
146
 
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Cloudfoundry
3
- VERSION = "0.0.8"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
@@ -31,21 +31,21 @@ describe OmniAuth::Strategies::Cloudfoundry do
31
31
 
32
32
  describe 'set auth and token server' do
33
33
  it 'should set the right auth and token server' do
34
- @options = {:auth_server_url => 'https://login.cloudfoundry.com'}
34
+ @options = {auth_server_url: 'https://login.cloudfoundry.com'}
35
35
  subject.client
36
36
  subject.auth_server_url.should eq('https://login.cloudfoundry.com')
37
37
  subject.token_server_url.should eq('https://login.cloudfoundry.com')
38
38
  end
39
39
 
40
40
  it 'should set the right auth and token server if independently set' do
41
- @options = {:auth_server_url => 'https://login.cloudfoundry.com', :token_server_url => 'https://uaa.cloudfoundry.com'}
41
+ @options = {auth_server_url: 'https://login.cloudfoundry.com', token_server_url: 'https://uaa.cloudfoundry.com'}
42
42
  subject.client
43
43
  subject.auth_server_url.should eq('https://login.cloudfoundry.com')
44
44
  subject.token_server_url.should eq('https://uaa.cloudfoundry.com')
45
45
  end
46
46
 
47
47
  it 'should set the right auth and token server' do
48
- @options = {:auth_server_url => 'login.cloudfoundry.com'}
48
+ @options = {auth_server_url: 'login.cloudfoundry.com'}
49
49
  subject.client
50
50
  subject.auth_server_url.should eq('https://login.cloudfoundry.com')
51
51
  subject.token_server_url.should eq('https://login.cloudfoundry.com')
@@ -111,13 +111,13 @@ describe OmniAuth::Strategies::Cloudfoundry do
111
111
 
112
112
  describe 'set scopes' do
113
113
  it 'should set the right scopes if requested' do
114
- @options = {:auth_server_url => 'https://login.cloudfoundry.com', :token_server_url => 'https://uaa.cloudfoundry.com', :scope => "openid cloud_controller.read"}
114
+ @options = {auth_server_url: 'https://login.cloudfoundry.com', token_server_url: 'https://uaa.cloudfoundry.com', :scope => "openid cloud_controller.read"}
115
115
  subject.client
116
116
  subject.options[:scope].should eq("openid cloud_controller.read")
117
117
  end
118
118
 
119
119
  it 'should not set any scopes if not requested' do
120
- @options = {:auth_server_url => 'https://login.cloudfoundry.com', :token_server_url => 'https://uaa.cloudfoundry.com'}
120
+ @options = {auth_server_url: 'https://login.cloudfoundry.com', token_server_url: 'https://uaa.cloudfoundry.com'}
121
121
  subject.client
122
122
  subject.options[:scope].should eq(nil)
123
123
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-uaa-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel D'sa