openstax_accounts 9.0.5 → 9.1.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: 52c5a3872725bd1198629d59c0660cdcc7f75d7bf09e32640deb56d772922477
4
- data.tar.gz: f48649499a41fa83f48ae34274cab542166bb61401d5edb3583c07f38c29c5bb
3
+ metadata.gz: 94c7f3a9d37b020069be2c39b96a1f7beacb918d50e87aa84d70fe24d437025c
4
+ data.tar.gz: 9a857efcee527418bd4287d6b8a61c369fa424541358de01b3dc41f1ae8e3aa7
5
5
  SHA512:
6
- metadata.gz: 5a266e70528d538b2dabf9722ec10e20423e5e7e47e86846019db502e5079276e216d18347985f20b22bbacfdaecd25e6263b0a38b7032289ed25cf2cbbde4ca
7
- data.tar.gz: ea546ef8e9fddb0d245ceeb8cbf6c9e4b9e0856eef81976c80b7f70ebac9b6aee3e1fcc56df1e7b9c9f708ca9178898173f5da7a46ce4e2191f25f4708eb960f
6
+ metadata.gz: 831790e591d38994596ff471d0828b773a8fd770253bf7040ed4c1106b2979e944b9a5ce5777cc89271c552cdb8fb50b7cfb239e316b1251713fe81f960e9237
7
+ data.tar.gz: fa14a2404033df1bc6131f6a1b91c134c98bda24d16af737f3442b52ea9b3de1c1933f463ac7c46060cef64fac02e73628990d936f35a7a0bdf1b93a99d6290c
@@ -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
@@ -34,7 +34,6 @@ module OpenStax
34
34
  account.faculty_status ||= :no_faculty_info
35
35
  account.role ||= :unknown_role
36
36
  account.school_type ||= :unknown_school_type
37
- account.school_location ||= :unknown_school_location
38
37
  end
39
38
 
40
39
  outputs.account.save if outputs.account.changed?
@@ -12,22 +12,14 @@ module OpenStax::Accounts
12
12
  :self_reported_role,
13
13
  :faculty_status,
14
14
  :school_type,
15
- :school_location,
16
15
  :salesforce_contact_id,
17
16
  :support_identifier,
18
- :is_test,
19
- :is_kip
17
+ :is_test
20
18
  ]
21
19
 
22
20
  attr_accessor :syncing
23
21
 
24
- enum faculty_status: [
25
- :no_faculty_info,
26
- :pending_faculty,
27
- :confirmed_faculty,
28
- :rejected_faculty
29
- ]
30
-
22
+ enum faculty_status: [:no_faculty_info, :pending_faculty, :confirmed_faculty, :rejected_faculty]
31
23
  enum role: [
32
24
  :unknown_role,
33
25
  :student,
@@ -39,23 +31,9 @@ module OpenStax::Accounts
39
31
  :adjunct,
40
32
  :homeschool
41
33
  ]
34
+ enum school_type: [:unknown_school_type, :other_school_type, :college]
42
35
 
43
- enum school_type: [
44
- :unknown_school_type,
45
- :other_school_type,
46
- :college,
47
- :high_school,
48
- :k12_school,
49
- :home_school
50
- ]
51
-
52
- enum school_location: [
53
- :unknown_school_location,
54
- :domestic_school,
55
- :foreign_school
56
- ]
57
-
58
- validates :faculty_status, :role, :school_type, :school_location, presence: true
36
+ validates :faculty_status, :role, :school_type, presence: true
59
37
 
60
38
  validates :uuid, presence: true, uniqueness: true
61
39
  validates :support_identifier, uniqueness: { allow_nil: true }
@@ -5,13 +5,13 @@ module OpenStax
5
5
  module Api
6
6
  module V1
7
7
  class AccountRepresenter < Roar::Decorator
8
+
8
9
  # This representer is used to communicate with Accounts
9
10
  # and so must allow read/write on all properties
10
11
  # Do not use it in create/update APIs!
11
12
 
12
- # This representer can be used directly or subclassed for an object that delegates
13
- # openstax_uid, username, first_name, last_name, full_name, title, faculty_status,
14
- # role, school_type, school_location and salesforce_contact_id to an account
13
+ # Otherwise, this representer can be used directly or subclassed
14
+ # for an object that delegates openstax_uid, username, first_name, last_name, full_name, # title, faculty_status, role, school_type and salesforce_contact_id to an account
15
15
 
16
16
  include Roar::JSON
17
17
 
@@ -86,37 +86,24 @@ module OpenStax
86
86
  }"
87
87
  }
88
88
 
89
- property :school_location,
90
- type: String,
91
- schema_info: {
92
- description: "One of #{
93
- OpenStax::Accounts::Account.school_locations.keys.map(&:to_s).inspect
94
- }"
95
- }
96
-
97
89
  property :uuid,
98
90
  type: String,
99
91
  schema_info: {
100
- description: 'The UUID as set by Accounts'
92
+ description: "The UUID as set by Accounts"
101
93
  }
102
94
 
103
95
  property :support_identifier,
104
96
  type: String,
105
97
  schema_info: {
106
- description: 'The support_identifier as set by Accounts'
98
+ description: "The support_identifier as set by Accounts"
107
99
  }
108
100
 
109
101
  property :is_test,
110
102
  type: :boolean,
111
103
  schema_info: {
112
- description: 'Whether or not this is a test account'
104
+ description: "Whether or not this is a test account"
113
105
  }
114
106
 
