openstax_accounts 9.7.0 → 9.8.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: 57482982ec158c16ae7ad70aadbf9bda911cd56b27fa4bfdab86c74c6ce008b2
4
- data.tar.gz: fb98bd455ce7f4758d7a862305e83048b8809b1548d1bd87eaa596f433a8f820
3
+ metadata.gz: 3cd4aa7a22ea69ad3166b90650c73a63b0bcdf5b029bb6d1d3405d45c3769fdc
4
+ data.tar.gz: 4d0308a4b059dc5d4f81042995d930f60a571c44f6bdf432f9718b771f198b75
5
5
  SHA512:
6
- metadata.gz: c9a7247488af4a6a96bbb8bb81ead9ea2208efd896a0590a4767c2c7ba88913a8deec5ef9661b72ac15d66f0be489c5177c28c277c527f65e923c904b1bb3038
7
- data.tar.gz: aa45a18b1bc00ed0db4f6ab13ca85ea54dcb25be4a00dc356d202e3d00033cc8162b1c039e86f5a0c0b0932102c04e6cb657a830b20c2963b6a722c6adf0aa6c
6
+ metadata.gz: 9594b3dfa88ac6e1a79ab3c75e13a895eea7661827050c61f7573983a44696a69a29d0433dc23937a3ff18d745ec1e52e15dba01682be7d095ff2dcc5aaa62cd
7
+ data.tar.gz: d808626f78220265082eaac3855b4f47700c843d0e36564ff67e4e3e6194790fca1c9497aab2093ee1e8a8da8387f41603ee9ee9c2fdfe36caeaa7f247d04516
@@ -47,7 +47,7 @@ module OpenStax
47
47
 
48
48
  def profile
49
49
  # TODO: stub profile if stubbing is enabled
50
- redirect_to URI.join(configuration.openstax_accounts_url, '/profile').to_s
50
+ redirect_to URI.join(configuration.openstax_accounts_url, 'profile').to_s
51
51
  end
52
52
  end
53
53
  end
@@ -4,11 +4,11 @@ require 'omniauth-oauth2'
4
4
  module OmniAuth
5
5
  module Strategies
6
6
  class Openstax < OAuth2
7
- option :name, "openstax"
7
+ option :name, 'openstax'
8
8
 
9
9
  option :client_options, {
10
- site: "http://accounts.openstax.org",
11
- authorize_url: "/oauth/authorize"
10
+ authorize_url: 'oauth/authorize',
11
+ token_url: 'oauth/token'
12
12
  }
13
13
 
14
14
  uid { raw_info[:uuid] }
@@ -21,9 +21,8 @@ module OmniAuth
21
21
  extra { { raw_info: raw_info } }
22
22
 
23
23
  def raw_info
24
- @raw_info ||= access_token.get('/api/user.json').parsed.symbolize_keys
24
+ @raw_info ||= access_token.get('api/user.json').parsed.symbolize_keys
25
25
  end
26
-
27
26
  end
28
27
  end
29
28
  end
@@ -1,7 +1,6 @@
1
1
  module OpenStax
2
2
  module Accounts
3
3
  module Api
4
-
5
4
  DEFAULT_API_VERSION = :v1
6
5
 
7
6
  # Executes an OpenStax Accounts API request,
@@ -113,10 +112,11 @@ module OpenStax
113
112
  @client ||= OAuth2::Client.new(
114
113
  OpenStax::Accounts.configuration.openstax_application_id,
115
114
  OpenStax::Accounts.configuration.openstax_application_secret,
116
- site: OpenStax::Accounts.configuration.openstax_accounts_url
115
+ site: OpenStax::Accounts.configuration.openstax_accounts_url,
116
+ authorize_url: 'oauth/authorize',
117
+ token_url: 'oauth/token'
117
118
  )
118
119
  end
119
-
120
120
  end
121
121
  end
122
122
  end
@@ -6,8 +6,12 @@ module OpenStax
6
6
  attr_reader :openstax_accounts_url
7
7
 
8
8
  def openstax_accounts_url=(url)
9
- url.gsub!(/https|http/,'https') if !(url =~ /localhost/)
10
- url = url + "/" if url[url.size-1] != '/'
9
+ # Only localhost urls are allowed to not be https
10
+ url.sub!('http:', 'https:') unless url.start_with?('http://localhost')
11
+
12
+ # We use URL.join with this url and it needs to end in / to make relative paths work
13
+ url += '/' unless url.end_with?('/')
14
+
11
15
  @openstax_accounts_url = url
12
16
  end
13
17
 
@@ -100,7 +104,7 @@ module OpenStax
100
104
  end
101
105
 
102
106
  def default_logout_redirect_url
103
- URI.join(openstax_accounts_url, "logout").to_s
107
+ URI.join(openstax_accounts_url, 'logout').to_s
104
108
  end
105
109
 
106
110
  attr_writer :return_to_url_approver
@@ -114,7 +118,7 @@ module OpenStax
114
118
  def initialize
115
119
  @openstax_application_id = 'SET ME!'
116
120
  @openstax_application_secret = 'SET ME!'
117
- @openstax_accounts_url = 'https://accounts.openstax.org/'
121
+ @openstax_accounts_url = 'https://openstax.org/accounts'
118
122
  @enable_stubbing = true
119
123
  @logout_via = :get
120
124
  @default_errors_partial = 'openstax/accounts/shared/attention'
@@ -1,5 +1,5 @@
1
1
  module OpenStax
2
2
  module Accounts
3
- VERSION = '9.7.0'
3
+ VERSION = '9.8.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstax_accounts
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.7.0
4
+ version: 9.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JP Slavinsky
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-08 00:00:00.000000000 Z
11
+ date: 2021-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -378,7 +378,7 @@ files:
378
378
  homepage: http://github.com/openstax/accounts-rails
379
379
  licenses: []
380
380
  metadata: {}
381
- post_install_message:
381
+ post_install_message:
382
382
  rdoc_options: []
383
383
  require_paths:
384
384
  - lib
@@ -393,8 +393,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
393
393
  - !ruby/object:Gem::Version
394
394
  version: '0'
395
395
  requirements: []
396
- rubygems_version: 3.2.6
397
- signing_key:
396
+ rubygems_version: 3.1.4
397
+ signing_key:
398
398
  specification_version: 4
399
399
  summary: Rails common code and bindings for the 'accounts' API
400
400
  test_files: []