panda_pal 5.6.3 → 5.6.5

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: 79e31ac9d48be7e13d818cd57950034fa982726721bb9c451bac65ee3aaee702
4
- data.tar.gz: 1bf00f07eba7546e160b2ee268e3bbfd37fdd3dfdf339999e8f322c43ceb6780
3
+ metadata.gz: 93602adf64cc4da3ac738a5f4eb9ee536305486fa7ad6e5b5c4d9df418164003
4
+ data.tar.gz: c46d3210fae2f6268d5a0dc52c931aa263fd81b82e27ff6051cd313eee95b9d8
5
5
  SHA512:
6
- metadata.gz: 4dfa6dbf1aff76385844bb204aab7298d4096410df44cc2646643fe28bd2a2d54c9960f932c624544ee990218fc95022e27964c73b7604545fafa6618630fa0b
7
- data.tar.gz: 0a74434217765714b28247315515ba9c6c71931d367e96130d3ed51a4f334ce43c03d80a0bdb6dfeee27caeff98f36c857cd525e61ee294a36db88f2619e4e76
6
+ metadata.gz: e59bcdeb6a9e9b023da8a35dcd9752e3e3fdb52007596cbcd9e04b949883ef2d9a384aa558922ec2fbb71d35d6865ef0c6db6b0da1496f83b559624ed46da8e8
7
+ data.tar.gz: 06f649deb6bc36c5da5b95a7794ab5acd00b128de01a2b449b04a276e9e81cf18fc700341bcc89b505732ceb87705a991b69de4b3580e12bf493875983c7af89
@@ -1,7 +1,29 @@
1
1
  module PandaPal
2
2
  module OrganizationConcerns; end
3
3
 
4
+ # Nwer versions of SymmetricEncryption introduced it's own version of attr_encrypted
5
+ # that is completely incompatible with the attr_encrypted Gem that PandaPal uses.
6
+ if defined?(::SymmetricEncryption::ActiveRecord::AttrEncrypted)
7
+ module SkipSymmetricEncAttrEncrypted
8
+ extend ActiveSupport::Concern
9
+
10
+ module ::SymmetricEncryption::ActiveRecord::AttrEncrypted::ClassMethods
11
+ alias_method :panda_pal_se_attr_encrypted, :attr_encrypted
12
+
13
+ def attr_encrypted(*args, **kwargs)
14
+ if self <= SkipSymmetricEncAttrEncrypted
15
+ super
16
+ else
17
+ panda_pal_se_attr_encrypted(*args, **kwargs)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+
4
24
  class Organization < ActiveRecord::Base
25
+ include SkipSymmetricEncAttrEncrypted if defined?(SkipSymmetricEncAttrEncrypted)
26
+
5
27
  include OrganizationConcerns::SettingsValidation
6
28
  include OrganizationConcerns::TaskScheduling if defined?(Sidekiq.schedule)
7
29
 
@@ -8,6 +8,8 @@ require 'httparty'
8
8
  module PandaPal
9
9
  class Platform
10
10
  def public_jwks
11
+ require "json/jwt"
12
+
11
13
  response = HTTParty.get(jwks_url)
12
14
  return nil unless response.success?
13
15
 
@@ -161,6 +163,14 @@ module PandaPal
161
163
  ], self)
162
164
  end
163
165
 
166
+ def root_account_info
167
+ Rails.cache.fetch("panda_pal/org:#{name}/root_account_info", expires_in: 24.hours) do
168
+ response = bearcat_client.account("self")
169
+ response = bearcat_client.account(response[:root_account_id]) if response[:root_account_id].present?
170
+ response
171
+ end
172
+ end
173
+
164
174
  if defined?(Bearcat)
165
175
  def bearcat_client
166
176
  return canvas_sync_client if defined?(canvas_sync_client)
@@ -1,5 +1,10 @@
1
1
  require 'apartment/elevators/generic'
2
2
 
3
+ begin
4
+ require "apartment-sidekiq"
5
+ rescue LoadError
6
+ end
7
+
3
8
  Apartment.configure do |config|
