shikashi 0.1.0 → 0.1.1
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/CHANGELOG +3 -1
- data/README +7 -1
- data/Rakefile +1 -1
- data/lib/shikashi/privileges.rb +4 -8
- data/lib/shikashi/sandbox.rb +1 -1
- metadata +27 -9
data/CHANGELOG
CHANGED
data/README
CHANGED
@@ -19,10 +19,16 @@ The implementation of shikashi is pure ruby and it is based on rallhook, an amen
|
|
19
19
|
|
20
20
|
=== Gem installation
|
21
21
|
|
22
|
+
Run in the terminal:
|
23
|
+
|
24
|
+
sudo gem install shikashi
|
25
|
+
|
26
|
+
OR
|
27
|
+
|
22
28
|
* Download the last version of the gem from http://github.com/tario/shikashi/downloads
|
23
29
|
* Install the gem with the following;
|
24
30
|
|
25
|
-
gem install shikashi-X.X.X.gem.
|
31
|
+
sudo gem install shikashi-X.X.X.gem.
|
26
32
|
|
27
33
|
== Documentation
|
28
34
|
|
data/Rakefile
CHANGED
data/lib/shikashi/privileges.rb
CHANGED
@@ -90,11 +90,7 @@ public
|
|
90
90
|
@redirect_hash[method_name] = method_wrapper_class
|
91
91
|
end
|
92
92
|
|
93
|
-
def handle_redirection(klass, recv, method_id, sandbox)
|
94
|
-
|
95
|
-
method_name = method_id.id2name
|
96
|
-
return nil unless method_name
|
97
|
-
|
93
|
+
def handle_redirection(klass, recv, method_name, method_id, sandbox)
|
98
94
|
rclass = @redirect_hash[method_name.to_sym]
|
99
95
|
|
100
96
|
if rclass
|
@@ -193,15 +189,15 @@ public
|
|
193
189
|
@allowed_methods << method_name
|
194
190
|
end
|
195
191
|
|
196
|
-
def handle_redirection(klass, recv, method_id, sandbox)
|
192
|
+
def handle_redirection(klass, recv, method_name, method_id, sandbox)
|
197
193
|
if @last_allowed
|
198
194
|
|
199
195
|
if block_given?
|
200
|
-
@last_allowed.handle_redirection(klass, recv, method_id, sandbox) do |mh|
|
196
|
+
@last_allowed.handle_redirection(klass, recv, method_name, method_id, sandbox) do |mh|
|
201
197
|
yield(mh)
|
202
198
|
end
|
203
199
|
else
|
204
|
-
@last_allowed.handle_redirection(klass, recv, method_id, sandbox)
|
200
|
+
@last_allowed.handle_redirection(klass, recv, method_name, method_id, sandbox)
|
205
201
|
end
|
206
202
|
else
|
207
203
|
nil
|
data/lib/shikashi/sandbox.rb
CHANGED
@@ -253,7 +253,7 @@ module Shikashi
|
|
253
253
|
|
254
254
|
|
255
255
|
if privileges
|
256
|
-
privileges.handle_redirection(klass,recv,method_id,sandbox) do |mh|
|
256
|
+
privileges.handle_redirection(klass,recv,method_name,method_id,sandbox) do |mh|
|
257
257
|
mh.privileges = privileges
|
258
258
|
mh.source = source
|
259
259
|
end
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shikashi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 25
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Dario Seminara
|
@@ -9,19 +15,25 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date: 2010-
|
18
|
+
date: 2010-07-31 00:00:00 -03:00
|
13
19
|
default_executable:
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
22
|
name: rallhook
|
17
|
-
|
18
|
-
|
19
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
20
26
|
requirements:
|
21
27
|
- - ">="
|
22
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 7
|
33
|
+
- 0
|
23
34
|
version: 0.7.0
|
24
|
-
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
25
37
|
description:
|
26
38
|
email: robertodarioseminara@gmail.com
|
27
39
|
executables: []
|
@@ -59,21 +71,27 @@ rdoc_options: []
|
|
59
71
|
require_paths:
|
60
72
|
- lib
|
61
73
|
required_ruby_version: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
62
75
|
requirements:
|
63
76
|
- - ">="
|
64
77
|
- !ruby/object:Gem::Version
|
78
|
+
hash: 3
|
79
|
+
segments:
|
80
|
+
- 0
|
65
81
|
version: "0"
|
66
|
-
version:
|
67
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
68
84
|
requirements:
|
69
85
|
- - ">="
|
70
86
|
- !ruby/object:Gem::Version
|
87
|
+
hash: 3
|
88
|
+
segments:
|
89
|
+
- 0
|
71
90
|
version: "0"
|
72
|
-
version:
|
73
91
|
requirements: []
|
74
92
|
|
75
93
|
rubyforge_project:
|
76
|
-
rubygems_version: 1.3.
|
94
|
+
rubygems_version: 1.3.7
|
77
95
|
signing_key:
|
78
96
|
specification_version: 3
|
79
97
|
summary: shikashi is a ruby sandbox that permits the execution of "unprivileged" scripts by defining the permitted methods and constants the scripts can invoke (I.E., the script cannot use the File class or a RoR Model Class unless that permission is specified) "well done version" of ruby-arena-sanbox based on rallhook
|