ixtlan-core 0.7.5 → 0.8.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/README.md +1 -1
- data/lib/ixtlan/core.rb +3 -0
- data/lib/ixtlan/core.rb~ +3 -0
- data/lib/ixtlan/core/railtie.rb +0 -13
- metadata +163 -119
- data/lib/ixtlan/core/active_record.rb +0 -25
- data/lib/ixtlan/core/data_mapper.rb +0 -22
data/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Ixtlan #
|
|
2
2
|
|
|
3
3
|
this gem adds more security related headers to the response for a rails3 application. mainly inspired by
|
|
4
|
-
[google-gets-a-1-for-browser-security](http://www.barracudalabs.com/wordpress/index.php/2011/07/21/
|
|
4
|
+
[google-gets-a-1-for-browser-security](http://www.barracudalabs.com/wordpress/index.php/2011/07/21/)
|
|
5
5
|
and
|
|
6
6
|
[HttpCaching](http://code.google.com/p/doctype/wiki/ArticleHttpCaching).
|
|
7
7
|
and
|
data/lib/ixtlan/core.rb
ADDED
data/lib/ixtlan/core.rb~
ADDED
data/lib/ixtlan/core/railtie.rb
CHANGED
|
@@ -3,8 +3,6 @@ require 'ixtlan/core/cache_headers'
|
|
|
3
3
|
require 'ixtlan/core/x_frame_headers'
|
|
4
4
|
require 'ixtlan/core/x_content_type_headers'
|
|
5
5
|
require 'ixtlan/core/x_xss_protection_headers'
|
|
6
|
-
require 'ixtlan/core/active_record'
|
|
7
|
-
require 'ixtlan/core/data_mapper'
|
|
8
6
|
require 'ixtlan/core/configuration_rack'
|
|
9
7
|
require 'ixtlan/core/configuration_manager'
|
|
10
8
|
module Ixtlan
|
|
@@ -62,17 +60,6 @@ module Ixtlan
|
|
|
62
60
|
|
|
63
61
|
config.after_initialize do |app|
|
|
64
62
|
app.config.configuration_manager.setup(app.config.configuration_model) if app.config.respond_to? :configuration_model
|
|
65
|
-
|
|
66
|
-
if defined? ::DataMapper
|
|
67
|
-
|
|
68
|
-
::DataMapper::Model.append_inclusions(Ixtlan::Core::DataMapper)
|
|
69
|
-
|
|
70
|
-
elsif defined? ::ActiveRecord
|
|
71
|
-
|
|
72
|
-
::ActiveRecord::Base.send(:include,
|
|
73
|
-
Ixtlan::Core::ActiveRecord)
|
|
74
|
-
|
|
75
|
-
end
|
|
76
63
|
end
|
|
77
64
|
end
|
|
78
65
|
end
|
metadata
CHANGED
|
@@ -1,86 +1,124 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ixtlan-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
+
hash: 63
|
|
4
5
|
prerelease:
|
|
5
|
-
|
|
6
|
+
segments:
|
|
7
|
+
- 0
|
|
8
|
+
- 8
|
|
9
|
+
- 0
|
|
10
|
+
version: 0.8.0
|
|
6
11
|
platform: ruby
|
|
7
12
|
authors:
|
|
8
|
-
|
|
13
|
+
- mkristian
|
|
9
14
|
autorequire:
|
|
10
15
|
bindir: bin
|
|
11
16
|
cert_chain: []
|
|
12
17
|
|
|
13
|
-
date:
|
|
18
|
+
date: 2013-01-16 00:00:00 Z
|
|
14
19
|
dependencies:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
20
|
+
- !ruby/object:Gem::Dependency
|
|
21
|
+
name: slf4r
|
|
22
|
+
prerelease: false
|
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
|
24
|
+
none: false
|
|
25
|
+
requirements:
|
|
26
|
+
- - ~>
|
|
27
|
+
- !ruby/object:Gem::Version
|
|
28
|
+
hash: 11
|
|
29
|
+
segments:
|
|
30
|
+
- 0
|
|
31
|
+
- 4
|
|
32
|
+
- 2
|
|
33
|
+
version: 0.4.2
|
|
34
|
+
type: :development
|
|
35
|
+
version_requirements: *id001
|
|
36
|
+
- !ruby/object:Gem::Dependency
|
|
37
|
+
name: ixtlan-generators
|
|
38
|
+
prerelease: false
|
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
|
40
|
+
none: false
|
|
41
|
+
requirements:
|
|
42
|
+
- - "="
|
|
43
|
+
- !ruby/object:Gem::Version
|
|
44
|
+
hash: 31
|
|
45
|
+
segments:
|
|
46
|
+
- 0
|
|
47
|
+
- 1
|
|
48
|
+
- 2
|
|
49
|
+
version: 0.1.2
|
|
50
|
+
type: :development
|
|
51
|
+
version_requirements: *id002
|
|
52
|
+
- !ruby/object:Gem::Dependency
|
|
53
|
+
name: rails
|
|
54
|
+
prerelease: false
|
|
55
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
|
56
|
+
none: false
|
|
57
|
+
requirements:
|
|
58
|
+
- - "="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
hash: 21
|
|
61
|
+
segments:
|
|
62
|
+
- 3
|
|
63
|
+
- 0
|
|
64
|
+
- 9
|
|
65
|
+
version: 3.0.9
|
|
66
|
+
type: :development
|
|
67
|
+
version_requirements: *id003
|
|
68
|
+
- !ruby/object:Gem::Dependency
|
|
69
|
+
name: rspec
|
|
70
|
+
prerelease: false
|
|
71
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
|
72
|
+
none: false
|
|
73
|
+
requirements:
|
|
74
|
+
- - "="
|
|
75
|
+
- !ruby/object:Gem::Version
|
|
76
|
+
hash: 23
|
|
77
|
+
segments:
|
|
78
|
+
- 2
|
|
79
|
+
- 6
|
|
80
|
+
- 0
|
|
81
|
+
version: 2.6.0
|
|
82
|
+
type: :development
|
|
83
|
+
version_requirements: *id004
|
|
84
|
+
- !ruby/object:Gem::Dependency
|
|
85
|
+
name: cucumber
|
|
86
|
+
prerelease: false
|
|
87
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
|
88
|
+
none: false
|
|
89
|
+
requirements:
|
|
90
|
+
- - "="
|
|
91
|
+
- !ruby/object:Gem::Version
|
|
92
|
+
hash: 51
|
|
93
|
+
segments:
|
|
94
|
+
- 0
|
|
95
|
+
- 9
|
|
96
|
+
- 4
|
|
97
|
+
version: 0.9.4
|
|
98
|
+
type: :development
|
|
99
|
+
version_requirements: *id005
|
|
100
|
+
- !ruby/object:Gem::Dependency
|
|
101
|
+
name: ruby-maven
|
|
102
|
+
prerelease: false
|
|
103
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
|
104
|
+
none: false
|
|
105
|
+
requirements:
|
|
106
|
+
- - "="
|
|
107
|
+
- !ruby/object:Gem::Version
|
|
108
|
+
hash: 331
|
|
109
|
+
segments:
|
|
110
|
+
- 3
|
|
111
|
+
- 0
|
|
112
|
+
- 4
|
|
113
|
+
- 0
|
|
114
|
+
- 29
|
|
115
|
+
- 0
|
|
116
|
+
version: 3.0.4.0.29.0
|
|
117
|
+
type: :development
|
|
118
|
+
version_requirements: *id006
|
|
81
119
|
description: cache header control, dynamic configuration, and optimistic find on model via updated_at timestamp
|
|
82
120
|
email:
|
|
83
|
-
|
|
121
|
+
- m.kristian@web.de
|
|
84
122
|
executables: []
|
|
85
123
|
|
|
86
124
|
extensions: []
|
|
@@ -88,70 +126,76 @@ extensions: []
|
|
|
88
126
|
extra_rdoc_files: []
|
|
89
127
|
|
|
90
128
|
files:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
129
|
+
- MIT-LICENSE
|
|
130
|
+
- README.md
|
|
131
|
+
- lib/ixtlan-core.rb
|
|
132
|
+
- lib/ixtlan/core/x_xss_protection_headers.rb~
|
|
133
|
+
- lib/ixtlan/core/x_frame_headers.rb
|
|
134
|
+
- lib/ixtlan/core/configuration_rack.rb
|
|
135
|
+
- lib/ixtlan/core/x_content_headers.rb~
|
|
136
|
+
- lib/ixtlan/core/data_mapper.rb~
|
|
137
|
+
- lib/ixtlan/core/active_record.rb~
|
|
138
|
+
- lib/ixtlan/core/extra_headers.rb
|
|
139
|
+
- lib/ixtlan/core/x_content_type_headers.rb
|
|
140
|
+
- lib/ixtlan/core/x_content_type_headers.rb~
|
|
141
|
+
- lib/ixtlan/core/cache_headers.rb
|
|
142
|
+
- lib/ixtlan/core/optimistic_data_mapper.rb~
|
|
143
|
+
- lib/ixtlan/core/controllers/configuration_controller.rb
|
|
144
|
+
- lib/ixtlan/core/controllers/configuration_controller.rb~
|
|
145
|
+
- lib/ixtlan/core/heartbeat.rb
|
|
146
|
+
- lib/ixtlan/core/x_xss_protection_headers.rb
|
|
147
|
+
- lib/ixtlan/core/optimistic_active_record.rb~
|
|
148
|
+
- lib/ixtlan/core/railtie.rb
|
|
149
|
+
- lib/ixtlan/core/configuration_manager.rb
|
|
150
|
+
- lib/ixtlan/core.rb~
|
|
151
|
+
- lib/ixtlan/core.rb
|
|
152
|
+
- spec/cache_headers_spec.rb~
|
|
153
|
+
- spec/controller.rb
|
|
154
|
+
- spec/controller.rb~
|
|
155
|
+
- spec/cache_headers_spec.rb
|
|
156
|
+
- spec/x_headers_spec.rb~
|
|
157
|
+
- spec/x_headers_spec.rb
|
|
158
|
+
- spec/configuration_manager_spec.rb~
|
|
159
|
+
- spec/configuration_manager_spec.rb
|
|
160
|
+
- features/step_definitions/simple_steps.rb
|
|
161
|
+
- features/headers.feature
|
|
124
162
|
homepage: http://github.com/mkristian/ixtlan-core
|
|
125
163
|
licenses:
|
|
126
|
-
|
|
164
|
+
- MIT-LICENSE
|
|
127
165
|
post_install_message:
|
|
128
166
|
rdoc_options:
|
|
129
|
-
|
|
130
|
-
|
|
167
|
+
- --main
|
|
168
|
+
- README.md
|
|
131
169
|
require_paths:
|
|
132
|
-
|
|
170
|
+
- lib
|
|
133
171
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
134
172
|
none: false
|
|
135
173
|
requirements:
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
174
|
+
- - ">="
|
|
175
|
+
- !ruby/object:Gem::Version
|
|
176
|
+
hash: 3
|
|
177
|
+
segments:
|
|
178
|
+
- 0
|
|
179
|
+
version: "0"
|
|
139
180
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
181
|
none: false
|
|
141
182
|
requirements:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
183
|
+
- - ">="
|
|
184
|
+
- !ruby/object:Gem::Version
|
|
185
|
+
hash: 3
|
|
186
|
+
segments:
|
|
187
|
+
- 0
|
|
188
|
+
version: "0"
|
|
145
189
|
requirements: []
|
|
146
190
|
|
|
147
191
|
rubyforge_project:
|
|
148
|
-
rubygems_version: 1.8.
|
|
192
|
+
rubygems_version: 1.8.15
|
|
149
193
|
signing_key:
|
|
150
194
|
specification_version: 3
|
|
151
195
|
summary: cache header control, dynamic configuration, and optimistic find on model via updated_at timestamp
|
|
152
196
|
test_files:
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
197
|
+
- spec/cache_headers_spec.rb
|
|
198
|
+
- spec/x_headers_spec.rb
|
|
199
|
+
- spec/configuration_manager_spec.rb
|
|
200
|
+
- features/headers.feature
|
|
201
|
+
- features/step_definitions/simple_steps.rb
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
module Ixtlan
|
|
2
|
-
module Core
|
|
3
|
-
module ActiveRecord
|
|
4
|
-
|
|
5
|
-
def self.included(base)
|
|
6
|
-
warn 'deprecated: use ixtlan-optimistic instead'
|
|
7
|
-
base.class_eval do
|
|
8
|
-
|
|
9
|
-
def self.optimistic_find(updated_at, *args)
|
|
10
|
-
if updated_at
|
|
11
|
-
dummy = self.new
|
|
12
|
-
dummy.updated_at = updated_at
|
|
13
|
-
updated_at_date = dummy.updated_at
|
|
14
|
-
# try different ways to use the date
|
|
15
|
-
# TODO maybe there is a nicer way ??
|
|
16
|
-
first(:conditions => ["id = ? and updated_at <= ? and updated_at >= ?", args[0], updated_at_date + 0.0005, updated_at_date - 0.0005])
|
|
17
|
-
# TODO make it work with different PKs
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
module Ixtlan
|
|
2
|
-
module Core
|
|
3
|
-
module DataMapper
|
|
4
|
-
|
|
5
|
-
def self.included(base)
|
|
6
|
-
warn 'deprecated: use ixtlan-optimistic instead'
|
|
7
|
-
base.class_eval do
|
|
8
|
-
|
|
9
|
-
def self.optimistic_get(updated_at, *args)
|
|
10
|
-
if updated_at
|
|
11
|
-
updated_at_date = new(:updated_at => updated_at).updated_at
|
|
12
|
-
# TODO make it work with different PKs
|
|
13
|
-
first(:id => args[0], :updated_at.gte => updated_at_date - 0.0005, :updated_at.lte => updated_at_date + 0.0005)
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|