omniauth-scalus-oauth2 1.0.1 → 1.0.2

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: 5a038498007dcbc8171616d47cf494e0e3c0142f
4
- data.tar.gz: e38a4e540c91f3c2f53b36d1e71dba5eea9795de
3
+ metadata.gz: f286c70cbe5b4e90b35970f4b247b86762936e29
4
+ data.tar.gz: 3305c25d847d8bd0004830cc1e5609c53efbdd77
5
5
  SHA512:
6
- metadata.gz: 5a8aa80ff17bd0706b4e11fa241b5a839ebbd3551b995bdd7aa20fa11f466235e11811b40562f3056e8edd0c002b5ad4609640744953ae810bfe24f0329b4a60
7
- data.tar.gz: 5a7cdc43446f91e7649c2d83aff2f5a8fc4ed539c202845227c9c7d12a580dfef78b73795b768f893234b96babf29382f75f7eb4be19c960756fddbd8a9b9ff3
6
+ metadata.gz: adc08cebe25975bafefb7ddcd2b4d01d96ccfac2be70c931e0bc8503b5810492461ad9843191ea9c3816af55e7c5ce7491b3a7714e7b35854511f7c110675321
7
+ data.tar.gz: 366d227b168699c9d6ddc81cc15ba3baaabece1fad495b052567241ad9e4fb611bb6b767528d63187a37e07eab36a6dd9b923aae3cbf9f8d11cf7f78b3dd23d9
data/README.md CHANGED
@@ -45,7 +45,7 @@ Here's an example *Authentication Hash* available in `request.env['omniauth.auth
45
45
  ```ruby
46
46
  {
47
47
  :provider => 'scalus',
48
- :uid => 'example.scalus.com',
48
+ :uid => 'example_slug.scalus.com', # example\_slug is the organization's subdomain
49
49
  :credentials => {
50
50
  :token => 'afasd923kjh0934kf', # OAuth 2.0 access_token, which you store and use to authenticate API requests
51
51
  }
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Scalus
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
@@ -10,8 +10,8 @@ module OmniAuth
10
10
  CODE_EXPIRES_AFTER = 10 * MINUTE
11
11
 
12
12
  option :client_options, {
13
- :authorize_url => '/admin/oauth/authorize',
14
- :token_url => '/admin/oauth/access_token'
13
+ :authorize_url => '/oauth2/authorize',
14
+ :token_url => '/oauth2/access_token'
15
15
  }
16
16
 
17
17
  option :callback_url
@@ -21,4 +21,6 @@ Gem::Specification.new do |s|
21
21
  s.add_development_dependency 'minitest', '~> 5.6'
22
22
  s.add_development_dependency 'fakeweb', '~> 1.3'
23
23
  s.add_development_dependency 'rake'
24
+ # s.add_development_dependency 'byebug'
25
+
24
26
  end
@@ -42,11 +42,11 @@ describe OmniAuth::Strategies::Scalus do
42
42
  end
43
43
 
44
44
  it 'has correct authorize url' do
45
- subject.client.options[:authorize_url].should eq('/admin/oauth/authorize')
45
+ subject.client.options[:authorize_url].should eq('/oauth2/authorize')
46
46
  end
47
47
 
48
48
  it 'has correct token url' do
49
- subject.client.options[:token_url].should eq('/admin/oauth/access_token')
49
+ subject.client.options[:token_url].should eq('/oauth2/access_token')
50
50
  end
51
51
  end
52
52
 
@@ -1,4 +1,5 @@
1
1
  require_relative 'test_helper'
2
+ # require 'byebug'
2
3
 
3
4
  class IntegrationTest < Minitest::Test
4
5
  def setup
@@ -13,7 +14,7 @@ class IntegrationTest < Minitest::Test
13
14
  def test_authorize
14
15
  response = authorize('snowdevil.scalus.com')
15
16
  assert_equal 302, response.status
16
- assert_match /\A#{Regexp.quote("https://snowdevil.scalus.com/admin/oauth/authorize?")}/, response.location
17
+ assert_match /\A#{Regexp.quote("https://snowdevil.scalus.com/oauth2/authorize?")}/, response.location
17
18
  redirect_params = Rack::Utils.parse_query(URI(response.location).query)
18
19
  assert_equal "123", redirect_params['client_id']
19
20
  assert_equal "https://app.example.com/auth/scalus/callback", redirect_params['redirect_uri']
@@ -27,7 +28,7 @@ class IntegrationTest < Minitest::Test
27
28
  }
28
29
 
29
30
  response = authorize('snowdevil.scalus.com')
30
- assert_match /\A#{Regexp.quote("https://snowdevil.scalus.com/admin/oauth/authorize?")}/, response.location
31
+ assert_match /\A#{Regexp.quote("https://snowdevil.scalus.com/oauth2/authorize?")}/, response.location
31
32
  end
32
33
 
33
34
  def test_site_validation
@@ -71,7 +72,7 @@ class IntegrationTest < Minitest::Test
71
72
  def test_callback_custom_params
72
73
  access_token = SecureRandom.hex(16)
73
74
  code = SecureRandom.hex(16)
74
- FakeWeb.register_uri(:post, "https://snowdevil.scalus.com/admin/oauth/access_token",
75
+ FakeWeb.register_uri(:post, "https://snowdevil.scalus.com/oauth2/access_token",
75
76
  body: JSON.dump(access_token: access_token),
76
77
  content_type: 'application/json')
77
78
 
@@ -121,7 +122,7 @@ class IntegrationTest < Minitest::Test
121
122
 
122
123
  def test_provider_options
123
124
  build_app scope: 'read_products,read_orders,write_content',
124
- callback_path: '/admin/auth/legacy/callback',
125
+ callback_path: '/auth/legacy/callback',
125
126
  scalus_domain: 'scalus.dev:3000',
126
127
  setup: lambda { |env|
127
128
  organization = Rack::Request.new(env).GET['organization']
@@ -131,15 +132,15 @@ class IntegrationTest < Minitest::Test
131
132
 
132
133
  response = authorize('snowdevil')
133
134
  assert_equal 302, response.status
134
- assert_match /\A#{Regexp.quote("https://snowdevil.scalus.dev:3000/admin/oauth/authorize?")}/, response.location
135
+ assert_match /\A#{Regexp.quote("https://snowdevil.scalus.dev:3000/oauth2/authorize?")}/, response.location
135
136
  redirect_params = Rack::Utils.parse_query(URI(response.location).query)
136
137
  assert_equal 'read_products,read_orders,write_content', redirect_params['scope']
137
- assert_equal 'https://app.example.com/admin/auth/legacy/callback', redirect_params['redirect_uri']
138
+ assert_equal 'https://app.example.com/auth/legacy/callback', redirect_params['redirect_uri']
138
139
  end
139
140
  def test_callback_with_invalid_state_fails
140
141
  access_token = SecureRandom.hex(16)
141
142
  code = SecureRandom.hex(16)
142
- FakeWeb.register_uri(:post, "https://snowdevil.scalus.com/admin/oauth/access_token",
143
+ FakeWeb.register_uri(:post, "https://snowdevil.scalus.com/oauth2/access_token",
143
144
  body: JSON.dump(access_token: access_token),
144
145
  content_type: 'application/json')
145
146
 
@@ -161,7 +162,7 @@ class IntegrationTest < Minitest::Test
161
162
  end
162
163
 
163
164
  def expect_access_token_request(access_token)
164
- FakeWeb.register_uri(:post, "https://snowdevil.scalus.com/admin/oauth/access_token",
165
+ FakeWeb.register_uri(:post, "https://snowdevil.scalus.com/oauth2/access_token",
165
166
  body: JSON.dump(access_token: access_token),
166
167
  content_type: 'application/json')
167
168
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-scalus-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Henner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-24 00:00:00.000000000 Z
11
+ date: 2015-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2