openstax_accounts 9.7.0 → 9.8.1

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
  SHA256:
3
- metadata.gz: 57482982ec158c16ae7ad70aadbf9bda911cd56b27fa4bfdab86c74c6ce008b2
4
- data.tar.gz: fb98bd455ce7f4758d7a862305e83048b8809b1548d1bd87eaa596f433a8f820
3
+ metadata.gz: 52fa7d9305c25705166caab1576b661a18a542e9a1482fa9e4677f8e076f6be1
4
+ data.tar.gz: a7069ffb3c2145b110b91188029fb3dc89c3622740c7157a3cfabe2a57b22c2e
5
5
  SHA512:
6
- metadata.gz: c9a7247488af4a6a96bbb8bb81ead9ea2208efd896a0590a4767c2c7ba88913a8deec5ef9661b72ac15d66f0be489c5177c28c277c527f65e923c904b1bb3038
7
- data.tar.gz: aa45a18b1bc00ed0db4f6ab13ca85ea54dcb25be4a00dc356d202e3d00033cc8162b1c039e86f5a0c0b0932102c04e6cb657a830b20c2963b6a722c6adf0aa6c
6
+ metadata.gz: 1ca35029dd45866b05b0dca01e49f62968e3427f85ebf17f86d190ace2b27b2ba9d30f4bf3dffb2ae044583da661d7eabd2730eae2404595b67e8b7dc172edbe
7
+ data.tar.gz: 586b18d5e8508c99e3a0211fd6d20d17c93f27e25bef8828abbcc9d198b29b6433b2834b2bedc24d79e19cc0247bb68886e91efb68d2a4c19758ffb647288b04
@@ -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
@@ -39,7 +39,8 @@ module OpenStax::Accounts
39
39
  :designer,
40
40
  :other,
41
41
  :adjunct,
42
- :homeschool
42
+ :homeschool,
43
+ :researcher
43
44
  ]
44
45
 
45
46
  enum school_type: [
@@ -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.1'
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.1
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: 2023-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -226,6 +226,20 @@ dependencies:
226
226
  - - ">="
227
227
  - !ruby/object:Gem::Version
228
228
  version: '0'
229
+ - !ruby/object:Gem::Dependency
230
+ name: multi_json
231
+ requirement: !ruby/object:Gem::Requirement
232
+ requirements:
233
+ - - ">="
234
+ - !ruby/object:Gem::Version
235
+ version: '0'
236
+ type: :development
237
+ prerelease: false
238
+ version_requirements: !ruby/object:Gem::Requirement
239
+ requirements:
240
+ - - ">="
241
+ - !ruby/object:Gem::Version
242
+ version: '0'
229
243
  - !ruby/object:Gem::Dependency
230
244
  name: shoulda-matchers
231
245
  requirement: !ruby/object:Gem::Requirement
@@ -378,7 +392,7 @@ files:
378
392
  homepage: http://github.com/openstax/accounts-rails
379
393
  licenses: []
380
394
  metadata: {}
381
- post_install_message:
395
+ post_install_message:
382
396
  rdoc_options: []
383
397
  require_paths:
384
398
  - lib
@@ -393,8 +407,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
393
407
  - !ruby/object:Gem::Version
394
408
  version: '0'
395
409
  requirements: []
396
- rubygems_version: 3.2.6
397
- signing_key:
410
+ rubygems_version: 3.1.6
411
+ signing_key:
398
412
  specification_version: 4
399
413
  summary: Rails common code and bindings for the 'accounts' API
400
414
  test_files: []