panda_pal 5.6.11 → 5.7.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/models/panda_pal/api_call.rb +1 -1
- data/app/models/panda_pal/organization.rb +73 -20
- data/app/models/panda_pal/organization_concerns/settings_validation.rb +6 -1
- data/app/models/panda_pal/organization_concerns/task_scheduling.rb +1 -1
- data/app/models/panda_pal/panda_pal_record.rb +5 -0
- data/app/models/panda_pal/platform/canvas.rb +4 -4
- data/app/models/panda_pal/platform.rb +5 -3
- data/app/models/panda_pal/session.rb +1 -1
- data/lib/panda_pal/engine.rb +83 -19
- data/lib/panda_pal/version.rb +1 -1
- data/spec/dummy/log/development.log +162 -0
- data/spec/dummy/log/test.log +39540 -0
- data/spec/models/panda_pal/organization_spec.rb +16 -0
- metadata +46 -43
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de960e9dd44bfec67832afe2e1cde116ea8a9e608f9658dea7cced1d45b1d934
|
4
|
+
data.tar.gz: 8795f3fed5583c49d3ff729ef18e1e4b4ab21214b4d6319fe13a28e90073e00f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65b30bd9f2bfca02fcf92b451f85fd98e701a5251e0952d4468b4b84178b2a7149705fd7dd20783f6d89c8f1b02e4630ced8d00a0ceb22928927e19aa405c72e
|
7
|
+
data.tar.gz: 320abed36d66d03e24c7c1cb38f545d094779559107f10fa084d464989ebb473a07b497b75eeb9d84c3febc16bfadd88f0002ca298ab67456e4c657261fdc8d6
|
data/README.md
CHANGED
@@ -29,7 +29,7 @@ org.install_lti(
|
|
29
29
|
context: "account/self", # (Optional) Or "account/3", "course/1", etc
|
30
30
|
exists: :error, # (Optional) Action to take if an LTI with the same Key already exists. Options are :error, :replace, :duplicate
|
31
31
|
version: "v1p3", # (Optional, default `v1p3`) LTI Version. Accepts `v1p0` or `v1p3`.
|
32
|
-
dedicated_deployment: false, # (Optional) If true, the Organization will be updated to link to a single deployment rather then to the general LTI Key. (experimental)
|
32
|
+
dedicated_deployment: false, # (Optional) If true, the Organization will be updated to link to a single deployment rather then to the general LTI Key. (experimental, LTI 1.3 only)
|
33
33
|
)
|
34
34
|
```
|
35
35
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module PandaPal
|
2
2
|
module OrganizationConcerns; end
|
3
3
|
|
4
|
-
#
|
4
|
+
# Newer versions of SymmetricEncryption introduced it's own version of attr_encrypted
|
5
5
|
# that is completely incompatible with the attr_encrypted Gem that PandaPal uses.
|
6
6
|
if defined?(::SymmetricEncryption::ActiveRecord::AttrEncrypted)
|
7
7
|
module SkipSymmetricEncAttrEncrypted
|
@@ -21,16 +21,34 @@ module PandaPal
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
class
|
24
|
+
class SettingsMarshaler
|
25
|
+
def self.load(data)
|
26
|
+
return nil unless data.present?
|
27
|
+
loaded = Marshal.load(data)
|
28
|
+
loaded = loaded.with_indifferent_access if loaded.is_a?(Hash) && !loaded.is_a?(HashWithIndifferentAccess)
|
29
|
+
loaded
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.dump(obj)
|
33
|
+
Marshal.dump(obj)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
class Organization < PandaPalRecord
|
25
38
|
include SkipSymmetricEncAttrEncrypted if defined?(SkipSymmetricEncAttrEncrypted)
|
26
39
|
|
27
40
|
include OrganizationConcerns::SettingsValidation
|
28
41
|
include OrganizationConcerns::TaskScheduling if defined?(Sidekiq.schedule)
|
29
42
|
|
30
|
-
|
31
|
-
attr_encrypted :settings, marshal: true, key: :encryption_key
|
43
|
+
attr_encrypted :settings, marshal: true, key: :encryption_key, marshaler: SettingsMarshaler
|
32
44
|
before_save {|a| a.settings = a.settings} # this is a hacky work-around to a bug where attr_encrypted is not saving settings in place
|
33
45
|
|
46
|
+
alias_method "settings_panda_pal_super=", "settings="
|
47
|
+
def settings=(settings)
|
48
|
+
settings = settings.with_indifferent_access if settings.is_a?(Hash) && !settings.is_a?(HashWithIndifferentAccess)
|
49
|
+
self.settings_panda_pal_super = settings
|
50
|
+
end
|
51
|
+
|
34
52
|
validates :key, uniqueness: { case_sensitive: false }, presence: true
|
35
53
|
validates :secret, presence: true
|
36
54
|
validates :name, uniqueness: { case_sensitive: false }, presence: true, format: { with: /\A[a-z0-9_]+\z/i }
|
@@ -84,10 +102,6 @@ module PandaPal
|
|
84
102
|
end
|
85
103
|
end
|
86
104
|
|
87
|
-
def self.resolve_platform(hint)
|
88
|
-
iss = hint["iss"]
|
89
|
-
end
|
90
|
-
|
91
105
|
def rename!(new_name)
|
92
106
|
do_switch = Apartment::Tenant.current == name
|
93
107
|
ActiveRecord::Base.connection.execute(
|
@@ -98,23 +112,56 @@ module PandaPal
|
|
98
112
|
switch_tenant if do_switch
|
99
113
|
end
|
100
114
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
scl = platform_type.org_subclass
|
106
|
-
scl ? becomes(scl) : self
|
115
|
+
if !PandaPal.lti_options[:platform].present? || PandaPal.lti_options[:platform].is_a?(String)
|
116
|
+
CONST_PLATFORM_TYPE = Platform.resolve_platform_class(nil) rescue nil
|
117
|
+
else
|
118
|
+
CONST_PLATFORM_TYPE = nil
|
107
119
|
end
|
108
120
|
|
109
|
-
|
110
|
-
|
111
|
-
if
|
112
|
-
|
121
|
+
# Include the Platform API...
|
122
|
+
if CONST_PLATFORM_TYPE
|
123
|
+
# ... directly if this is a single-platform tool
|
124
|
+
include CONST_PLATFORM_TYPE::OrgExtension if defined?(CONST_PLATFORM_TYPE::OrgExtension)
|
125
|
+
else
|
126
|
+
# ... via method_missing/delegation if this is a multi-platform tool
|
127
|
+
def respond_to_missing?(name, include_private = false)
|
128
|
+
if (self.class == PandaPal::Organization) && (plat_api = platform_api).present?
|
129
|
+
plat_api.respond_to?(name, include_private)
|
130
|
+
else
|
131
|
+
super
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
def method_missing(method, *args, **kwargs, &block)
|
136
|
+
if (self.class == PandaPal::Organization) && (plat_api = platform_api).present?
|
137
|
+
plat_api.send(method, *args, **kwargs, &block)
|
138
|
+
else
|
139
|
+
super
|
140
|
+
end
|
113
141
|
end
|
114
142
|
end
|
115
143
|
|
116
|
-
|
117
|
-
|
144
|
+
# Extend a particular type of Platform API.
|
145
|
+
def self.extend_platform_api(platform_type = CONST_PLATFORM_TYPE, &blk)
|
146
|
+
scl = platform_type.organization_api
|
147
|
+
scl.class_eval(&blk)
|
148
|
+
end
|
149
|
+
|
150
|
+
# Retrieve the specified Platform API for this Organization.
|
151
|
+
# If only a single Platform is used (when lti_options[:platform] is a constant string or nil), passing the platform_type is unnecessary
|
152
|
+
#
|
153
|
+
# The API is currently an Organization subclass (using `becomes()`), but such may change.
|
154
|
+
def platform_api(platform_type = primary_platform)
|
155
|
+
scl = platform_type.organization_api
|
156
|
+
return self if scl == self.class
|
157
|
+
becomes(scl)
|
158
|
+
end
|
159
|
+
|
160
|
+
protected
|
161
|
+
|
162
|
+
# OrgExtension-Overridable method to allow multi-platform tool Orgs to implicitly include a Platform API
|
163
|
+
def primary_platform
|
164
|
+
CONST_PLATFORM_TYPE
|
118
165
|
end
|
119
166
|
|
120
167
|
private
|
@@ -126,5 +173,11 @@ module PandaPal
|
|
126
173
|
def destroy_schema
|
127
174
|
Apartment::Tenant.drop name
|
128
175
|
end
|
176
|
+
|
177
|
+
public
|
178
|
+
|
179
|
+
PandaPal.resolved_extensions_for(self).each do |ext|
|
180
|
+
include ext
|
181
|
+
end
|
129
182
|
end
|
130
183
|
end
|
@@ -155,7 +155,12 @@ module PandaPal
|
|
155
155
|
end
|
156
156
|
|
157
157
|
if spec[:properties] != nil || spec[:allow_additional] != nil
|
158
|
-
|
158
|
+
set_keys = settings.keys
|
159
|
+
expected_keys = spec[:properties]&.keys || []
|
160
|
+
expected_keys = expected_keys.map(&:to_s) if settings.is_a?(HashWithIndifferentAccess)
|
161
|
+
|
162
|
+
extra_keys = set_keys - expected_keys
|
163
|
+
|
159
164
|
if extra_keys.present?
|
160
165
|
if spec[:allow_additional].is_a?(Hash)
|
161
166
|
extra_keys.each do |key|
|
@@ -42,7 +42,7 @@ module PandaPal
|
|
42
42
|
|
43
43
|
hash.tap do |hash|
|
44
44
|
kl = ' ' * (k.to_s.length - 4)
|
45
|
-
hash[k.to_sym] =
|
45
|
+
hash[k.to_sym] = PandaPal::OrganizationConcerns::TaskScheduling.build_settings_entry(desc)
|
46
46
|
end
|
47
47
|
end,
|
48
48
|
}
|
@@ -44,11 +44,13 @@ module PandaPal
|
|
44
44
|
def install_lti(host: nil, context: :root_account, version: 'v1p3', exists: :error, dedicated_deployment: false)
|
45
45
|
raise "Automatically installing this LTI requires Bearcat." unless defined?(Bearcat)
|
46
46
|
|
47
|
+
version = version.to_s
|
48
|
+
|
47
49
|
run_callbacks :lti_install do
|
48
50
|
ctype, cid = _parse_lti_context(context)
|
49
51
|
|
50
52
|
if version == 'v1p0'
|
51
|
-
existing_installs = _find_existing_installs(exists: exists) do |lti|
|
53
|
+
existing_installs = _find_existing_installs(context, exists: exists) do |lti|
|
52
54
|
lti[:consumer_key] == self.key
|
53
55
|
end
|
54
56
|
|
@@ -110,9 +112,6 @@ module PandaPal
|
|
110
112
|
end
|
111
113
|
|
112
114
|
ekey = existing_keys[0]
|
113
|
-
# if ekey && exists == :error
|
114
|
-
# raise "Tool with key #{self.key} already installed"
|
115
|
-
# end
|
116
115
|
|
117
116
|
lti_json_url = PandaPal::LaunchUrlHelpers.resolve_route(:v1p3_config_url, host: host)
|
118
117
|
lti_json = JSON.parse(HTTParty.get(lti_json_url, format: :plain).body)
|
@@ -266,6 +265,7 @@ module PandaPal
|
|
266
265
|
|
267
266
|
if defined?(Bearcat)
|
268
267
|
def bearcat_client
|
268
|
+
# Less than ideal, but `canvas_sync_client` has been the long-adopted tradition so we check for it so that we can continue to drop-in new versions of PandaPal
|
269
269
|
return canvas_sync_client if defined?(canvas_sync_client)
|
270
270
|
|
271
271
|
Bearcat::Client.new(
|
@@ -72,11 +72,13 @@ module PandaPal
|
|
72
72
|
raise "Unknown platform '#{platform}'"
|
73
73
|
end
|
74
74
|
|
75
|
-
def self.
|
76
|
-
return
|
75
|
+
def self.organization_api
|
76
|
+
return PandaPal::Organization unless defined?(self::OrgExtension)
|
77
|
+
return PandaPal::Organization if PandaPal::Organization < self::OrgExtension
|
78
|
+
|
77
79
|
oext = self::OrgExtension
|
78
80
|
|
79
|
-
@
|
81
|
+
@organization_api ||= self::OrganizationApi ||= Class.new(PandaPal::Organization) do
|
80
82
|
include oext
|
81
83
|
end
|
82
84
|
end
|
data/lib/panda_pal/engine.rb
CHANGED
@@ -69,41 +69,105 @@ module PandaPal
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
|
-
initializer "panda_pal.
|
72
|
+
initializer "panda_pal.prompts" do |app|
|
73
73
|
class ::Object
|
74
|
-
def
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
74
|
+
def _panda_pal_console_app_name
|
75
|
+
app_class = Rails.application.class
|
76
|
+
app_name = app_class.respond_to?(:parent) ? app_class.parent : app_class.module_parent
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
if defined? IRB
|
81
|
+
module PandaPalIrbTimePrompt
|
82
|
+
def prompt(prompt, ltype, indent, line_no)
|
83
|
+
formatted = super(prompt, ltype, indent, line_no)
|
84
|
+
app_bit = Pry::Helpers::Text.cyan("#{_panda_pal_console_app_name}-#{Apartment::Tenant.current}")
|
85
|
+
"[#{app_bit}] #{formatted}"
|
80
86
|
end
|
87
|
+
end
|
81
88
|
|
82
|
-
|
83
|
-
|
84
|
-
|
89
|
+
module ::IRB
|
90
|
+
class Irb
|
91
|
+
prepend PandaPalIrbTimePrompt
|
85
92
|
end
|
86
|
-
rescue => err
|
87
|
-
puts "PadaPal: Error occurred auto-switching tenant: #{err}"
|
88
93
|
end
|
89
94
|
end
|
90
95
|
|
91
|
-
|
92
|
-
|
93
|
-
|
96
|
+
if defined?(Pry)
|
97
|
+
default_prompt = Pry::Prompt[:default]
|
98
|
+
env = Pry::Helpers::Text.red(Rails.env.upcase)
|
99
|
+
|
100
|
+
app_name = _panda_pal_console_app_name
|
101
|
+
|
102
|
+
Pry.config.prompt = Pry::Prompt.new(
|
103
|
+
'custom',
|
104
|
+
'my custom prompt',
|
105
|
+
[
|
106
|
+
->(*args) {
|
107
|
+
app_bit = Pry::Helpers::Text.cyan("#{app_name}-#{Apartment::Tenant.current}")
|
108
|
+
"#{app_bit}#{default_prompt.wait_proc.call(*args)}"
|
109
|
+
},
|
110
|
+
->(*args) {
|
111
|
+
app_bit = Pry::Helpers::Text.cyan("#{app_name}-#{Apartment::Tenant.current}")
|
112
|
+
"#{app_bit}#{default_prompt.incomplete_proc.call(*args)}"
|
113
|
+
},
|
114
|
+
],
|
115
|
+
)
|
116
|
+
end
|
117
|
+
|
118
|
+
if defined? Rails::Console
|
119
|
+
module PandaPal::ConsoleExtPrefix
|
120
|
+
extend ActiveSupport::Concern
|
121
|
+
|
122
|
+
def start(*args)
|
123
|
+
print "\033];#{_panda_pal_console_app_name} Rails Console\007"
|
124
|
+
super
|
125
|
+
end
|
94
126
|
end
|
127
|
+
|
128
|
+
Rails::Console.prepend(PandaPal::ConsoleExtPrefix)
|
95
129
|
end
|
130
|
+
end
|
96
131
|
|
97
|
-
|
98
|
-
|
99
|
-
|
132
|
+
initializer "panda_pal.autoswitch" do |app|
|
133
|
+
if defined? Rails::Console
|
134
|
+
module PandaPal::ConsoleExtAutoSwitch
|
135
|
+
extend ActiveSupport::Concern
|
136
|
+
|
137
|
+
def start(*args)
|
138
|
+
begin
|
139
|
+
org = nil
|
140
|
+
if Rails.env.development?
|
141
|
+
org = PandaPal::Organization.find_by(name: 'local') || PandaPal::Organization.first
|
142
|
+
elsif PandaPal::Organization.count == 1
|
143
|
+
org = PandaPal::Organization.first
|
144
|
+
end
|
145
|
+
|
146
|
+
if org
|
147
|
+
org.switch_tenant
|
148
|
+
puts "PandaPal: Auto Switched to tenant '#{org.name}'"
|
149
|
+
end
|
150
|
+
rescue => err
|
151
|
+
puts "PandaPal: Error occurred auto-switching tenant: #{err}"
|
152
|
+
end
|
153
|
+
|
154
|
+
super
|
155
|
+
end
|
100
156
|
end
|
157
|
+
|
158
|
+
Rails::Console.prepend(PandaPal::ConsoleExtAutoSwitch)
|
101
159
|
end
|
102
160
|
end
|
103
161
|
|
104
162
|
initializer "panda_pal.serialze_symbols" do |app|
|
105
163
|
app.config.active_record.yaml_column_permitted_classes ||= []
|
106
|
-
app.config.active_record.yaml_column_permitted_classes |= [
|
164
|
+
app.config.active_record.yaml_column_permitted_classes |= [
|
165
|
+
Symbol,
|
166
|
+
ActiveSupport::Duration,
|
167
|
+
ActiveSupport::TimeWithZone,
|
168
|
+
ActiveSupport::TimeZone,
|
169
|
+
Time,
|
170
|
+
]
|
107
171
|
rescue
|
108
172
|
end
|
109
173
|
|
data/lib/panda_pal/version.rb
CHANGED
@@ -0,0 +1,162 @@
|
|
1
|
+
[1m[35m (3.9ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
2
|
+
[1m[35m (0.8ms)[0m [1m[34mSELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1[0m [["key", "environment"]]
|
3
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
4
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1[0m [["key", "environment"]]
|
5
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
6
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1[0m [["key", "environment"]]
|
7
|
+
[1m[35m (1.4ms)[0m [1m[34mSELECT "public"."panda_pal_organizations"."name" FROM "public"."panda_pal_organizations"[0m
|
8
|
+
[1m[35m (29.2ms)[0m [1m[35mDROP DATABASE IF EXISTS "panda_pal_development"[0m
|
9
|
+
[1m[35m (28.0ms)[0m [1m[35mDROP DATABASE IF EXISTS "panda_pal_test"[0m
|
10
|
+
[1m[35m (124.7ms)[0m [1m[35mCREATE DATABASE "panda_pal_development" ENCODING = 'utf8'[0m
|
11
|
+
[1m[35m (84.3ms)[0m [1m[35mCREATE DATABASE "panda_pal_test" ENCODING = 'utf8'[0m
|
12
|
+
[1m[35mSQL (0.2ms)[0m [1m[35mCREATE EXTENSION IF NOT EXISTS "plpgsql"[0m
|
13
|
+
[1m[35m (0.2ms)[0m [1m[35mDROP TABLE IF EXISTS "panda_pal_organizations" CASCADE[0m
|
14
|
+
[1m[35m (15.0ms)[0m [1m[35mCREATE TABLE "panda_pal_organizations" ("id" bigserial primary key, "name" character varying, "key" character varying, "secret" character varying, "canvas_account_id" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "salesforce_id" character varying, "encrypted_settings" text, "encrypted_settings_iv" character varying)[0m
|
15
|
+
[1m[35m (5.0ms)[0m [1m[35mCREATE UNIQUE INDEX "index_panda_pal_organizations_on_key" ON "panda_pal_organizations" ("key")[0m
|
16
|
+
[1m[35m (5.0ms)[0m [1m[35mCREATE UNIQUE INDEX "index_panda_pal_organizations_on_name" ON "panda_pal_organizations" ("name")[0m
|
17
|
+
[1m[35m (1.0ms)[0m [1m[35mDROP TABLE IF EXISTS "panda_pal_sessions" CASCADE[0m
|
18
|
+
[1m[35m (9.0ms)[0m [1m[35mCREATE TABLE "panda_pal_sessions" ("id" bigserial primary key, "session_key" character varying, "data" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "panda_pal_organization_id" integer)[0m
|
19
|
+
[1m[35m (4.8ms)[0m [1m[35mCREATE INDEX "index_panda_pal_sessions_on_panda_pal_organization_id" ON "panda_pal_sessions" ("panda_pal_organization_id")[0m
|
20
|
+
[1m[35m (4.2ms)[0m [1m[35mCREATE UNIQUE INDEX "index_panda_pal_sessions_on_session_key" ON "panda_pal_sessions" ("session_key")[0m
|
21
|
+
[1m[35m (8.6ms)[0m [1m[35mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)[0m
|
22
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
23
|
+
[1m[35m (1.2ms)[0m [1m[32mINSERT INTO "schema_migrations" (version) VALUES (20171205194657)[0m
|
24
|
+
[1m[35m (9.8ms)[0m [1m[35mCREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)[0m
|
25
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.2ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2[0m [["key", "environment"], ["LIMIT", 1]]
|
26
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
27
|
+
[1m[36mActiveRecord::InternalMetadata Create (0.3ms)[0m [1m[32mINSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key"[0m [["key", "environment"], ["value", "development"], ["created_at", "2022-07-21 15:53:16.068888"], ["updated_at", "2022-07-21 15:53:16.068888"]]
|
28
|
+
[1m[35m (1.1ms)[0m [1m[35mCOMMIT[0m
|
29
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.2ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2[0m [["key", "environment"], ["LIMIT", 1]]
|
30
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
31
|
+
[1m[35m (0.2ms)[0m [1m[35mCOMMIT[0m
|
32
|
+
[1m[35mSQL (0.3ms)[0m [1m[35mCREATE EXTENSION IF NOT EXISTS "plpgsql"[0m
|
33
|
+
[1m[35m (0.4ms)[0m [1m[35mDROP TABLE IF EXISTS "panda_pal_organizations" CASCADE[0m
|
34
|
+
[1m[35m (11.1ms)[0m [1m[35mCREATE TABLE "panda_pal_organizations" ("id" bigserial primary key, "name" character varying, "key" character varying, "secret" character varying, "canvas_account_id" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "salesforce_id" character varying, "encrypted_settings" text, "encrypted_settings_iv" character varying)[0m
|
35
|
+
[1m[35m (4.6ms)[0m [1m[35mCREATE UNIQUE INDEX "index_panda_pal_organizations_on_key" ON "panda_pal_organizations" ("key")[0m
|
36
|
+
[1m[35m (5.1ms)[0m [1m[35mCREATE UNIQUE INDEX "index_panda_pal_organizations_on_name" ON "panda_pal_organizations" ("name")[0m
|
37
|
+
[1m[35m (0.2ms)[0m [1m[35mDROP TABLE IF EXISTS "panda_pal_sessions" CASCADE[0m
|
38
|
+
[1m[35m (9.6ms)[0m [1m[35mCREATE TABLE "panda_pal_sessions" ("id" bigserial primary key, "session_key" character varying, "data" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "panda_pal_organization_id" integer)[0m
|
39
|
+
[1m[35m (5.0ms)[0m [1m[35mCREATE INDEX "index_panda_pal_sessions_on_panda_pal_organization_id" ON "panda_pal_sessions" ("panda_pal_organization_id")[0m
|
40
|
+
[1m[35m (5.0ms)[0m [1m[35mCREATE UNIQUE INDEX "index_panda_pal_sessions_on_session_key" ON "panda_pal_sessions" ("session_key")[0m
|
41
|
+
[1m[35m (8.9ms)[0m [1m[35mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)[0m
|
42
|
+
[1m[35m (0.4ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
43
|
+
[1m[35m (1.4ms)[0m [1m[32mINSERT INTO "schema_migrations" (version) VALUES (20171205194657)[0m
|
44
|
+
[1m[35m (8.8ms)[0m [1m[35mCREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)[0m
|
45
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.3ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2[0m [["key", "environment"], ["LIMIT", 1]]
|
46
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
47
|
+
[1m[36mActiveRecord::InternalMetadata Create (0.5ms)[0m [1m[32mINSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key"[0m [["key", "environment"], ["value", "development"], ["created_at", "2022-07-21 15:53:16.159537"], ["updated_at", "2022-07-21 15:53:16.159537"]]
|
48
|
+
[1m[35m (1.0ms)[0m [1m[35mCOMMIT[0m
|
49
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.2ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2[0m [["key", "environment"], ["LIMIT", 1]]
|
50
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
51
|
+
[1m[36mActiveRecord::InternalMetadata Update (0.2ms)[0m [1m[33mUPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3[0m [["value", "test"], ["updated_at", "2022-07-21 15:53:16.162899"], ["key", "environment"]]
|
52
|
+
[1m[35m (1.1ms)[0m [1m[35mCOMMIT[0m
|
53
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT pg_try_advisory_lock(7878782013693407355)[0m
|
54
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
55
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.2ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2[0m [["key", "environment"], ["LIMIT", 1]]
|
56
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
57
|
+
[1m[35m (0.1ms)[0m [1m[35mCOMMIT[0m
|
58
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_advisory_unlock(7878782013693407355)[0m
|
59
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
60
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT "public"."panda_pal_organizations"."name" FROM "public"."panda_pal_organizations"[0m
|
61
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT "public"."panda_pal_organizations"."name" FROM "public"."panda_pal_organizations"[0m
|
62
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT pg_try_advisory_lock(7878782013693407355)[0m
|
63
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
64
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.2ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2[0m [["key", "environment"], ["LIMIT", 1]]
|
65
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
66
|
+
[1m[35m (0.1ms)[0m [1m[35mCOMMIT[0m
|
67
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_advisory_unlock(7878782013693407355)[0m
|
68
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
69
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT "public"."panda_pal_organizations"."name" FROM "public"."panda_pal_organizations"[0m
|
70
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT "public"."panda_pal_organizations"."name" FROM "public"."panda_pal_organizations"[0m
|
71
|
+
[1m[35m (0.4ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
72
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1[0m [["key", "environment"]]
|
73
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
74
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1[0m [["key", "environment"]]
|
75
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
76
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1[0m [["key", "environment"]]
|
77
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT "public"."panda_pal_organizations"."name" FROM "public"."panda_pal_organizations"[0m
|
78
|
+
[1m[35m (70.1ms)[0m [1m[35mDROP DATABASE IF EXISTS "panda_pal_development"[0m
|
79
|
+
[1m[35m (34.0ms)[0m [1m[35mDROP DATABASE IF EXISTS "panda_pal_test"[0m
|
80
|
+
[1m[35m (76.8ms)[0m [1m[35mCREATE DATABASE "panda_pal_development" ENCODING = 'utf8'[0m
|
81
|
+
[1m[35m (74.8ms)[0m [1m[35mCREATE DATABASE "panda_pal_test" ENCODING = 'utf8'[0m
|
82
|
+
[1m[35m (10.7ms)[0m [1m[35mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)[0m
|
83
|
+
[1m[35m (9.0ms)[0m [1m[35mCREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)[0m
|
84
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT pg_try_advisory_lock(7878782013693407355)[0m
|
85
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
86
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.2ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2[0m [["key", "environment"], ["LIMIT", 1]]
|
87
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
88
|
+
[1m[36mActiveRecord::InternalMetadata Create (0.3ms)[0m [1m[32mINSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key"[0m [["key", "environment"], ["value", "development"], ["created_at", "2022-07-21 16:11:17.765993"], ["updated_at", "2022-07-21 16:11:17.765993"]]
|
89
|
+
[1m[35m (1.3ms)[0m [1m[35mCOMMIT[0m
|
90
|
+
[1m[35m (0.4ms)[0m [1m[34mSELECT pg_advisory_unlock(7878782013693407355)[0m
|
91
|
+
[1m[35m (0.4ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
92
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
93
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
94
|
+
[1m[35m (31.2ms)[0m [1m[35mDROP DATABASE IF EXISTS "panda_pal_development"[0m
|
95
|
+
[1m[35m (27.1ms)[0m [1m[35mDROP DATABASE IF EXISTS "panda_pal_test"[0m
|
96
|
+
[1m[35m (81.3ms)[0m [1m[35mCREATE DATABASE "panda_pal_development" ENCODING = 'utf8'[0m
|
97
|
+
[1m[35m (81.1ms)[0m [1m[35mCREATE DATABASE "panda_pal_test" ENCODING = 'utf8'[0m
|
98
|
+
[1m[35m (10.3ms)[0m [1m[35mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)[0m
|
99
|
+
[1m[35m (8.7ms)[0m [1m[35mCREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)[0m
|
100
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT pg_try_advisory_lock(7878782013693407355)[0m
|
101
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
102
|
+
Migrating to CreatePandaPalOrganizations (20160412205931)
|
103
|
+
[1m[35m (0.0ms)[0m [1m[35mBEGIN[0m
|
104
|
+
[1m[35m (8.6ms)[0m [1m[35mCREATE TABLE "panda_pal_organizations" ("id" serial NOT NULL PRIMARY KEY, "name" character varying, "key" character varying, "secret" character varying, "canvas_account_id" character varying, "settings" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)[0m
|
105
|
+
[1m[35m (3.8ms)[0m [1m[35mCREATE UNIQUE INDEX "index_panda_pal_organizations_on_name" ON "panda_pal_organizations" ("name")[0m
|
106
|
+
[1m[35m (3.4ms)[0m [1m[35mCREATE UNIQUE INDEX "index_panda_pal_organizations_on_key" ON "panda_pal_organizations" ("key")[0m
|
107
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.5ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version"[0m [["version", "20160412205931"]]
|
108
|
+
[1m[35m (1.3ms)[0m [1m[35mCOMMIT[0m
|
109
|
+
Migrating to CreatePandaPalSessions (20160413135653)
|
110
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
111
|
+
[1m[35m (7.4ms)[0m [1m[35mCREATE TABLE "panda_pal_sessions" ("id" serial NOT NULL PRIMARY KEY, "session_key" character varying, "data" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)[0m
|
112
|
+
[1m[35m (3.7ms)[0m [1m[35mCREATE UNIQUE INDEX "index_panda_pal_sessions_on_session_key" ON "panda_pal_sessions" ("session_key")[0m
|
113
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.4ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version"[0m [["version", "20160413135653"]]
|
114
|
+
[1m[35m (1.2ms)[0m [1m[35mCOMMIT[0m
|
115
|
+
Migrating to AddPandaPalOrganizationToSession (20160425130344)
|
116
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
117
|
+
[1m[35m (0.2ms)[0m [1m[35mALTER TABLE "panda_pal_sessions" ADD "panda_pal_organization_id" integer[0m
|
118
|
+
[1m[35m (3.5ms)[0m [1m[35mCREATE INDEX "index_panda_pal_sessions_on_panda_pal_organization_id" ON "panda_pal_sessions" ("panda_pal_organization_id")[0m
|
119
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.2ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version"[0m [["version", "20160425130344"]]
|
120
|
+
[1m[35m (1.3ms)[0m [1m[35mCOMMIT[0m
|
121
|
+
Migrating to AddSalesforceIdToOrganizations (20170106165533)
|
122
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
123
|
+
[1m[35m (0.2ms)[0m [1m[35mALTER TABLE "panda_pal_organizations" ADD "salesforce_id" character varying[0m
|
124
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.2ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version"[0m [["version", "20170106165533"]]
|
125
|
+
[1m[35m (1.0ms)[0m [1m[35mCOMMIT[0m
|
126
|
+
Migrating to EncryptOrganizationSettings (20171205183457)
|
127
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
128
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT * from schema_migrations where version = '30171205183457'[0m
|
129
|
+
[1m[35m (0.2ms)[0m [1m[35mALTER TABLE "panda_pal_organizations" RENAME COLUMN "settings" TO "old_settings"[0m
|
130
|
+
[1m[35m (0.2ms)[0m [1m[35mALTER TABLE "panda_pal_organizations" ADD "encrypted_settings" text[0m
|
131
|
+
[1m[35m (0.2ms)[0m [1m[35mALTER TABLE "panda_pal_organizations" ADD "encrypted_settings_iv" character varying[0m
|
132
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.3ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version"[0m [["version", "20171205183457"]]
|
133
|
+
[1m[35m (1.0ms)[0m [1m[35mCOMMIT[0m
|
134
|
+
Migrating to RemoveOldOrganizationSettings (20171205194657)
|
135
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
136
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT * from schema_migrations where version = '30171205194657'[0m
|
137
|
+
[1m[36mPandaPal::Organization Load (0.3ms)[0m [1m[34mSELECT "public"."panda_pal_organizations".* FROM "public"."panda_pal_organizations" ORDER BY "public"."panda_pal_organizations"."id" ASC LIMIT $1[0m [["LIMIT", 1000]]
|
138
|
+
[1m[35m (0.5ms)[0m [1m[35mALTER TABLE "panda_pal_organizations" DROP COLUMN "old_settings"[0m
|
139
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.3ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version"[0m [["version", "20171205194657"]]
|
140
|
+
[1m[35m (1.1ms)[0m [1m[35mCOMMIT[0m
|
141
|
+
Migrating to CreatePandaPalApiCalls (20220721095653)
|
142
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
143
|
+
[1m[35m (8.2ms)[0m [1m[35mCREATE TABLE "panda_pal_api_calls" ("id" serial NOT NULL PRIMARY KEY, "logic" text, "expiration" character varying, "rate_limit" character varying, "uses_remaining" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)[0m
|
144
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.2ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version"[0m [["version", "20220721095653"]]
|
145
|
+
[1m[35m (1.1ms)[0m [1m[35mCOMMIT[0m
|
146
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.2ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2[0m [["key", "environment"], ["LIMIT", 1]]
|
147
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
148
|
+
[1m[36mActiveRecord::InternalMetadata Create (0.3ms)[0m [1m[32mINSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key"[0m [["key", "environment"], ["value", "development"], ["created_at", "2022-07-21 16:14:19.544810"], ["updated_at", "2022-07-21 16:14:19.544810"]]
|
149
|
+
[1m[35m (1.3ms)[0m [1m[35mCOMMIT[0m
|
150
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT pg_advisory_unlock(7878782013693407355)[0m
|
151
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
152
|
+
[1m[35m (0.4ms)[0m [1m[34mSELECT "public"."panda_pal_organizations"."name" FROM "public"."panda_pal_organizations"[0m
|
153
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT "public"."panda_pal_organizations"."name" FROM "public"."panda_pal_organizations"[0m
|
154
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_try_advisory_lock(7878782013693407355)[0m
|
155
|
+
[1m[35m (0.4ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
156
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.4ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2[0m [["key", "environment"], ["LIMIT", 1]]
|
157
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
158
|
+
[1m[35m (0.1ms)[0m [1m[35mCOMMIT[0m
|
159
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_advisory_unlock(7878782013693407355)[0m
|
160
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
161
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT "public"."panda_pal_organizations"."name" FROM "public"."panda_pal_organizations"[0m
|
162
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT "public"."panda_pal_organizations"."name" FROM "public"."panda_pal_organizations"[0m
|