panda_pal 5.14.0.beta1 → 5.14.0.beta3
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/README.md +1 -1
- data/lib/panda_pal/engine.rb +3 -1
- data/lib/panda_pal/helpers/session_replacement.rb +8 -6
- data/lib/panda_pal/version.rb +1 -1
- data/spec/dummy/db/test2_schema.rb +38 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cd590efd3af03ed86a77935eb747dc0dc14783fa4eb03fadaf86c7fe38eb111
|
4
|
+
data.tar.gz: 4f2de47f3b7fdb42e9b91b7e3e4b1ae8c11df85d149aff4e98e8637ac92e47c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cdff72e6ea5dffe02b7f4446e5d2ded9d943a9820807b2439d7c1a64e5c83962e0ef7c2c6f853cff5d04cd9cbaf7ce44878dddf275204c5744988a9e4011cec
|
7
|
+
data.tar.gz: 5c8b45d8a3ded50444d900211901a82d871270e8980360f7c6293f8c6a93f7609394d3c7f9d05e8cfa43dbf085e9b535dc9624f9bf8ab98d44fc107db025c4d3
|
data/README.md
CHANGED
@@ -465,7 +465,7 @@ OR `platform: 'bridgeapp.com'`
|
|
465
465
|
## Development:
|
466
466
|
### Running Specs:
|
467
467
|
Initialize the Specs DB:
|
468
|
-
`cd spec/dummy; bundle exec
|
468
|
+
`cd spec/dummy; bundle exec rails db:drop; bundle exec rails db:create; RAILS_ENV=test rails db:migrate`
|
469
469
|
Then `bundle exec rspec`
|
470
470
|
|
471
471
|
## Safari Support
|
data/lib/panda_pal/engine.rb
CHANGED
@@ -15,9 +15,11 @@ module PandaPal
|
|
15
15
|
end
|
16
16
|
|
17
17
|
initializer :append_migrations do |app|
|
18
|
+
expanded = []
|
18
19
|
config.paths["db/migrate"].expanded.each do |expanded_path|
|
19
|
-
|
20
|
+
expanded << expanded_path
|
20
21
|
end
|
22
|
+
config.paths["db/migrate"] = expanded.uniq
|
21
23
|
# Apartment will modify this, but it doesn't fully support engine migrations, so we'll reset it here
|
22
24
|
ActiveRecord::Migrator.migrations_paths = Rails.application.paths['db/migrate'].to_a
|
23
25
|
end
|
@@ -234,14 +234,16 @@ module PandaPal::Helpers
|
|
234
234
|
|
235
235
|
def self.extract_panda_token(request, params = request.params)
|
236
236
|
headers = request.respond_to?(:headers) ? request.headers : request.env
|
237
|
-
|
238
|
-
auth_header ||= headers['HTTP_AUTHORIZATION'] || headers['Authorization']
|
237
|
+
token = headers['HTTP_X_PANDA_TOKEN'] || headers['X-Panda-Token']
|
239
238
|
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
239
|
+
token ||= begin
|
240
|
+
if (auth_header = headers['HTTP_AUTHORIZATION'] || headers['Authorization']).present?
|
241
|
+
match = auth_header.match(/Bearer panda:(.+)/)
|
242
|
+
match ||= auth_header.match(/token=(.+)/) # Legacy Support
|
243
|
+
token = match[1] if match && match[1].include?('.')
|
244
|
+
end
|
244
245
|
end
|
246
|
+
|
245
247
|
token ||= params["panda_token"]
|
246
248
|
token ||= params["session_token"] if params["session_token"]&.include?('.') # Legacy Support
|
247
249
|
token ||= params["session_key"] if params["session_key"]&.include?('.') # Legacy Support
|
data/lib/panda_pal/version.rb
CHANGED
@@ -2,17 +2,48 @@
|
|
2
2
|
# of editing this file, please use the migrations feature of Active Record to
|
3
3
|
# incrementally modify your database, and then regenerate this schema definition.
|
4
4
|
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
# from scratch.
|
9
|
-
#
|
5
|
+
# This file is the source Rails uses to define your schema when running `bin/rails
|
6
|
+
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
|
7
|
+
# be faster and is potentially less error prone than running all of your
|
8
|
+
# migrations from scratch. Old migrations may fail to apply correctly if those
|
9
|
+
# migrations use external dependencies or application code.
|
10
10
|
#
|
11
11
|
# It's strongly recommended that you check this file into your version control system.
|
12
12
|
|
13
|
-
ActiveRecord::Schema.define(version:
|
14
|
-
|
13
|
+
ActiveRecord::Schema[7.1].define(version: 2025_04_01_214421) do
|
15
14
|
# These are extensions that must be enabled in order to support this database
|
16
15
|
enable_extension "plpgsql"
|
17
16
|
|
17
|
+
create_table "panda_pal_api_calls", id: :serial, force: :cascade do |t|
|
18
|
+
t.text "logic"
|
19
|
+
t.string "expiration"
|
20
|
+
t.integer "uses_remaining"
|
21
|
+
t.datetime "created_at", precision: nil, null: false
|
22
|
+
t.datetime "updated_at", precision: nil, null: false
|
23
|
+
end
|
24
|
+
|
25
|
+
create_table "panda_pal_organizations", id: :serial, force: :cascade do |t|
|
26
|
+
t.string "name"
|
27
|
+
t.string "key"
|
28
|
+
t.string "secret"
|
29
|
+
t.string "canvas_account_id"
|
30
|
+
t.datetime "created_at", precision: nil, null: false
|
31
|
+
t.datetime "updated_at", precision: nil, null: false
|
32
|
+
t.string "salesforce_id"
|
33
|
+
t.text "encrypted_settings"
|
34
|
+
t.string "encrypted_settings_iv"
|
35
|
+
t.index ["key"], name: "index_panda_pal_organizations_on_key", unique: true
|
36
|
+
t.index ["name"], name: "index_panda_pal_organizations_on_name", unique: true
|
37
|
+
end
|
38
|
+
|
39
|
+
create_table "panda_pal_sessions", id: :serial, force: :cascade do |t|
|
40
|
+
t.string "session_secret"
|
41
|
+
t.text "data"
|
42
|
+
t.datetime "created_at", precision: nil, null: false
|
43
|
+
t.datetime "updated_at", precision: nil, null: false
|
44
|
+
t.integer "panda_pal_organization_id"
|
45
|
+
t.index ["panda_pal_organization_id"], name: "index_panda_pal_sessions_on_panda_pal_organization_id"
|
46
|
+
t.index ["session_secret"], name: "index_panda_pal_sessions_on_session_secret", unique: true
|
47
|
+
end
|
48
|
+
|
18
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: panda_pal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.14.0.
|
4
|
+
version: 5.14.0.beta3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Instructure CustomDev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-04-
|
11
|
+
date: 2025-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|