p3p 1.2.0 → 2.0.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.
- checksums.yaml +4 -4
- data/.rspec +3 -0
- data/.travis.yml +18 -0
- data/Gemfile +9 -1
- data/Rakefile +6 -0
- data/lib/p3p/version.rb +1 -1
- data/p3p.gemspec +1 -2
- data/spec/configuration_spec.rb +20 -24
- data/spec/middleware_spec.rb +11 -23
- data/spec/p3p_spec.rb +21 -0
- data/spec/spec_helper.rb +8 -10
- metadata +9 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fe7161ea20b91f5643bcb51b021b47063e3bba7
|
4
|
+
data.tar.gz: b0657f69d032e2a580ccbbe838b5dae81834d135
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b47f01017764bee0781788bd79f56a02c769da27428cb3633513d43c4040c31ec356f24938801593306ef6c62560c0a4d26bf120aaae831064c023cefc11a91c
|
7
|
+
data.tar.gz: 93d08285e402a4c29cbfba0038a97866df5f92c4122af85855ff5f1896d5f6fe3e123643a2cee3b20683380c704ee6e8e7d39cfab7d9ae0cfe6275a2728b0055
|
data/.rspec
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
script: rspec --order=random --format=documentation --color
|
2
|
+
bundler_args: --without development
|
3
|
+
env:
|
4
|
+
global:
|
5
|
+
- JRUBY_OPTS="$JRUBY_OPTS --debug"
|
6
|
+
gemfile:
|
7
|
+
- Gemfile
|
8
|
+
language: ruby
|
9
|
+
rvm:
|
10
|
+
- 2.2.6
|
11
|
+
- 2.3.3
|
12
|
+
- 2.4.0
|
13
|
+
- ruby-head
|
14
|
+
matrix:
|
15
|
+
allow_failures:
|
16
|
+
- rvm: ruby-head
|
17
|
+
fast_finish: true
|
18
|
+
sudo: false
|
data/Gemfile
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
|
3
|
+
gem 'rack', '>= 1.6.2'
|
4
|
+
|
5
|
+
group :test do
|
6
|
+
gem 'coveralls', '>= 0.8.19', :require => false
|
7
|
+
gem 'rspec', '~> 3.1'
|
8
|
+
gem 'simplecov', '>= 0.12.0', :require => false
|
9
|
+
gem 'mime-types', '~> 3.1', :platforms => [:jruby, :ruby_18]
|
10
|
+
end
|
11
|
+
|
4
12
|
gemspec
|
data/Rakefile
CHANGED
data/lib/p3p/version.rb
CHANGED
data/p3p.gemspec
CHANGED
data/spec/configuration_spec.rb
CHANGED
@@ -1,33 +1,29 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
app = lambda { |_env| [200, headers, []] }
|
7
|
-
request = Rack::MockRequest.env_for('/', :lint => true, :fatal => true, :method => http_verb)
|
8
|
-
response = P3P::Middleware.new(app).call(request)
|
3
|
+
describe P3P::Configuration do
|
4
|
+
subject { P3P::Configuration.new }
|
5
|
+
let(:default_header) { P3P::Configuration::DEFAULT_HEADER }
|
9
6
|
|
10
|
-
|
7
|
+
describe '::DEFAULT_HEADER' do
|
8
|
+
it 'should contain a default header' do
|
9
|
+
expect(default_header).to_not be_nil
|
10
|
+
end
|
11
11
|
end
|
12
|
-
end
|
13
|
-
|
14
|
-
describe P3P do
|
15
|
-
describe '#configure' do
|
16
|
-
let(:header) { 'Fake p3p header' }
|
17
12
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
13
|
+
describe '.initialize' do
|
14
|
+
it 'should call set_default_header!' do
|
15
|
+
# TODO: Check call over value
|
16
|
+
expect(subject.header).to eq default_header
|
22
17
|
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '.set_default_header!' do
|
21
|
+
it 'should set the default header' do
|
22
|
+
subject.header = 'foo'
|
23
|
+
expect(subject.header).to eq 'foo'
|
23
24
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
it_should_behave_like 'it returns configured P3P header', @header, 'DELETE'
|
28
|
-
it_should_behave_like 'it returns configured P3P header', @header, 'HEAD'
|
29
|
-
it_should_behave_like 'it returns configured P3P header', @header, 'OPTIONS'
|
30
|
-
it_should_behave_like 'it returns configured P3P header', @header, 'TRACE'
|
31
|
-
it_should_behave_like 'it returns configured P3P header', @header, 'CONNECT'
|
25
|
+
subject.set_default_header!
|
26
|
+
expect(subject.header).to eq default_header
|
27
|
+
end
|
32
28
|
end
|
33
29
|
end
|
data/spec/middleware_spec.rb
CHANGED
@@ -2,34 +2,22 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
shared_examples 'it returns P3P headers' do |http_verb|
|
4
4
|
it "should return default P3P headers in the case of a #{http_verb} request" do
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
p3p_header = Time.now.to_i
|
6
|
+
headers = {'Content-Type' => 'text/html'}
|
7
|
+
app = lambda { |_env| [200, headers, []] }
|
8
|
+
request = Rack::MockRequest.env_for('/', :lint => true, :fatal => true, :method => http_verb)
|
9
|
+
|
10
|
+
P3P.configure { |c| c.header = p3p_header }
|
11
|
+
|
8
12
|
response = P3P::Middleware.new(app).call(request)
|
9
13
|
|
10
|
-
expect(response[1]).to include('P3P' =>
|
14
|
+
expect(response[1]).to include('P3P' => p3p_header)
|
11
15
|
end
|
12
|
-
end
|
16
|
+
end
|
13
17
|
|
14
18
|
describe P3P::Middleware do
|
15
|
-
|
16
|
-
|
17
|
-
expect_any_instance_of(P3P::Configuration).to receive(:set_default_header!)
|
18
|
-
P3P.configure { |_config| }
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
describe '.set_default_header!' do
|
23
|
-
it 'should set the default header' do
|
24
|
-
header = 'abc123'
|
25
|
-
default_header = P3P::Configuration::DEFAULT_HEADER
|
26
|
-
|
27
|
-
P3P.configure { |c| c.header = header }
|
28
|
-
expect(P3P.configuration.header).to eq header
|
29
|
-
|
30
|
-
P3P.configuration.set_default_header!
|
31
|
-
expect(P3P.configuration.header).to eq default_header
|
32
|
-
end
|
19
|
+
after do
|
20
|
+
P3P.configuration.set_default_header!
|
33
21
|
end
|
34
22
|
|
35
23
|
it_should_behave_like 'it returns P3P headers', 'GET'
|
data/spec/p3p_spec.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe P3P do
|
4
|
+
describe '#configuration' do
|
5
|
+
subject { P3P.configuration }
|
6
|
+
|
7
|
+
it 'should instantiate P3P::Configuration' do
|
8
|
+
expect(subject.class).to eq P3P::Configuration
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should memoize P3P::Configuration' do
|
12
|
+
expect(subject).to eq P3P.configuration
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
describe '#configure' do
|
17
|
+
it 'should yield :configuration' do
|
18
|
+
expect { |b| P3P.configure(&b) }.to yield_control
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,12 +1,10 @@
|
|
1
|
+
if ENV['COVERAGE']
|
2
|
+
require 'simplecov'
|
3
|
+
SimpleCov.start
|
4
|
+
elsif ENV['CI']
|
5
|
+
require 'coveralls'
|
6
|
+
Coveralls.wear!
|
7
|
+
end
|
8
|
+
|
1
9
|
require 'rack'
|
2
10
|
require 'p3p'
|
3
|
-
|
4
|
-
RSpec.configure do |config|
|
5
|
-
config.color = true
|
6
|
-
config.formatter = :documentation
|
7
|
-
config.order = :random
|
8
|
-
|
9
|
-
config.after(:each) do
|
10
|
-
P3P.configuration.set_default_header!
|
11
|
-
end
|
12
|
-
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: p3p
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Milewski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -16,28 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.6.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rspec
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 3.1.0
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 3.1.0
|
26
|
+
version: 1.6.2
|
41
27
|
description: Inserts P3P header
|
42
28
|
email:
|
43
29
|
- tmilewski@gmail.com
|
@@ -46,7 +32,9 @@ extensions: []
|
|
46
32
|
extra_rdoc_files: []
|
47
33
|
files:
|
48
34
|
- ".gitignore"
|
35
|
+
- ".rspec"
|
49
36
|
- ".rubocop.yml"
|
37
|
+
- ".travis.yml"
|
50
38
|
- Gemfile
|
51
39
|
- LICENSE.txt
|
52
40
|
- README.md
|
@@ -59,6 +47,7 @@ files:
|
|
59
47
|
- p3p.gemspec
|
60
48
|
- spec/configuration_spec.rb
|
61
49
|
- spec/middleware_spec.rb
|
50
|
+
- spec/p3p_spec.rb
|
62
51
|
- spec/spec_helper.rb
|
63
52
|
homepage: https://github.com/tmilewski/p3p
|
64
53
|
licenses: []
|
@@ -79,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
68
|
version: '0'
|
80
69
|
requirements: []
|
81
70
|
rubyforge_project:
|
82
|
-
rubygems_version: 2.
|
71
|
+
rubygems_version: 2.6.10
|
83
72
|
signing_key:
|
84
73
|
specification_version: 4
|
85
74
|
summary: Inserts P3P headers to allow cookies to be utilized in iframe scenarios with
|
@@ -87,5 +76,5 @@ summary: Inserts P3P headers to allow cookies to be utilized in iframe scenarios
|
|
87
76
|
test_files:
|
88
77
|
- spec/configuration_spec.rb
|
89
78
|
- spec/middleware_spec.rb
|
79
|
+
- spec/p3p_spec.rb
|
90
80
|
- spec/spec_helper.rb
|
91
|
-
has_rdoc:
|