mumuki-javascript-runner 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/javascript_runner.rb +1 -0
- data/lib/validation_hook.rb +18 -0
- data/lib/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec3828b95e23b39b3306bcb2a507cde9acbf3d98d444e9dd5bb95cf3c648a915
|
4
|
+
data.tar.gz: b286fa2b2764f084c4f1763cfabcace5e4a975403039d40d89ed20adf4872264
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d717df05b3e3dd99882730c368c13a753264d63bd6c8ded6b60eb13f90feef16a301b5ac240b9ac5bc67bb7b812f3222fbdb680b243da3bbc9c397f711b56e3a
|
7
|
+
data.tar.gz: e27e945d2adbe2720a3204a87f9a70ebc180eb26b2ae61bebb0ed9103dd81af91308529835ee4bd9e82baebe8e8de57d0ae1c56d209427a4ee7caceb285e43af
|
data/lib/javascript_runner.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
class JavascriptValidationHook < Mumukit::Hook
|
2
|
+
def validate!(request)
|
3
|
+
matches = request_matches?(request) do |it|
|
4
|
+
it =~ /\W*(require|process|os|fs|eval|cluster|v8|vm|tty|tls|root|global|crypto|stream|events)\W*/
|
5
|
+
end
|
6
|
+
raise Mumukit::RequestValidationError, "You can not use #{$1} here" if matches
|
7
|
+
end
|
8
|
+
|
9
|
+
private
|
10
|
+
|
11
|
+
def request_matches?(request, &block)
|
12
|
+
[
|
13
|
+
request.content,
|
14
|
+
request.extra,
|
15
|
+
request.query
|
16
|
+
].compact.any?(&block)
|
17
|
+
end
|
18
|
+
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumuki-javascript-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Leonardo Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mumukit
|
@@ -106,6 +106,7 @@ files:
|
|
106
106
|
- lib/metadata_hook.rb
|
107
107
|
- lib/query_hook.rb
|
108
108
|
- lib/test_hook.rb
|
109
|
+
- lib/validation_hook.rb
|
109
110
|
- lib/version.rb
|
110
111
|
homepage: http://github.com/mumuki/mumuki-javascript-server
|
111
112
|
licenses:
|
@@ -127,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
128
|
version: '0'
|
128
129
|
requirements: []
|
129
130
|
rubyforge_project:
|
130
|
-
rubygems_version: 2.7.
|
131
|
+
rubygems_version: 2.7.7
|
131
132
|
signing_key:
|
132
133
|
specification_version: 4
|
133
134
|
summary: Javascript Runner for Mumuki
|