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 +4 -4
- data/app/controllers/openstax/accounts/sessions_controller.rb +1 -1
- data/app/models/openstax/accounts/account.rb +2 -1
- data/lib/omniauth/strategies/openstax.rb +4 -5
- data/lib/openstax/accounts/api.rb +3 -3
- data/lib/openstax/accounts/configuration.rb +8 -4
- data/lib/openstax/accounts/version.rb +1 -1
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52fa7d9305c25705166caab1576b661a18a542e9a1482fa9e4677f8e076f6be1
|
4
|
+
data.tar.gz: a7069ffb3c2145b110b91188029fb3dc89c3622740c7157a3cfabe2a57b22c2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ca35029dd45866b05b0dca01e49f62968e3427f85ebf17f86d190ace2b27b2ba9d30f4bf3dffb2ae044583da661d7eabd2730eae2404595b67e8b7dc172edbe
|
7
|
+
data.tar.gz: 586b18d5e8508c99e3a0211fd6d20d17c93f27e25bef8828abbcc9d198b29b6433b2834b2bedc24d79e19cc0247bb68886e91efb68d2a4c19758ffb647288b04
|
@@ -4,11 +4,11 @@ require 'omniauth-oauth2'
|
|
4
4
|
module OmniAuth
|
5
5
|
module Strategies
|
6
6
|
class Openstax < OAuth2
|
7
|
-
option :name,
|
7
|
+
option :name, 'openstax'
|
8
8
|
|
9
9
|
option :client_options, {
|
10
|
-
|
11
|
-
|
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('
|
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
|
-
|
10
|
-
url
|
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,
|
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://
|
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'
|
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.
|
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:
|
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.
|
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: []
|