secure_headers 3.0.3 → 3.2.0

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.
data/spec/spec_helper.rb CHANGED
@@ -3,9 +3,12 @@ require 'rspec'
3
3
  require 'rack'
4
4
  require 'pry-nav'
5
5
 
6
+ require 'coveralls'
7
+ Coveralls.wear!
8
+
6
9
  require File.join(File.dirname(__FILE__), '..', 'lib', 'secure_headers')
7
10
 
8
- ENV["RAILS_ENV"] = "test"
11
+
9
12
 
10
13
  USER_AGENTS = {
11
14
  firefox: 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1',
@@ -42,3 +45,15 @@ end
42
45
  def reset_config
43
46
  SecureHeaders::Configuration.clear_configurations
44
47
  end
48
+
49
+ def capture_warning
50
+ begin
51
+ old_stderr = $stderr
52
+ $stderr = StringIO.new
53
+ yield
54
+ result = $stderr.string
55
+ ensure
56
+ $stderr = old_stderr
57
+ end
58
+ result
59
+ end
data/upgrading-to-3-0.md CHANGED
@@ -8,6 +8,7 @@ Changes
8
8
  | Global configuration | `SecureHeaders::Configuration.configure` block | `SecureHeaders::Configuration.default` block |
9
9
  | All headers besides HPKP and CSP | Accept hashes as config values | Must be strings (validated during configuration) |
10
10
  | CSP directive values | Accepted space delimited strings OR arrays of strings | Must be arrays of strings |
11
+ | CSP Nonce values in views | `@content_security_policy_nonce` | `content_security_policy_script_nonce` or `content_security_policy_style_nonce`
11
12
  | `self`/`none` source expressions | could be `self` / `none` / `'self'` / `'none'` | Must be `'self'` or `'none'` |
12
13
  | `inline` / `eval` source expressions | could be `inline`, `eval`, `'unsafe-inline'`, or `'unsafe-eval'` | Must be `'unsafe-eval'` or `'unsafe-inline'` |
13
14
  | Per-action configuration | override [`def secure_header_options_for(header, options)`](https://github.com/twitter/secureheaders/commit/bb9ebc6c12a677aad29af8e0f08ffd1def56efec#diff-04c6e90faac2675aa89e2176d2eec7d8R111) | Use [named overrides](https://github.com/twitter/secureheaders#named-overrides) or [per-action helpers](https://github.com/twitter/secureheaders#per-action-configuration) |
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: secure_headers
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neil Matatall
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-29 00:00:00.000000000 Z
11
+ date: 2016-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -58,7 +58,10 @@ files:
58
58
  - Rakefile
59
59
  - lib/secure_headers.rb
60
60
  - lib/secure_headers/configuration.rb
61
+ - lib/secure_headers/hash_helper.rb
61
62
  - lib/secure_headers/headers/content_security_policy.rb
63
+ - lib/secure_headers/headers/cookie.rb
64
+ - lib/secure_headers/headers/policy_management.rb
62
65
  - lib/secure_headers/headers/public_key_pins.rb
63
66
  - lib/secure_headers/headers/strict_transport_security.rb
64
67
  - lib/secure_headers/headers/x_content_type_options.rb
@@ -67,12 +70,15 @@ files:
67
70
  - lib/secure_headers/headers/x_permitted_cross_domain_policies.rb
68
71
  - lib/secure_headers/headers/x_xss_protection.rb
69
72
  - lib/secure_headers/middleware.rb
70
- - lib/secure_headers/padrino.rb
71
73
  - lib/secure_headers/railtie.rb
74
+ - lib/secure_headers/utils/cookies_config.rb
72
75
  - lib/secure_headers/view_helper.rb
76
+ - lib/tasks/tasks.rake
73
77
  - secure_headers.gemspec
74
78
  - spec/lib/secure_headers/configuration_spec.rb
75
79
  - spec/lib/secure_headers/headers/content_security_policy_spec.rb
80
+ - spec/lib/secure_headers/headers/cookie_spec.rb
81
+ - spec/lib/secure_headers/headers/policy_management_spec.rb
76
82
  - spec/lib/secure_headers/headers/public_key_pins_spec.rb
77
83
  - spec/lib/secure_headers/headers/strict_transport_security_spec.rb
78
84
  - spec/lib/secure_headers/headers/x_content_type_options_spec.rb
@@ -81,9 +87,9 @@ files:
81
87
  - spec/lib/secure_headers/headers/x_permitted_cross_domain_policies_spec.rb
82
88
  - spec/lib/secure_headers/headers/x_xss_protection_spec.rb
83
89
  - spec/lib/secure_headers/middleware_spec.rb
90
+ - spec/lib/secure_headers/view_helpers_spec.rb
84
91
  - spec/lib/secure_headers_spec.rb
85
92
  - spec/spec_helper.rb
86
- - travis.sh
87
93
  - upgrading-to-3-0.md
88
94
  homepage: https://github.com/twitter/secureheaders
89
95
  licenses:
@@ -113,6 +119,8 @@ summary: Add easily configured security headers to responses including content-s
113
119
  test_files:
114
120
  - spec/lib/secure_headers/configuration_spec.rb
115
121
  - spec/lib/secure_headers/headers/content_security_policy_spec.rb
122
+ - spec/lib/secure_headers/headers/cookie_spec.rb
123
+ - spec/lib/secure_headers/headers/policy_management_spec.rb
116
124
  - spec/lib/secure_headers/headers/public_key_pins_spec.rb
117
125
  - spec/lib/secure_headers/headers/strict_transport_security_spec.rb
118
126
  - spec/lib/secure_headers/headers/x_content_type_options_spec.rb
@@ -121,5 +129,6 @@ test_files:
121
129
  - spec/lib/secure_headers/headers/x_permitted_cross_domain_policies_spec.rb
122
130
  - spec/lib/secure_headers/headers/x_xss_protection_spec.rb
123
131
  - spec/lib/secure_headers/middleware_spec.rb
132
+ - spec/lib/secure_headers/view_helpers_spec.rb
124
133
  - spec/lib/secure_headers_spec.rb
125
134
  - spec/spec_helper.rb
@@ -1,13 +0,0 @@
1
- module SecureHeaders
2
- module Padrino
3
- class << self
4
- ##
5
- # Main class that register this extension.
6
- #
7
- def registered(app)
8
- app.helpers SecureHeaders::InstanceMethods
9
- end
10
- alias_method :included, :registered
11
- end
12
- end
13
- end
data/travis.sh DELETED
@@ -1,10 +0,0 @@
1
- #! /bin/sh
2
-
3
- bundle install >> /dev/null &&
4
- bundle exec rspec --format progress spec &&
5
- cd fixtures/rails_3_2_12 &&
6
- bundle install >> /dev/null &&
7
- bundle exec rspec --format progress spec &&
8
- cd ../../fixtures/rails_3_2_12_no_init &&
9
- bundle install >> /dev/null &&
10
- bundle exec rspec spec