115
- property :is_kip,
116
- type: :boolean,
117
- schema_info: {
118
- description: 'Whether or not this is a Key Institutional Partner account'
119
- }
120
107
  end
121
108
  end
122
109
  end
@@ -32,8 +32,6 @@ module OpenStax
32
32
  role: inputs[:role] || :unknown_role,
33
33
  uuid: SecureRandom.uuid,
34
34
  support_identifier: "cs_#{SecureRandom.hex(4)}",
35
- school_type: inputs[:school_type] || :unknown_school_type,
36
- school_location: inputs[:school_location] || :unknown_school_location,
37
35
  is_test: true
38
36
  )
39
37
 
@@ -7,7 +7,7 @@ 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, is_test: nil)
10
+ role: nil, school_type: nil, is_test: nil)
11
11
  raise(
12
12
  ArgumentError,
13
13
  'You must specify either an email address or a username (and an optional password)'
@@ -23,8 +23,7 @@ module OpenStax
23
23
  email: email, username: username, password: password,
24
24
  first_name: first_name, last_name: last_name, full_name: full_name,
25
25
  salesforce_contact_id: salesforce_contact_id, faculty_status: faculty_status,
26
- role: role, school_type: school_type, school_location: school_location,
27
- is_kip: is_kip, is_test: is_test
26
+ role: role, school_type: school_type, is_test: is_test
28
27
  )
29
28
  fatal_error(code: :invalid_inputs) unless (200..202).include?(response.status)
30
29
 
@@ -46,9 +45,7 @@ module OpenStax
46
45
  account.faculty_status = faculty_status || :no_faculty_info
47
46
  account.role = role || :unknown_role
48
47
  account.school_type = school_type || :unknown_school_type
49
- account.school_location = school_location || :unknown_school_location
50
48
  account.support_identifier = support_identifier
51
- account.is_kip = is_kip
52
49
  account.is_test = is_test
53
50
  end
54
51
 
@@ -10,6 +10,7 @@ module OpenStax
10
10
  protected
11
11
 
12
12
  def exec(options={})
13
+
13
14
  return if OpenStax::Accounts.configuration.enable_stubbing?
14
15
 
15
16
  response = OpenStax::Accounts::Api.get_application_account_updates
@@ -60,9 +60,9 @@ module OpenStax
60
60
  # to the default Accounts logout URL.
61
61
  attr_writer :logout_redirect_url
62
62
 
63
- # forwardable_login_param_keys
63
+ # forwardable_login_params
64
64
  # Which params are forwarded on the accounts login path
65
- attr_accessor :forwardable_login_param_keys
65
+ attr_accessor :forwardable_login_params
66
66
 
67
67
  # max_user_updates_per_request
68
68
  # When the user profile sync operation is called, this parameter will limit
@@ -119,10 +119,10 @@ module OpenStax
119
119
  @max_search_items = 10
120
120
  @logout_redirect_url = nil
121
121
  @return_to_url_approver = nil
122
- @forwardable_login_param_keys = [
122
+ @forwardable_login_params = [
123
123
  :signup_at,
124
124
  :go,
125
- :sp # "signed payload"; "sp" for short to keep nested parameter names short
125
+ sp: {} # "signed payload"; "sp" to keep nested parameter names short.
126
126
  ]
127
127
  @max_user_updates_per_request = 250
128
128
  @sso_cookie_name = 'ox'
@@ -1,5 +1,5 @@
1
1
  module OpenStax
2
2
  module Accounts
3
- VERSION = '9.0.5'
3
+ VERSION = '9.1.0'
4
4
  end
5
5
  end
@@ -6,7 +6,6 @@ FactoryBot.define do
6
6
  faculty_status { OpenStax::Accounts::Account.faculty_statuses[:no_faculty_info] }
7
7
  role { OpenStax::Accounts::Account.roles[:unknown_role] }
8
8
  school_type { OpenStax::Accounts::Account.school_types[:unknown_school_type] }
9
- school_location { OpenStax::Accounts::Account.school_locations[:unknown_school_location] }
10
9
  uuid { SecureRandom.uuid }
11
10
  support_identifier { "cs_#{SecureRandom.hex(4)}" }
12
11
  is_test { true }
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.5
4
+ version: 9.1.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-05-29 00:00:00.000000000 Z
11
+ date: 2020-04-10 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: '6.0'
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: '6.0'
26
+ version: '5.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: omniauth
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -341,8 +341,6 @@ files:
341
341
  - db/migrate/13_add_school_type_to_accounts_accounts.rb
342
342
  - db/migrate/14_drop_openstax_uid_and_username_uniqueness.rb
343
343
  - db/migrate/15_drop_accounts_groups.rb
344
- - db/migrate/16_add_is_kip_to_openstax_accounts_accounts.rb
345
- - db/migrate/17_add_school_location_to_openstax_accounts_accounts.rb
346
344
  - db/migrate/1_create_openstax_accounts_groups.rb
347
345
  - db/migrate/2_create_openstax_accounts_group_members.rb
348
346
  - db/migrate/3_create_openstax_accounts_group_owners.rb
@@ -1,5 +0,0 @@
1
- class AddIsKipToOpenStaxAccountsAccounts < ActiveRecord::Migration[5.2]
2
- def change
3
- add_column :openstax_accounts_accounts, :is_kip, :boolean
4
- end
5
- end
@@ -1,5 +0,0 @@
1
- class AddSchoolLocationToOpenStaxAccountsAccounts < ActiveRecord::Migration[5.2]
2
- def change
3
- add_column :openstax_accounts_accounts, :school_location, :integer, default: 0, null: false
4
- end
5
- end