4
9
  config.excluded_models ||= []
5
10
  config.excluded_models |= ['PandaPal::Organization', 'PandaPal::Session']
@@ -25,7 +30,7 @@ module PandaPal::Plugins::ApartmentCache
25
30
  "tenant:#{Apartment::Tenant.current}/#{super}"
26
31
  end
27
32
  else
28
- def namespaced_key(*args)
33
+ def namespaced_key(*args, **kwargs)
29
34
  "tenant:#{Apartment::Tenant.current}/#{super}"
30
35
  end
31
36
  end
@@ -66,7 +71,7 @@ if defined?(ActionCable)
66
71
  @tenant || 'public'
67
72
  end
68
73
 
69
- def dispatch_websocket_message(*args)
74
+ def dispatch_websocket_message(*args, **kwargs)
70
75
  Apartment::Tenant.switch(tenant) do
71
76
  super
72
77
  end
@@ -49,6 +49,12 @@ module PandaPal
49
49
  end
50
50
  end
51
51
 
52
+ initializer "panda_pal.serialze_symbols" do |app|
53
+ app.config.active_record.yaml_column_permitted_classes ||= []
54
+ app.config.active_record.yaml_column_permitted_classes |= [Symbol]
55
+ rescue
56
+ end
57
+
52
58
  initializer 'panda_pal.app_controller' do |app|
53
59
  OAUTH_10_SUPPORT = true
54
60
  ActiveSupport.on_load(:action_controller) do
@@ -60,7 +66,7 @@ module PandaPal
60
66
  ActionDispatch::Routing::Mapper.send :include, PandaPal::Helpers::RouteHelper
61
67
  end
62
68
 
63
- initializer 'panda_pal.route_options', after: :build_middleware_stack do |app|
69
+ config.after_initialize do |app|
64
70
  ActiveSupport.on_load(:action_controller) do
65
71
  Rails.application.reload_routes!
66
72
  PandaPal::validate_pandapal_config!
@@ -85,16 +85,16 @@ module PandaPal::Helpers
85
85
  # nicely with webpack-dev-server live reloading (otherwise
86
86
  # you get an access error everytime it tries to live reload).
87
87
 
88
- def redirect_with_session_to(*args)
89
- redirect_to url_with_session(*args)
88
+ def redirect_with_session_to(*args, **kwargs)
89
+ redirect_to url_with_session(*args, **kwargs)
90
90
  end
91
91
 
92
- def link_with_session_to(*args)
93
- helpers.link_to url_with_session(*args)
92
+ def link_with_session_to(*args, **kwargs)
93
+ helpers.link_to url_with_session(*args, **kwargs)
94
94
  end
95
95
 
96
- def session_url_for(*args)
97
- url_for(build_session_url_params(*args))
96
+ def session_url_for(*args, **kwargs)
97
+ url_for(build_session_url_params(*args, **kwargs))
98
98
  end
99
99
 
100
100
  def url_with_session(location, *args, route_context: self, **kwargs)
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = "5.6.3"
2
+ VERSION = "5.6.5"
3
3
  end
data/panda_pal.gemspec CHANGED
@@ -32,10 +32,15 @@ Gem::Specification.new do |s|
32
32
 
33
33
  s.add_development_dependency "rails", "~> 5.2"
34
34
  s.add_development_dependency 'pg'
35
- s.add_development_dependency 'sidekiq'
35
+ s.add_development_dependency 'sidekiq', "< 7.0"
36
36
  s.add_development_dependency 'sidekiq-scheduler'
37
37
  s.add_development_dependency 'ros-apartment', '~> 2.11'
38
38
  s.add_development_dependency 'ros-apartment-sidekiq', '~> 1.2'
39
39
  s.add_development_dependency 'rspec-rails'
40
40
  s.add_development_dependency 'factory_girl_rails'
41
+
42
+ s.add_development_dependency "redis", ">=4.2", "< 5.0"
43
+
44
+ # TODO See https://github.com/mikel/mail/issues/1489
45
+ s.add_development_dependency "mail", "2.7.1"
41
46
  end