coalescing_panda 1.1.21 → 1.1.21.1
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/lib/coalescing_panda/engine.rb +43 -37
- data/lib/coalescing_panda/version.rb +1 -1
- 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: 32540f0bb85313eba7c4fd929b7bf55e7eaf9530877403972269f55abe92921a
|
4
|
+
data.tar.gz: 7780ee6b54a92fc11d95cc2c7c25c294a6bed3d7954c1754f6ec8180a4761e44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f72e05c8581d3caf3541718516b4a20e72c6cb78af4c9b822982805e6da1dab9f7f7ce17ce5179eaa703898452d65d338685b3f8bf890f6c42ed67eca2f5725c
|
7
|
+
data.tar.gz: b8079a6c869505f33092f442fc33c3865d515e8d781252fbc35a7fa033d9351a2650a3a558db56debaf18b6c6d1fa930c9713054e6ae168887a754ae6f6cbc1b
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'secure_headers'
|
2
4
|
|
3
5
|
module CoalescingPanda
|
@@ -7,74 +9,78 @@ module CoalescingPanda
|
|
7
9
|
|
8
10
|
initializer :append_migrations do |app|
|
9
11
|
unless app.root.to_s.match root.to_s
|
10
|
-
config.paths[
|
11
|
-
app.config.paths[
|
12
|
+
config.paths['db/migrate'].expanded.each do |expanded_path|
|
13
|
+
app.config.paths['db/migrate'] << expanded_path
|
12
14
|
end
|
13
15
|
end
|
14
16
|
end
|
15
17
|
|
16
|
-
initializer 'coalescing_panda.app_controller' do |
|
18
|
+
initializer 'coalescing_panda.app_controller' do |_app|
|
17
19
|
OAUTH_10_SUPPORT = true
|
18
20
|
ActiveSupport.on_load(:action_controller) do
|
19
21
|
include CoalescingPanda::ControllerHelpers
|
20
22
|
end
|
21
23
|
end
|
22
24
|
|
23
|
-
initializer 'cloaescing_panda.route_helper' do |
|
24
|
-
ActionDispatch::Routing::Mapper.
|
25
|
+
initializer 'cloaescing_panda.route_helper' do |_route|
|
26
|
+
ActionDispatch::Routing::Mapper.include CoalescingPanda::RouteHelpers
|
25
27
|
end
|
26
28
|
|
27
|
-
initializer 'coalescing_panda.route_options', :
|
29
|
+
initializer 'coalescing_panda.route_options', after: :disable_dependency_loading do |_app|
|
28
30
|
ActiveSupport.on_load(:action_controller) do
|
29
|
-
#force the routes to load
|
31
|
+
# force the routes to load
|
30
32
|
Rails.application.reload_routes!
|
31
|
-
CoalescingPanda
|
33
|
+
CoalescingPanda.propagate_lti_navigation
|
32
34
|
end
|
33
35
|
end
|
34
36
|
|
35
|
-
initializer :secure_headers do |
|
36
|
-
connect_src = %w
|
37
|
-
script_src = %w
|
37
|
+
initializer :secure_headers do |_app|
|
38
|
+
connect_src = %w[self]
|
39
|
+
script_src = %w[self]
|
38
40
|
if Rails.env.development?
|
39
41
|
# Allow webpack-dev-server to work
|
40
|
-
connect_src <<
|
41
|
-
connect_src <<
|
42
|
+
connect_src << 'http://localhost:3035'
|
43
|
+
connect_src << 'ws://localhost:3035'
|
42
44
|
# Allow stuff like rack-mini-profiler to work in development:
|
43
45
|
# https://github.com/MiniProfiler/rack-mini-profiler/issues/327
|
44
46
|
# DON'T ENABLE THIS FOR PRODUCTION!
|
45
47
|
script_src << "'unsafe-eval'"
|
46
48
|
end
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
49
|
+
begin
|
50
|
+
SecureHeaders::Configuration.default do |config|
|
51
|
+
# The default cookie headers aren't compatable with PandaPal cookies currenntly
|
52
|
+
config.cookies = { samesite: { none: true } }
|
53
|
+
# Need to allow LTI iframes
|
54
|
+
config.x_frame_options = 'ALLOWALL'
|
55
|
+
config.x_content_type_options = 'nosniff'
|
56
|
+
config.x_xss_protection = '1; mode=block'
|
57
|
+
config.referrer_policy = %w[origin-when-cross-origin strict-origin-when-cross-origin]
|
58
|
+
config.csp = {
|
59
|
+
default_src: %w[self],
|
60
|
+
script_src: script_src,
|
61
|
+
# Certain CSS-in-JS libraries inline the CSS, so we need to use unsafe-inline for them
|
62
|
+
style_src: %w[self unsafe-inline blob: https://fonts.googleapis.com],
|
63
|
+
font_src: %w[self data: https://fonts.gstatic.com],
|
64
|
+
connect_src: connect_src
|
65
|
+
}
|
66
|
+
end
|
67
|
+
rescue AlreadyConfiguredError
|
68
|
+
Rails.logger.warn 'Could not set default secure headers configuration when there is one already, continuing with previously defined configuration'
|
63
69
|
end
|
64
70
|
SecureHeaders::Configuration.override(:safari_override) do |config|
|
65
71
|
config.cookies = SecureHeaders::OPT_OUT
|
66
72
|
# Need to allow LTI iframes
|
67
|
-
config.x_frame_options =
|
68
|
-
config.x_content_type_options =
|
69
|
-
config.x_xss_protection =
|
70
|
-
config.referrer_policy = %w
|
73
|
+
config.x_frame_options = 'ALLOWALL'
|
74
|
+
config.x_content_type_options = 'nosniff'
|
75
|
+
config.x_xss_protection = '1; mode=block'
|
76
|
+
config.referrer_policy = %w[origin-when-cross-origin strict-origin-when-cross-origin]
|
71
77
|
config.csp = {
|
72
|
-
default_src: %w
|
78
|
+
default_src: %w[self],
|
73
79
|
script_src: script_src,
|
74
80
|
# Certain CSS-in-JS libraries inline the CSS, so we need to use unsafe-inline for them
|
75
|
-
style_src: %w
|
76
|
-
font_src: %w
|
77
|
-
connect_src: connect_src
|
81
|
+
style_src: %w[self unsafe-inline blob: https://fonts.googleapis.com],
|
82
|
+
font_src: %w[self data: https://fonts.gstatic.com],
|
83
|
+
connect_src: connect_src
|
78
84
|
}
|
79
85
|
end
|
80
86
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coalescing_panda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.21
|
4
|
+
version: 1.1.21.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Mills
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04
|
11
|
+
date: 2020-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|