Skip to content

Commit cc3d97b

Browse files
committed
Bump to 5.0.0 and update docs with upgrade guide
1 parent 4e1b8c2 commit cc3d97b

File tree

6 files changed

+27
-28
lines changed

6 files changed

+27
-28
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
## 5.0.0
2+
3+
Well this is a little embarassing. 4.0 was supposed to set the secure/httponly/samesite=lax attributes on cookies by default but it didn't. Now it does. - See the [upgrading to 5.0](docs/upgrading-to-5-0.md) guide.
4+
15
## 4.0.1
26

37
- Adds support for `worker-src` CSP directive to 4.x line (https://github.com/twitter/secureheaders/pull/364)
48

59
## 4.0
610

7-
- See the [upgrading to 4.0](upgrading-to-4-0.md) guide. Lots of breaking changes.
11+
- See the [upgrading to 4.0](docs/upgrading-to-4-0.md) guide. Lots of breaking changes.
812

913
## 3.7.2
1014

@@ -322,7 +326,7 @@ Adds `upgrade-insecure-requests` support for requests from Firefox and Chrome (a
322326
323327
## 3.0.0
324328
325-
secure_headers 3.0.0 is a near-complete, not-entirely-backward-compatible rewrite. Please see the [upgrade guide](https://github.com/twitter/secureheaders/blob/master/upgrading-to-3-0.md) for an in-depth explanation of the changes and the suggested upgrade path.
329+
secure_headers 3.0.0 is a near-complete, not-entirely-backward-compatible rewrite. Please see the [upgrade guide](https://github.com/twitter/secureheaders/blob/master/docs/upgrading-to-3-0.md) for an in-depth explanation of the changes and the suggested upgrade path.
326330
327331
## 2.5.1 - 2016-02-16 18:11:11 UTC - Remove noisy deprecation warning
328332

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Secure Headers [![Build Status](https://travis-ci.org/twitter/secureheaders.svg?branch=master)](http://travis-ci.org/twitter/secureheaders) [![Code Climate](https://codeclimate.com/github/twitter/secureheaders.svg)](https://codeclimate.com/github/twitter/secureheaders) [![Coverage Status](https://coveralls.io/repos/twitter/secureheaders/badge.svg)](https://coveralls.io/r/twitter/secureheaders)
22

3-
**master represents the unreleased 4.x line**. See the [upgrading to 4.x doc](upgrading-to-4-0.md) for instructions on how to upgrade. Bug fixes should go in the 3.x branch for now.
3+
**master represents 5.x line**. See the [upgrading to 4.x doc](docs/upgrading-to-4-0.md) and [upgrading to 5.x doc](docs/upgrading-to-5-0.md) for instructions on how to upgrade. Bug fixes should go in the 3.x branch for now.
44

5-
**The [3.x](https://github.com/twitter/secureheaders/tree/2.x) branch is moving into maintenance mode**. See the [upgrading to 3.x doc](upgrading-to-3-0.md) for instructions on how to upgrade including the differences and benefits of using the 3.x branch.
5+
**The [3.x](https://github.com/twitter/secureheaders/tree/2.x) branch is moving into maintenance mode**. See the [upgrading to 3.x doc](docs/upgrading-to-3-0.md) for instructions on how to upgrade including the differences and benefits of using the 3.x branch.
66

77
**The [2.x branch](https://github.com/twitter/secureheaders/tree/2.x) will be not be maintained once 4.x is released**. The documentation below only applies to the 3.x branch. See the 2.x [README](https://github.com/twitter/secureheaders/blob/2.x/README.md) for the old way of doing things.
88

@@ -55,7 +55,7 @@ If you do not supply a `default` configuration, exceptions will be raised. If yo
5555

5656
All `nil` values will fallback to their default values. `SecureHeaders::OPT_OUT` will disable the header entirely.
5757

58-
**Word of caution:** The following is not a default configuration per se. It serves as a sample implementation of the configuration. You should read more about these headers and determine what is appropriate for your requirements.
58+
**Word of caution:** The following is not a default configuration per se. It serves as a sample implementation of the configuration. You should read more about these headers and determine what is appropriate for your requirements.
5959

6060
```ruby
6161
SecureHeaders::Configuration.default do |config|
File renamed without changes.
Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,6 @@
1-
### Breaking Changes
2-
3-
The most likely change to break your app is the new cookie defaults. This is the first place to check. If you're using the default CSP, your policy will change but your app should not break. This should not break brand new projects using secure_headers either.
4-
5-
## All cookies default to secure/httponly/SameSite=Lax
6-
7-
By default, *all* cookies will be marked as `SameSite=lax`,`secure`, and `httponly`. To opt-out, supply `SecureHeaders::OPT_OUT` as the value for `SecureHeaders.cookies` or the individual configs. Setting these values to `false` will raise an error.
8-
9-
```ruby
10-
# specific opt outs
11-
config.cookies = {
12-
secure: SecureHeaders::OPT_OUT,
13-
httponly: SecureHeaders::OPT_OUT,
14-
samesite: SecureHeaders::OPT_OUT,
15-
}
16-
17-
# nuclear option, just make things work again
18-
config.cookies = SecureHeaders::OPT_OUT
19-
```
20-
211
## script_src must be set
222

23-
Not setting a `script_src` value means your policy falls back to whatever `default_src` (also required) is set to. This can be very dangerous and indicates the policy is too loose.
3+
Not setting a `script_src` value means your policy falls back to whatever `default_src` (also required) is set to. This can be very dangerous and indicates the policy is too loose.
244

255
However, sometimes you really don't need a `script-src` e.g. API responses (`default-src 'none'`) so you can set `script_src: SecureHeaders::OPT_OUT` to work around this.
266

docs/upgrading-to-5-0.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## All cookies default to secure/httponly/SameSite=Lax
2+
3+
By default, *all* cookies will be marked as `SameSite=lax`,`secure`, and `httponly`. To opt-out, supply `SecureHeaders::OPT_OUT` as the value for `SecureHeaders.cookies` or the individual configs. Setting these values to `false` will raise an error.
4+
5+
```ruby
6+
# specific opt outs
7+
config.cookies = {
8+
secure: SecureHeaders::OPT_OUT,
9+
httponly: SecureHeaders::OPT_OUT,
10+
samesite: SecureHeaders::OPT_OUT,
11+
}
12+
13+
# nuclear option, just make things work again
14+
config.cookies = SecureHeaders::OPT_OUT
15+
```

secure_headers.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# frozen_string_literal: true
33
Gem::Specification.new do |gem|
44
gem.name = "secure_headers"
5-
gem.version = "4.0.1"
5+
gem.version = "5.0.0.alpha01"
66
gem.authors = ["Neil Matatall"]
77
gem.email = ["[email protected]"]
88
gem.description = "Manages application of security headers with many safe defaults."
@@ -22,7 +22,7 @@ Gem::Specification.new do |gem|
2222
gem.post_install_message = <<-POST_INSTALL
2323
2424
**********
25-
:wave: secure_headers 4.0 introduces a lot of breaking changes (in the name of security!). It's highly likely you will need to update your secure_headers cookie configuration to avoid breaking things. See the upgrade guide for details: https://github.com/twitter/secureheaders/blob/master/upgrading-to-4-0.md
25+
:wave: secure_headers 5.0 introduces a lot of breaking changes (in the name of security!). It's highly likely you will need to update your secure_headers cookie configuration to avoid breaking things. See the upgrade guide for details: https://github.com/twitter/secureheaders/blob/master/docs/upgrading-to-4-0.md https://github.com/twitter/secureheaders/blob/master/docs/upgrading-to-4-0.md
2626
**********
2727
2828
POST_INSTALL

0 commit comments

Comments
 (0)