rack-strip-cookies 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +9 -6
- data/Gemfile +12 -0
- data/README.md +13 -3
- data/lib/rack/strip-cookies.rb +1 -1
- data/lib/rack/strip-cookies/version.rb +1 -1
- data/rack-strip-cookies.gemspec +12 -12
- metadata +7 -8
- data/.ruby-gemset +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7eafe50366d6e4108cceffe2e11c6b252ffef7f9
|
4
|
+
data.tar.gz: a5191640fd78fe70345bf3ee699173cfe352e87b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89592d00d384bb07e1f460085a4c9913dc41957a238c052b154cbd554a8872240397fba0be1b81682532c7e233c7197e78ad34b8a9156d027a528ba4ec72873e
|
7
|
+
data.tar.gz: 771c40ff4e8d62fbef97ac7d89899b9116879851d127de1f65d53e75e1b2af443868f0025c89a130f0d8534d7bf55f395b577c89d60aa4bc334c0d544a1b7770
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.1.
|
1
|
+
ruby-2.1.5
|
data/.travis.yml
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
-
|
4
|
-
- 1.9.3
|
5
|
-
- 1
|
6
|
-
- ruby-head
|
7
|
-
- jruby-19mode
|
8
|
-
- rbx-19mode
|
3
|
+
- 1.9.2
|
4
|
+
- 1.9.3
|
5
|
+
- 2.1
|
9
6
|
notifications:
|
10
7
|
email: false
|
8
|
+
env:
|
9
|
+
- "rack=1.2.8"
|
10
|
+
- "rack=1.3.10"
|
11
|
+
- "rack=1.4.5"
|
12
|
+
- "rack=1.5.2"
|
13
|
+
- "rack=master"
|
data/Gemfile
CHANGED
@@ -4,6 +4,18 @@ gemspec
|
|
4
4
|
|
5
5
|
gem 'rake'
|
6
6
|
|
7
|
+
github = 'git://github.com/%s.git'
|
8
|
+
repos = { 'rack' => github % 'rack/rack' }
|
9
|
+
|
10
|
+
%w(rack).each do |lib|
|
11
|
+
dep = case ENV[lib]
|
12
|
+
when 'stable', nil then nil
|
13
|
+
when /(\d+\.)+\d+/ then '~> ' + ENV[lib].sub("#{lib}-", '')
|
14
|
+
else { git: repos[lib], branch: dep }
|
15
|
+
end
|
16
|
+
gem lib, dep
|
17
|
+
end
|
18
|
+
|
7
19
|
group :test do
|
8
20
|
gem 'rack-test'
|
9
21
|
gem 'coveralls', require: false
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Rack::StripCookies [![Build Status](https://secure.travis-ci.org/icoretech/rack-strip-cookies.png)](https://travis-ci.org/icoretech/rack-strip-cookies?branch=master)
|
1
|
+
# Rack::StripCookies [![Build Status](https://secure.travis-ci.org/icoretech/rack-strip-cookies.png)](https://travis-ci.org/icoretech/rack-strip-cookies?branch=master)
|
2
2
|
|
3
3
|
Simple Rack middleware to remove cookies at specified paths.
|
4
4
|
|
@@ -16,9 +16,17 @@ Or install it yourself as:
|
|
16
16
|
|
17
17
|
$ gem install rack-strip-cookies
|
18
18
|
|
19
|
-
##
|
19
|
+
## Concept
|
20
|
+
|
21
|
+
The goal of this gem is not only avoid serving a cookie to a client through the Set-Cookie header, but also to erase cookies sent in the request. In other words the client-sent cookies will not make it to your application layer, provided the middleware is loaded in the correct place in the stack.
|
22
|
+
|
23
|
+
## Use cases
|
20
24
|
|
21
|
-
|
25
|
+
- You have a buggy third party library that raises exception when cookies are sent in a request, such as an authentication engine.
|
26
|
+
- You are looking for a cheap way to not mess with session cookie disabilitation in your framework.
|
27
|
+
- Selectively shut down cookies on specific paths, configurable when adding the middleware.
|
28
|
+
|
29
|
+
## Ruby on Rails
|
22
30
|
|
23
31
|
To make the middleware available in all environments, open `config/application.rb` and add in `class Application < Rails::Application`:
|
24
32
|
|
@@ -28,6 +36,8 @@ config.middleware.insert_before(ActionDispatch::Cookies, Rack::StripCookies, pat
|
|
28
36
|
|
29
37
|
If you want to customize the environment in which the middleware is enabled edit the respective environment files instead.
|
30
38
|
|
39
|
+
You can verify the middleware positioning by typing `rake middleware` in the root of your application.
|
40
|
+
|
31
41
|
## Contributing
|
32
42
|
|
33
43
|
1. Fork it
|
data/lib/rack/strip-cookies.rb
CHANGED
data/rack-strip-cookies.gemspec
CHANGED
@@ -4,21 +4,21 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'rack/strip-cookies/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'rack-strip-cookies'
|
8
8
|
spec.version = Rack::StripCookies::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
11
|
-
spec.summary =
|
12
|
-
spec.description =
|
13
|
-
spec.homepage =
|
14
|
-
spec.license =
|
9
|
+
spec.authors = ['Claudio Poli']
|
10
|
+
spec.email = ['claudio@icorete.ch']
|
11
|
+
spec.summary = 'Rack middleware to remove cookies at user-defined paths.'
|
12
|
+
spec.description = 'Rack middleware to remove cookies at user-defined paths.'
|
13
|
+
spec.homepage = 'http://github.com/icoretech/rack-strip-cookies'
|
14
|
+
spec.license = 'MIT'
|
15
15
|
|
16
|
-
spec.files = `git ls-files`.split(
|
16
|
+
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = [
|
19
|
+
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_development_dependency
|
22
|
-
spec.add_development_dependency
|
23
|
-
spec.add_development_dependency
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.0'
|
22
|
+
spec.add_development_dependency 'rack', '~> 1.2'
|
23
|
+
spec.add_development_dependency 'rack-test', '~> 0.6.2'
|
24
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-strip-cookies
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claudio Poli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.2
|
33
|
+
version: '1.2'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.2
|
40
|
+
version: '1.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rack-test
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.6.2
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.6.2
|
55
55
|
description: Rack middleware to remove cookies at user-defined paths.
|
56
56
|
email:
|
57
57
|
- claudio@icorete.ch
|
@@ -61,7 +61,6 @@ extra_rdoc_files: []
|
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
63
|
- ".rspec"
|
64
|
-
- ".ruby-gemset"
|
65
64
|
- ".ruby-version"
|
66
65
|
- ".travis.yml"
|
67
66
|
- Gemfile
|
@@ -93,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
92
|
version: '0'
|
94
93
|
requirements: []
|
95
94
|
rubyforge_project:
|
96
|
-
rubygems_version: 2.
|
95
|
+
rubygems_version: 2.4.3
|
97
96
|
signing_key:
|
98
97
|
specification_version: 4
|
99
98
|
summary: Rack middleware to remove cookies at user-defined paths.
|
data/.ruby-gemset
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
rack-strip-cookies
|