openstax_accounts 9.0.5 → 9.5.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 +4 -4
- data/app/controllers/openstax/accounts/sessions_controller.rb +13 -10
- data/app/models/openstax/accounts/account.rb +2 -1
- data/app/representers/openstax/accounts/api/v1/account_representer.rb +6 -0
- data/app/routines/openstax/accounts/find_or_create_account.rb +4 -2
- data/db/migrate/18_add_grant_tutor_access_to_openstax_accounts_accounts.rb +5 -0
- data/lib/openstax/accounts/configuration.rb +12 -4
- data/lib/openstax/accounts/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48ae6fdbc68368694770f436f5a7a4e57dea39b18c93b2791308aace6b07a02a
|
4
|
+
data.tar.gz: bbfbe2609b86b3b216ad0a94c7bf41b7c6bc1b29ea65e4a99388288dfcc80f7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29b93ef99bbb0ee170f4619269e79dd94fd89634a328985d55a057b9f0c85980480fdf8bfe47d4e946fb9dfc42e3a91c7e087a1825b8067c7c4a68d27e56f70f
|
7
|
+
data.tar.gz: dd689a226b1f8c92be65d8543c917b35af81eafa9a90f9de3b718fc2cf7b14e4df0ed7f64aff883bc2cf2141bfe1122dffadb9841a7cf0b1df9147e7b419779c
|
@@ -10,8 +10,7 @@ module OpenStax
|
|
10
10
|
if configuration.enable_stubbing?
|
11
11
|
redirect_to dev_accounts_path
|
12
12
|
else
|
13
|
-
forwardable_params =
|
14
|
-
params.permit(*configuration.forwardable_login_param_keys.map(&:to_s)).to_h
|
13
|
+
forwardable_params = params.permit(*configuration.forwardable_login_params).to_h
|
15
14
|
redirect_to openstax_login_path(forwardable_params)
|
16
15
|
end
|
17
16
|
end
|
@@ -28,14 +27,18 @@ module OpenStax
|
|
28
27
|
end
|
29
28
|
|
30
29
|
def destroy
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
30
|
+
# if a handler is configured, let it handle everything
|
31
|
+
if configuration.logout_handler
|
32
|
+
configuration.logout_handler.call(self)
|
33
|
+
else
|
34
|
+
# Unless we are stubbing, we redirect to a configurable URL, which is normally
|
35
|
+
# (or at least eventually) the Accounts logout URL so that users can't sign back
|
36
|
+
# in automagically.
|
37
|
+
sign_out!
|
38
|
+
redirect_to configuration.enable_stubbing? ?
|
39
|
+
main_app.root_url :
|
40
|
+
configuration.logout_redirect_url(request)
|
41
|
+
end
|
39
42
|
end
|
40
43
|
|
41
44
|
def failure
|
@@ -117,6 +117,12 @@ module OpenStax
|
|
117
117
|
schema_info: {
|
118
118
|
description: 'Whether or not this is a Key Institutional Partner account'
|
119
119
|
}
|
120
|
+
|
121
|
+
property :grant_tutor_access,
|
122
|
+
type: :boolean,
|
123
|
+
schema_info: {
|
124
|
+
description: 'Whether or not the account should be granted Tutor access'
|
125
|
+
}
|
120
126
|
end
|
121
127
|
end
|
122
128
|
end
|
@@ -7,7 +7,8 @@ module OpenStax
|
|
7
7
|
|
8
8
|
def exec(email: nil, username: nil, password: nil, first_name: nil, last_name: nil,
|
9
9
|
full_name: nil, title: nil, salesforce_contact_id: nil, faculty_status: nil,
|
10
|
-
role: nil, school_type: nil, school_location: nil, is_kip: nil,
|
10
|
+
role: nil, school_type: nil, school_location: nil, is_kip: nil,
|
11
|
+
grant_tutor_access: nil, is_test: nil)
|
11
12
|
raise(
|
12
13
|
ArgumentError,
|
13
14
|
'You must specify either an email address or a username (and an optional password)'
|
@@ -24,7 +25,7 @@ module OpenStax
|
|
24
25
|
first_name: first_name, last_name: last_name, full_name: full_name,
|
25
26
|
salesforce_contact_id: salesforce_contact_id, faculty_status: faculty_status,
|
26
27
|
role: role, school_type: school_type, school_location: school_location,
|
27
|
-
is_kip: is_kip, is_test: is_test
|
28
|
+
is_kip: is_kip, grant_tutor_access: grant_tutor_access, is_test: is_test
|
28
29
|
)
|
29
30
|
fatal_error(code: :invalid_inputs) unless (200..202).include?(response.status)
|
30
31
|
|
@@ -49,6 +50,7 @@ module OpenStax
|
|
49
50
|
account.school_location = school_location || :unknown_school_location
|
50
51
|
account.support_identifier = support_identifier
|
51
52
|
account.is_kip = is_kip
|
53
|
+
account.grant_tutor_access = grant_tutor_access
|
52
54
|
account.is_test = is_test
|
53
55
|
end
|
54
56
|
|
@@ -53,16 +53,23 @@ module OpenStax
|
|
53
53
|
# If more would be returned, the result will be empty instead
|
54
54
|
attr_accessor :max_search_items
|
55
55
|
|
56
|
+
# logout_handler
|
57
|
+
# Handles logging out and redirecting user when they've requested logout
|
58
|
+
# if specified, the logout_redirect_url has no effect
|
59
|
+
attr_accessor :logout_handler
|
60
|
+
|
56
61
|
# logout_redirect_url
|
57
62
|
# A URL to redirect to after the app logs out, can be a string or a Proc.
|
58
63
|
# If a Proc (or lambda), it will be called with the logout request.
|
64
|
+
#
|
65
|
+
# Only used if the logout_handler above is not specified
|
59
66
|
# If this field is nil or if the Proc returns nil, the logout will redirect
|
60
67
|
# to the default Accounts logout URL.
|
61
68
|
attr_writer :logout_redirect_url
|
62
69
|
|
63
|
-
#
|
70
|
+
# forwardable_login_params
|
64
71
|
# Which params are forwarded on the accounts login path
|
65
|
-
attr_accessor :
|
72
|
+
attr_accessor :forwardable_login_params
|
66
73
|
|
67
74
|
# max_user_updates_per_request
|
68
75
|
# When the user profile sync operation is called, this parameter will limit
|
@@ -117,12 +124,13 @@ module OpenStax
|
|
117
124
|
@account_user_mapper = OpenStax::Accounts::DefaultAccountUserMapper
|
118
125
|
@min_search_characters = 3
|
119
126
|
@max_search_items = 10
|
127
|
+
@logout_handler = nil
|
120
128
|
@logout_redirect_url = nil
|
121
129
|
@return_to_url_approver = nil
|
122
|
-
@
|
130
|
+
@forwardable_login_params = [
|
123
131
|
:signup_at,
|
124
132
|
:go,
|
125
|
-
:
|
133
|
+
sp: {} # "signed payload"; "sp" to keep nested parameter names short.
|
126
134
|
]
|
127
135
|
@max_user_updates_per_request = 250
|
128
136
|
@sso_cookie_name = 'ox'
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openstax_accounts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.0
|
4
|
+
version: 9.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JP Slavinsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '5.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '5.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: omniauth
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -343,6 +343,7 @@ files:
|
|
343
343
|
- db/migrate/15_drop_accounts_groups.rb
|
344
344
|
- db/migrate/16_add_is_kip_to_openstax_accounts_accounts.rb
|
345
345
|
- db/migrate/17_add_school_location_to_openstax_accounts_accounts.rb
|
346
|
+
- db/migrate/18_add_grant_tutor_access_to_openstax_accounts_accounts.rb
|
346
347
|
- db/migrate/1_create_openstax_accounts_groups.rb
|
347
348
|
- db/migrate/2_create_openstax_accounts_group_members.rb
|
348
349
|
- db/migrate/3_create_openstax_accounts_group_owners.rb
|