panda_pal 5.6.4 → 5.6.6
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/models/panda_pal/organization.rb +24 -2
 - data/app/models/panda_pal/platform.rb +10 -0
 - data/config/initializers/apartment.rb +7 -2
 - data/lib/panda_pal/engine.rb +6 -0
 - data/lib/panda_pal/helpers/session_replacement.rb +6 -6
 - data/lib/panda_pal/version.rb +1 -1
 - data/panda_pal.gemspec +6 -1
 - data/spec/dummy/log/test.log +5927 -0
 - metadata +40 -6
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: f26f3fbc4c1e8b6d4a9df00c1bd305e6e6a245d9b64202207253ee7c2231cb0c
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 1e494d23939e40ffdbfdb0bab260afd20aee43fe574071567e934ccf8b875555
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: d7efd606c09ea36fb252c2e38286884c8233c7428f9a12658ffd4cbf1645528f12539e4685bffbed3137398100fe2ca0fd239e4ebc2df3e693ecd10ff6194840
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: ddaa0fb914cd4411ddc9c3cc21a6b4992caf12b94bbb4c65a973c179018642817f9349c185e04e68b58267bbcace6cc6dba3396cc9cc2df6c2be0d5f2754c0d3
         
     | 
| 
         @@ -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 
     | 
    
         | 
| 
         @@ -96,10 +118,10 @@ module PandaPal 
     | 
|
| 
       96 
118 
     | 
    
         
             
                  (platform_org_extension_module&.instance_method(name) rescue nil) || super
         
     | 
| 
       97 
119 
     | 
    
         
             
                end
         
     | 
| 
       98 
120 
     | 
    
         | 
| 
       99 
     | 
    
         
            -
                def method_missing(method, *args, &block)
         
     | 
| 
      
 121 
     | 
    
         
            +
                def method_missing(method, *args, **kwargs, &block)
         
     | 
| 
       100 
122 
     | 
    
         
             
                  ext = platform_org_extension_module
         
     | 
| 
       101 
123 
     | 
    
         
             
                  if (ext.instance_method(method) rescue nil)
         
     | 
| 
       102 
     | 
    
         
            -
                    ext.instance_method(method).bind_call(self, *args, &block)
         
     | 
| 
      
 124 
     | 
    
         
            +
                    ext.instance_method(method).bind_call(self, *args, **kwargs, &block)
         
     | 
| 
       103 
125 
     | 
    
         
             
                  else
         
     | 
| 
       104 
126 
     | 
    
         
             
                    super
         
     | 
| 
       105 
127 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -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
         
     | 
    
        data/lib/panda_pal/engine.rb
    CHANGED
    
    | 
         @@ -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
         
     | 
| 
         @@ -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)
         
     | 
    
        data/lib/panda_pal/version.rb
    CHANGED
    
    
    
        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
         
     |