bridgetown-content-security-policy 1.2.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +1 -1
- data/CHANGELOG.md +5 -0
- data/Gemfile +0 -5
- data/Rakefile +1 -0
- data/bridgetown-content-security-policy.gemspec +1 -1
- data/bridgetown.automation.rb +3 -2
- data/lib/bridgetown-content-security-policy/builder.rb +2 -6
- data/lib/bridgetown-content-security-policy/version.rb +1 -1
- data/lib/bridgetown-content-security-policy.rb +3 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '01187babccb4805b3932c7d8c0fbefb349fecf45e829108b44538dfb3c8f7fe4'
|
4
|
+
data.tar.gz: b8770f4cfb4740c2c7cbaa5ca3daa78d82ec8f5e2ff29e864428bd5ebaf40052
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be9c1dd319f104c400cfcd08ae25318a95ecc6591af0a903dd212ef00fb2659d32e36d2b7c4208fd363124d835646b41f9efc7171336e800d9cf6406017b2460
|
7
|
+
data.tar.gz: 65819b692aaf3b25e6f03bea50cbe2807a320e9f4ac85d00f35567c4710bbcb34fb05d5205b9cb967f87784fd8ab43edc65093cb3b2b7953f8086e27ff3f1898
|
data/.github/workflows/tests.yml
CHANGED
@@ -14,7 +14,7 @@ jobs:
|
|
14
14
|
strategy:
|
15
15
|
matrix:
|
16
16
|
ruby_version: [2.7.7, 3.0.5, 3.1.3, 3.2.0]
|
17
|
-
bridgetown_version: [1.
|
17
|
+
bridgetown_version: [1.2.0]
|
18
18
|
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
|
19
19
|
# Has to be top level to cache properly
|
20
20
|
env:
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -5,13 +5,8 @@ gemspec
|
|
5
5
|
|
6
6
|
gem "bridgetown", ENV["BRIDGETOWN_VERSION"] if ENV["BRIDGETOWN_VERSION"]
|
7
7
|
|
8
|
-
group :development, :test do
|
9
|
-
gem "byebug"
|
10
|
-
end
|
11
|
-
|
12
8
|
group :test do
|
13
9
|
gem "minitest"
|
14
10
|
gem "minitest-profile"
|
15
11
|
gem "minitest-reporters"
|
16
|
-
gem "shoulda"
|
17
12
|
end
|
data/Rakefile
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
|
19
19
|
spec.required_ruby_version = ">= 2.7.0"
|
20
20
|
|
21
|
-
spec.add_dependency "bridgetown", ">= 1.0", "< 2.0"
|
21
|
+
spec.add_dependency "bridgetown", ">= 1.2.0", "< 2.0"
|
22
22
|
|
23
23
|
spec.add_development_dependency "bundler"
|
24
24
|
spec.add_development_dependency "nokogiri"
|
data/bridgetown.automation.rb
CHANGED
@@ -36,6 +36,7 @@ create_file "config/content_security_policy.config.rb" do
|
|
36
36
|
RUBY
|
37
37
|
end
|
38
38
|
|
39
|
-
say_status :content_security_policy, "All done!
|
40
|
-
say_status :content_security_policy, "
|
39
|
+
say_status :content_security_policy, "All done! Add `init :\"bridgetown-content-security-policy\"` to your `config/initializers.rb`"
|
40
|
+
say_status :content_security_policy, "Add <% content_security_policy %> to the head tag in your layouts to render the CSP."
|
41
|
+
say_status :content_security_policy, "See the new content_security_policy.rb file for details"
|
41
42
|
say_status :content_security_policy, "More info available at: https://github.com/ayushn21/bridgetown-content-security-policy"
|
@@ -22,12 +22,8 @@ module BridgetownContentSecurityPolicy
|
|
22
22
|
render tag.context["page"]["content_security_policy"]
|
23
23
|
end
|
24
24
|
|
25
|
-
helper "
|
26
|
-
render
|
27
|
-
end
|
28
|
-
|
29
|
-
helper "content_security_policy", helpers_scope: true do
|
30
|
-
_csp view.page.data.content_security_policy
|
25
|
+
helper "content_security_policy" do
|
26
|
+
render helpers.view.page.data.content_security_policy
|
31
27
|
end
|
32
28
|
end
|
33
29
|
|
@@ -4,4 +4,6 @@ require "bridgetown"
|
|
4
4
|
require "bridgetown-content-security-policy/policy"
|
5
5
|
require "bridgetown-content-security-policy/builder"
|
6
6
|
|
7
|
-
|
7
|
+
Bridgetown.initializer :"bridgetown-content-security-policy" do |config|
|
8
|
+
config.builder BridgetownContentSecurityPolicy::Builder
|
9
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bridgetown-content-security-policy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ayush Newatia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bridgetown
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.2.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '2.0'
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 1.2.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '2.0'
|