Module: PandaPal

Defined in:
lib/panda_pal.rb,
lib/panda_pal/engine.rb,
lib/panda_pal/version.rb,
app/models/panda_pal/session.rb,
app/models/panda_pal/api_call.rb,
app/models/panda_pal/platform.rb,
app/models/panda_pal/organization.rb,
lib/panda_pal/helpers/misc_helper.rb,
app/lib/panda_pal/lti_jwt_validator.rb,
app/lib/panda_pal/launch_url_helpers.rb,
app/models/panda_pal/platform/canvas.rb,
lib/panda_pal/helpers/secure_headers.rb,
app/models/panda_pal/panda_pal_record.rb,
lib/panda_pal/helpers/console_helpers.rb,
app/controllers/panda_pal/lti_controller.rb,
app/helpers/panda_pal/application_helper.rb,
app/controllers/panda_pal/api_call_controller.rb,
app/controllers/panda_pal/lti_v1_p0_controller.rb,
app/controllers/panda_pal/lti_v1_p3_controller.rb,
app/controllers/panda_pal/application_controller.rb,
app/models/panda_pal/organization_concerns/task_scheduling.rb,
app/models/panda_pal/organization_concerns/task_scheduling.rb,
app/models/panda_pal/organization_concerns/tenant_handling.rb,
app/models/panda_pal/organization_concerns/settings_validation.rb,
app/models/panda_pal/organization_concerns/organization_builder.rb,
app/models/panda_pal/organization_concerns/multi_database_sharding.rb

Defined Under Namespace

Modules: ApplicationHelper, Concerns, ConsoleHelpers, Helpers, Jobs, LaunchUrlHelpers, MiscHelper, OrganizationConcerns, Plugins, SecureHeaders, SkipSymmetricEncAttrEncrypted, SpecHelper Classes: ApiCall, ApiCallController, ApplicationController, Engine, LtiController, LtiJwtValidator, LtiNavigationInUse, LtiV1P0Controller, LtiV1P3Controller, NotMounted, Organization, PandaPalRecord, Platform, Session, SettingsMarshaler

Constant Summary collapse

VERSION =
"5.12.5"
@@lti_navigation =
{}
@@lti_options =
{}
@@lti_properties =
{}
@@lti_environments =
{}
@@lti_custom_params =
{}
@@extensions =
{}
@@lti_private_key =
nil

Class Method Summary collapse

Class Method Details

.extensions_for(type) ⇒ Object



82
83
84
# File 'lib/panda_pal.rb', line 82

def self.extensions_for(type)
  (@@extensions[normalize_ext_type(type)] || []).uniq
end

.lti_custom_paramsObject



49
50
51
# File 'lib/panda_pal.rb', line 49

def self.lti_custom_params
  @@lti_custom_params.deep_dup
end

.lti_custom_params=(custom_params) ⇒ Object



45
46
47
# File 'lib/panda_pal.rb', line 45

def self.lti_custom_params=(custom_params)
  @@lti_custom_params = custom_params.with_indifferent_access
end

.lti_environmentsObject



41
42
43
# File 'lib/panda_pal.rb', line 41

def self.lti_environments
  @@lti_environments.deep_dup
end

.lti_environments=(lti_environments) ⇒ Object



37
38
39
# File 'lib/panda_pal.rb', line 37

def self.lti_environments=(lti_environments)
  @@lti_environments = lti_environments
end

.lti_optionsObject



25
26
27
# File 'lib/panda_pal.rb', line 25

def self.lti_options
  @@lti_options.deep_dup
end

.lti_options=(lti_options) ⇒ Object



21
22
23
# File 'lib/panda_pal.rb', line 21

def self.lti_options= lti_options
  @@lti_options = lti_options
end

.lti_pathsObject



58
59
60
# File 'lib/panda_pal.rb', line 58

def self.lti_paths
  @@lti_navigation.deep_dup
end

.lti_private_keyObject



62
63
64
65
66
67
68
69
70
# File 'lib/panda_pal.rb', line 62

def self.lti_private_key
  key = @@lti_private_key.presence
  key ||= ENV['LTI_PRIVATE_KEY'].presence
  key ||= File.read(File.join( File.dirname(__FILE__), "../config/dev_lti_key.key")) if Rails.env.development?
  return nil unless key.present?

  key = OpenSSL::PKey::RSA.new(key) if key.is_a?(String)
  key
end

.lti_private_key=(v) ⇒ Object



72
73
74
# File 'lib/panda_pal.rb', line 72

def self.lti_private_key=(v)
  @@lti_private_key = k
end

.lti_propertiesObject



33
34
35
# File 'lib/panda_pal.rb', line 33

def self.lti_properties
  @@lti_properties.deep_dup
end

.lti_properties=(lti_properties) ⇒ Object



29
30
31
# File 'lib/panda_pal.rb', line 29

def self.lti_properties= lti_properties
  @@lti_properties = lti_properties
end

.register_extension(type, modul) ⇒ Object



76
77
78
79
80
# File 'lib/panda_pal.rb', line 76

def self.register_extension(type, modul)
  type = normalize_ext_type(type)
  @@extensions[type] ||= []
  @@extensions[type] << modul.to_s
end

.resolved_extensions_for(type) ⇒ Object



86
87
88
89
90
# File 'lib/panda_pal.rb', line 86

def self.resolved_extensions_for(type)
  extensions_for(type).map do |ext|
    ext.safe_constantize
  end.compact
end

.stage_navigation(navigation, options) ⇒ Object



53
54
55
56
# File 'lib/panda_pal.rb', line 53

def self.stage_navigation(navigation, options)
  @@lti_navigation[navigation] ||= {}
  @@lti_navigation[navigation].merge!(options)
end